Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-30-2008, 01:46 AM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
does triggerserver work in classes? (originally named "does...")

does triggerserver work in classes?

something really simple like this doesn't even work so I'm assuming it doesn't work in classes :X


PHP Code:
function onActionServerSide()
{
  
message("hi");
}
//#CLIENTSIDE
function onPlayerChats()
{
  if (
player.chat == "hi")
  {
    
triggerserver("weapon"this.name"");
  }

I always thought it did
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #2  
Old 03-30-2008, 01:49 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
where is this class joined?
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #3  
Old 03-30-2008, 01:51 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
PHP Code:
function onActionStuff() {
  echo(
"Somebody just trigered a test class! Odamn..");
}

function 
onCreated() {
  
setshape(13232);
  
dontblock();
}

//#CLIENTSIDE
function onCreated() {
  
setshape(13232);
  
dontblock();
  
  
triggeraction(this.xthis.y"Stuff"NULL);

Don't use "ServerSide" as the action name, this wont work. I'm also not sure if the shape on the clientside is needed, I just always do it


Edit: Neo also has a valid point. If it's joined into a weapon, it should work.
Reply With Quote
  #4  
Old 03-30-2008, 01:51 AM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
in a level
I'm assuming I have to use triggeraction instead because of that?

ohi crow, didn't see your post yet
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #5  
Old 03-30-2008, 01:56 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Yes, it works if you triggeraction with a seperate name then ServerSide (onActionServerSide will not work). For ones that are joined to NPCS/Weapons, triggerserver will work fine.

Also, you should use name instead of this.name, there are cases when it will return something invalid, or so I have been told. Someone feel free to correct me.
__________________
Reply With Quote
  #6  
Old 03-30-2008, 02:02 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by cbkbud View Post
Also, you should use name instead of this.name, there are cases when it will return something invalid, or so I have been told. Someone feel free to correct me.
Never had any problems with this.name.
Reply With Quote
  #7  
Old 03-30-2008, 02:18 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by cbkbud View Post
Also, you should use name instead of this.name, there are cases when it will return something invalid, or so I have been told. Someone feel free to correct me.
Probably some inexperienced scripter who was trying to get this.name inside of another object when (s)he should have been using thiso.name
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #8  
Old 03-30-2008, 03:23 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Tigairius View Post
Probably some inexperienced scripter who was trying to get this.name inside of another object when (s)he should have been using thiso.name
I've heard people on the forums mention this, in any case, if this.name works, use it!

I'm just going to use name since it is less typing ...
__________________
Reply With Quote
  #9  
Old 03-30-2008, 03:28 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I said that in Sidney's post. You should avoid this.name in most cases and use either thiso.name or just plain name as this.name might be overridden by a function call by another object. Only really matters with public functions and function calls inside a with block though.
__________________
Do it with a DON!
Reply With Quote
  #10  
Old 04-02-2008, 07:18 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
me? i did not post
Reply With Quote
  #11  
Old 04-02-2008, 07:24 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by [email protected] View Post
me? i did not post
He's referring to a different thread
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #12  
Old 04-02-2008, 07:58 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
oh ok!!!
Reply With Quote
  #13  
Old 04-03-2008, 01:16 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by Crow View Post
I'm also not sure if the shape on the clientside is needed, I just always do it
I don't think it is...
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #14  
Old 04-03-2008, 02:57 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Switch View Post
I don't think it is...
Oh well, I dont care myself. Only eats a single line.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:48 AM.


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