[FIXED] Scripts are now dead. 3.5h

Here we stuff all the bugs we've managed to squash/squish/squelch.
Post Reply
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Scripts are now dead. 3.5h

Post by stranf »

Has the JS engine changed from 3.4 to 3.5?

from at least 3.4w up, all of my items based scripts as well as my GM fame script do not work anymore.

For example, my cursed items2 script goes like this:

Code: Select all

function onEquip(mChar, ourObj)
{
  mChar.EmoteMessage("*Gasps in extreme pain*" );
  mChar.health -= RollDice(4,20,0);

 }  //script used for cursed gloves
On at least 3.4 this script worked (i tested it), Then I copied the .exe from 3.4w over and it gave an error:

Function EmotMessage undefined, or something like that. I figured you got rid of that function since it was redundant anyway, so I changed it to:

Code: Select all

mChar.TextMessage
Now it compiles, and even runs (console shows zero errors), but none of the effects happen.

Strange....[/code]
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

I do know there have been some changes, and I don't know if you saw Giwo's comments on a thread about your world stuff.
As a note, stranf, I noticed that you have this entry under CONSOLE_SCRIPTS

Code: Select all

//add custom scripts here 
3001=custom/healer.js 
3002=custom/loremaster.js 
5020=custom/magici1.js 
5021=custom/magici2.js 
5022=custom/cursedi1.js 
5023=custom/sa_weapons.js 
5024=custom/ea_weapons.js 
5025=custom/ex_weapons.js 
5026=custom/spa_weapons.js 
5027=custom/mw_arms.js 
5028=custom/shld_arms.js 
5029=custom/prt_arms.js 
5030=custom/fort_arms.js 
5031=custom/cursedi2.js 
These entries should likely be moved to the SCRIPT_LIST section.
I don't know for sure, but this may be part of the issue. If you can confirm if it is this or not would be handy. If it really is broken, I guess someone has to track it down :)
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

yeah. I'll move them back and test. I grouped them together to be easilly cut and paste. Strange thing is, is that the healer and loremaster still work. :) (all of them actually worked before until 3.4w. I'll lump them all in Script_list and report.


No sense having all of you tracking down a bug I created! So don't worry about it, until I have another issue.

Thanks.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Can I get a verification on this? I am using 0.98-3.5j with no problems executing JS scripts.
Scott
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

i can't get 3.5k downloaded yet and i havn't moved the .js scripts yet.

but its weird, since the loremaster, wandering healer, bounty hunter and my gm scripts are under the same section as my item scripts.

Those scripts all work, it's the item scripts that don't.

Are you perchance using my item scripts and they are firing?
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Found it, the user and the object were submitted in the wrong order. I'll commit the fix and upload a new experimental build.

Edit:
The new experimental build is up.
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Thanks Grimson!


You said they were being submitted in the wrong order, is that an error in my script, or the way the values were passed in .js?

Obviously if the fix is on CVS it's the engine...stupid question.

I'll see if I can download the new version.

Thanks again guys!
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Tested. Fixed as of 3.5k.
Post Reply