Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   GS2: add player.triggeraction? (https://forums.graalonline.com/forums/showthread.php?t=59038)

Rick 05-21-2005 06:56 AM

GS2: add player.triggeraction?
 
HTML Code:

GraalScript: Function triggeraction not found at line 4 of player in script of Rick
:(

I can't triggeraction specific clients... this is limiting my de-lag of scripts.

Rick 05-21-2005 07:17 AM

I found a hack to get around this limitation:

(in a player.join() class):

HTML Code:

public function yourFunction(arg1, arg2)
{
  with (this)
  {
    triggeraction(0, 0, "clientside", "thing", arg1, arg2);
  }
}


Fry 05-21-2005 01:11 PM

Did you try player.trigger(..)?

Admins 05-21-2005 02:33 PM

with(this)?? x-x
You need to use the "clientside" action like in old script, but it is planned that the triggerserver/triggerclient functions like in Graal3D are added to Graal2D to make it simplier.

Ajira 05-21-2005 04:03 PM

Quote:

Originally Posted by Stefan
with(this)?? x-x
You need to use the "clientside" action like in old script, but it is planned that the triggerserver/triggerclient functions like in Graal3D are added to Graal2D to make it simplier.

=D

Rick 05-21-2005 06:34 PM

Quote:

Originally Posted by Stefan
with(this)?? x-x
You need to use the "clientside" action like in old script, but it is planned that the triggerserver/triggerclient functions like in Graal3D are added to Graal2D to make it simplier.

It is the only way to use triggeraction() when there is no currently associated player. (That I can see).

What do you mean that I need to use the clientside action? I already am, it's just that you can't do something like this from GScript2 right now:

HTML Code:

temp.player = findplayer("SomePlayer");
temp.player.triggeraction(0, 0, "clientside", "Weapon", etc...);

You have to do:
HTML Code:

temp.player = findplayer("SomePlayer");
with (temp.player)
{
  triggeraction(0, 0, "clientside", "Weapon", etc...);
}


Kaimetsu 05-21-2005 07:46 PM

Quote:

Originally Posted by Rick
It is the only way to use triggeraction() when there is no currently associated player

If there's no currently associated player then what does 'this' represent?

Rick 05-21-2005 07:53 PM

Quote:

Originally Posted by Kaimetsu
If there's no currently associated player then what does 'this' represent?

It represents the player, but the NPC server doesn't seem to realize that when using triggeraction(). Hence it's not currently associated

Admins 05-22-2005 01:01 AM

Hmmm the player join stuff has just been added some weeks ago, I guess it should also set the "current player" if you call a script function for the player itself. The "current player" is used for old scripting functions with side effects - triggeraction is a function of npcs, since it is sending the trigger to near players in the current level of the npc, but if the action is "clientside" then it is only sent to the "current player". Adding a triggerclient function for players would make sense here I guess.

Rick 05-22-2005 01:40 AM

There also seems to be an issue with sending clientside triggeractions during onCreated() of weapons or the player.join()'d class. Is it possible you could fix that?


All times are GMT +2. The time now is 08:35 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.