PDA

View Full Version : triggerclient change


Admins
10-10-2012, 12:00 AM
Soon a new npcserver will be uploaded which enforces correct triggerclient syntax. It must be:

player.triggerclient("weapon", "weaponname", params...)

Instead of "weapon" you can also use "gui". "npc" is not supported yet, it's currently only supported for triggerserver().
This change has been made to speed it up (can speed up some servers 1-2% cpu time since it's called often with a lot of parameters), and to match the syntax of triggerserver().

Update:
You can still provide more than 3 parameters, it's combining all additional parameters to an array/comma text anyway, works with all Graal script functions which expect a string as last parameter (scheduleevent etc.). It's just enforcing that you provide the "gui" or "weapon" parameter.

Crow
10-10-2012, 08:56 AM
So~, what's the difference to current behavior? Syntax still seems to be the same to me.

fowlplay4
10-10-2012, 03:17 PM
Soon you're going to break Zodiac unless I change 100s of triggerclient references.

BlueMelon
10-10-2012, 04:14 PM
I've always used the
triggerclient("weapon/gui", "weaponname", params)
syntax.

Crow
10-10-2012, 04:34 PM
I've always used the
triggerclient("weapon/gui", "weaponname", params)
syntax.

Is there another one? :/

ffcmike
10-10-2012, 05:53 PM
I would guess the difference is between doing:


player.triggerclient("gui", "weaponname", param1, param2, param3);


and


player.triggerclient("gui", "weaponname", {param1, param2, param3});


I recently tested putting all parameters within one array as an optimisation but ran into problems when using multi-dimensional arrays.

Crow
10-10-2012, 06:00 PM
Oh, that.. ugh. Not a nice change.

Admins
10-10-2012, 08:59 PM
You can still provide more than 3 parameters, it's combining all additional parameters to an array/comma text anyway, works with all Graal script functions which expect a string as last parameter (scheduleevent etc.). It's just enforcing that you provide the "gui" or "weapon" parameter.

0PiX0
10-10-2012, 09:24 PM
you can no longer do triggerclient(weaponname, params...)

the correct syntax is still the same:

triggerclient("gui", weaponname, params...)
or
triggerclient("weapon", weaponname, params...)

BlueMelon
10-10-2012, 09:27 PM
Edit: Late post

Either I got the wrong understanding or you guys do.
What I understood,

You must use:
triggerclient("weapon/gui", "weaponname", params)

And you will no longer be able to use:
triggerclient(this.name, params)

Admins
10-10-2012, 09:46 PM
Exactly
I've fixed most scripts on Zodiac, should be ok hopefully. I will also add an echo/syntaxerror.txt output if the first parameter is incorrect.

Crow
10-10-2012, 09:46 PM
I wasn't even aware you could do that.

fowlplay4
10-11-2012, 02:52 AM
Exactly
I've fixed most scripts on Zodiac, should be ok hopefully. I will also add an echo/syntaxerror.txt output if the first parameter is incorrect.

Thanks, I double-checked and confirmed you got everything.

cbk1994
10-12-2012, 04:38 AM
Thanks for keeping us posted on changes.