Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Serverside onActionProjectile? (https://forums.graalonline.com/forums/showthread.php?t=81022)

wild8900 08-02-2008 11:45 AM

Serverside onActionProjectile?
 
I cant seem to get it working on serversided scripts. Dont tell me Ill have to use a bunch of triggeractions !pissed!

cbk1994 08-02-2008 03:02 PM

Yeah, I was having this problem a while back. Did you use setshape() on serverside?

EDIT: Do you mean onActionProjectile() for players, or for an NPC?

wild8900 08-02-2008 10:00 PM

An NPC that uses showcharacter(). Ill try the setshape when I get back from work :O

Stryke 08-02-2008 11:06 PM

Yeah, it doesn't seem to work on the serverside. What I did was just use a triggeraction.

TheStan 08-03-2008 12:56 AM

I believe the proper function is onActionProjectile2()

Crow 08-03-2008 01:10 AM

I think it's onActionSProjectile(). Almost sure ;f

Nevermind, that's for serverside projectiles, says the wiki :oo:
onActionProjectile() triggers on serverside when a "projectile has landed". There doesn't seem to be an event when something is hit for serverside stuff, guess you have to do those checks yourself ;P

cbk1994 08-03-2008 01:19 AM

Quote:

Originally Posted by TheStan (Post 1410965)
I believe the proper function is onActionProjectile2()

That's for when a projectile lands, anywhere.

Chompy 08-03-2008 01:30 AM

Quote:

Originally Posted by cbk1994 (Post 1410971)
That's for when a projectile lands, anywhere.

When does projectiles land? I thought they crashed..

cbk1994 08-03-2008 01:56 AM

Quote:

Originally Posted by Chompy (Post 1410974)
When does projectiles land? I thought they crashed..

:blush:

Pheonixfire 08-03-2008 04:28 AM

You might be able to use an OnActionProjectile() clientside and then use a triggeraction() in response. That works for weapons... But it may be different for showcharacter NPCs.

wild8900 08-03-2008 04:56 AM

ergh doing setshape didn't fix it, and yes its a clientside projectile hitting a serverside npc.

Pheonixfire 08-03-2008 05:19 AM

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...

wild8900 08-03-2008 06:42 AM

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");
}


TheStan 08-03-2008 07:56 AM

Uh, setshape on the clientside portion of the class of the npc then?

cbk1994 08-03-2008 08:21 AM

Quote:

Originally Posted by wild8900 (Post 1411041)
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.


All times are GMT +2. The time now is 05:22 AM.

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