Page 1 of 1

Scripts are now dead. 3.5h

Posted: Thu Mar 16, 2006 7:04 am
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]

Posted: Thu Mar 16, 2006 7:44 am
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 :)

Posted: Thu Mar 16, 2006 5:25 pm
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.

Posted: Fri Mar 17, 2006 10:18 pm
by giwo
Can I get a verification on this? I am using 0.98-3.5j with no problems executing JS scripts.

Posted: Fri Mar 17, 2006 11:33 pm
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?

Posted: Sat Mar 18, 2006 12:00 am
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.

Posted: Sat Mar 18, 2006 9:22 am
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!

Posted: Sat Mar 18, 2006 5:30 pm
by stranf
Tested. Fixed as of 3.5k.