Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-14-2010, 09:37 PM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
Do triggerserver() And onActionServerSide work in a class?

I made a class, first time i used classes, and in the end it also appeared to be a totally out of the way of achieving what i wanted.
But the reason i gave up on my class, and used a weapon, was because i couldn't get my triggerserver to work in the class, and im 100% positive that it was the triggerserver, or onActionServerside that wasn't working, because in the function that i had the triggerserver, i made my player say something, and he said it, if i pasted it in any part of the onActionServerSide, he didn't say anything.
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.
Reply With Quote
  #2  
Old 01-14-2010, 09:44 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
Yes and no, to answer the question in the thread title. Classes can also be joined to weapons, so theoretically, it works in classes. But it doesn't in level NPCs. You will have to do something along the lines of this:

PHP Code:
function onActionExample()
  echo(
"I was triggered on the serverside!");

function 
onCreated()
  
setShape(13232);

//#CLIENTSIDE
function onCreated() {
  
setShape(13232);
  
triggerAction(this.xthis.y"Example"nil);

There are important things to note though:
- you need a shape on the serverside (I usually add the same on the clientside too)
- the action may not be named "Serverside" or "Clientside", that won't work
Reply With Quote
  #3  
Old 01-14-2010, 09:54 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
^ Such a method is unreliable in certain circumstances, it should be noted. Triggeraction triggers the first NPC it 'finds', so if there is an NPC on top of the class it will capture the triggeraction, even if it doesn't do anything with it, and essentially break the NPC that was relying on it.
Reply With Quote
  #4  
Old 01-15-2010, 02:23 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
onActionServerSide should work fine in classes.
Reply With Quote
  #5  
Old 01-15-2010, 08:55 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Stefan View Post
onActionServerSide should work fine in classes.
Surely you've noticed that serverside/clientside triggers don't work most of the time in classes...?

Oddly enough, it seems to just get worse over the years, maybe with each release, I'm unsure. I remember it used to work just fine. Now it almost never does.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #6  
Old 01-15-2010, 10:10 AM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
I've made a NPC in a level, a sign in this case, and all it does is connect to the class, then in the class i have both the triggerserver, and the onactionserverside.
I wasn't even sure if i was making the right use of classes tho, never used them before.
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.
Reply With Quote
  #7  
Old 01-15-2010, 01:43 PM
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 coreys View Post
Surely you've noticed that serverside/clientside triggers don't work most of the time in classes...?

Oddly enough, it seems to just get worse over the years, maybe with each release, I'm unsure. I remember it used to work just fine. Now it almost never does.
He's probably referring to weapon scripts, where classes will always work.
__________________
Reply With Quote
  #8  
Old 01-15-2010, 04:07 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I've had problems with onActionClientSide in a class at some point but it was more a problem of the clientside part not loaded yet.
Reply With Quote
  #9  
Old 01-15-2010, 04:59 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Stefan View Post
I've had problems with onActionClientSide in a class at some point but it was more a problem of the clientside part not loaded yet.
The clientside part stops loading script updates to classes after a certain amount of time/updates (cause unknown) and won't fetch the new updates until you relog, or in some cases, restart the client.
Reply With Quote
  #10  
Old 01-15-2010, 11:02 PM
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 xXziroXx View Post
The clientside part stops loading script updates to classes after a certain amount of time/updates (cause unknown) and won't fetch the new updates until you relog, or in some cases, restart the client.
I've only noticed this with classes joined to the player (where it always seems to happen). Does it happen with other classes :o?
__________________
Reply With Quote
  #11  
Old 01-15-2010, 11:18 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by cbk1994 View Post
I've only noticed this with classes joined to the player (where it always seems to happen). Does it happen with other classes :o?
To my knowledge, no. Only classes joined to the player. Sometimes you can update a script indefinite amount of times and the client will recognize so, but sometimes you can update it three, two or even one time and the client won't know you did a thing to the script. Seems completely random to me.
Reply With Quote
  #12  
Old 01-16-2010, 11:45 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Well, all I know is that triggering between client/server in level npcs with classes almost never works anymore.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #13  
Old 02-25-2011, 02:31 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by Stefan View Post
I've had problems with onActionClientSide in a class at some point but it was more a problem of the clientside part not loaded yet.
sorry to bump such an old thread, but will this whole thing be fixed? I could really use a triggerclient on my class!
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #14  
Old 02-25-2011, 02:37 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 Jiroxys7 View Post
sorry to bump such an old thread, but will this whole thing be fixed? I could really use a triggerclient on my class!
What exactly are you trying to do? You can use triggerClient to trigger a weapon and catch the onActionClientside event, you just need to understand that you can't trigger a class itself. You have to trigger the weapon which the class is joined to.
__________________
Reply With Quote
  #15  
Old 02-25-2011, 03:34 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
What exactly are you trying to do? You can use triggerClient to trigger a weapon and catch the onActionClientside event, you just need to understand that you can't trigger a class itself. You have to trigger the weapon which the class is joined to.
I have a weapon that puts an npc (which uses the class as it's script) that emits particles that obscure vision. I want it so it can pass the this.dropper variable over to the clientside so I can make the alpha much lower for the person who dropped it. I have a feeling that something could bug out if I tried joining it to the weapon that holds the skill script.
__________________
MY POSTS ARE PRONE TO EDITS!
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 07:30 AM.


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