Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-03-2008, 05:19 AM
Pheonixfire Pheonixfire is offline
(Director)
Pheonixfire's Avatar
Join Date: May 2008
Posts: 3
Pheonixfire is on a distinguished road
Allow me to clarify. I would add a clientside section with the "function OnActionProjectile()" code, and inside that function put a triggerserver() for a weapon. You could try a triggeraction() since it's not a weapon, and put the onaction in the serverside part of the code. That should work...
__________________
The blind seer sees only oblivion.
Reply With Quote
  #2  
Old 08-03-2008, 06:42 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Ugh so I tried a trigger, why wont this work?
hurtenemy is a function I made in the serverside section of the script that does some other functions. I intentionally left out a few params on the triggeraction, just for testing purposes. Doesn't work though.
NPC Code:
function onActionClientproj() {
hurtenemy();
}
//#CLIENTSIDE
function onActionProjectile() {
triggeraction(x + 0.5, y + 0.5, "Clientproj");
}

Reply With Quote
  #3  
Old 08-03-2008, 08:21 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 wild8900 View Post
Ugh so I tried a trigger, why wont this work?
hurtenemy is a function I made in the serverside section of the script that does some other functions. I intentionally left out a few params on the triggeraction, just for testing purposes. Doesn't work though.
NPC Code:
function onActionClientproj() {
hurtenemy();
}
//#CLIENTSIDE
function onActionProjectile() {
triggeraction(x + 0.5, y + 0.5, "Clientproj");
}

As Stan said, set the shape, but also, you should use this.x and this.y since this is GS2.
__________________
Reply With Quote
  #4  
Old 08-03-2008, 12:17 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbk1994 View Post
As Stan said, set the shape, but also, you should use this.x and this.y since this is GS2.
You don't need to use this.x and this.y when there's no other scopes involved (This is for npcs, not for players). It's about personal preference.

Also, you need a setshape serverside for the serverside to detect triggers and a setshape clientside for the clientside to detect triggers

Quote:
Originally Posted by cbk1994 View Post
:]
__________________

Last edited by Chompy; 08-03-2008 at 12:29 PM..
Reply With Quote
  #5  
Old 08-03-2008, 02:27 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
onActionProjectile() triggers clientside when the player is hit with it. You should use onActionProjectile2() I guess, not sure if onActionProjectile() works for NPCs.
For onActionProjectile2():
params[0] is the x where the projectile lands
params[1] is the y
params[2 .. n] are the shoot paramaters (setShootParams() I think)
Reply With Quote
  #6  
Old 08-03-2008, 05:51 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 Chompy View Post
You don't need to use this.x and this.y when there's no other scopes involved (This is for npcs, not for players). It's about personal preference.
People actually take that as personal preference?

That's just being lazy in my opinion, and it can make it hard to go back and edit.
__________________
Reply With Quote
  #7  
Old 08-03-2008, 05:53 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbk1994 View Post
People actually take that as personal preference?

That's just being lazy in my opinion, and it can make it hard to go back and edit.
Lazy? All scripters are lazy, so what's your point? =D
__________________
Reply With Quote
  #8  
Old 08-03-2008, 05:55 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 Chompy View Post
Lazy? All scripters are lazy, so what's your point? =D
__________________
Reply With Quote
  #9  
Old 08-03-2008, 06:22 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 cbk1994 View Post
People actually take that as personal preference?

That's just being lazy in my opinion, and it can make it hard to go back and edit.
I don't see anything wrong with it, and it's not really being lazy either. Sometimes it adds to the readability of a formula or something similar.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:31 AM.


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