Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   if (action)...clientside??? (https://forums.graalonline.com/forums/showthread.php?t=15755)

Bravo_LAT-Admin 10-30-2001 04:40 AM

if (action)...clientside???
 
I have a simple question (might lead to the root of why my script won't work.) is if (action) commands only clientside? cause here is a test i did...and it worked clientside only.

if (actionberry)
{message ouch;}
//#CLIENTSIDE
if (actionberry)
{
if (playerdir==0) { putleaps 0,playerx+0.5,playery-1; };
if (playerdir==1) { putleaps 0,playerx-2,playery+1; };
if (playerdir==2) { putleaps 0,playerx+0.5,playery+2.5; };
if (playerdir==3) { putleaps 0,playerx+3,playery+1; };
}

KJS 10-30-2001 04:55 AM

no its not only clientside but mabie theres a glitch in putting it 2 times in 1 npc

I know that you can't trigger an action and have it reseve it in the same npc

Bravo_LAT-Admin 10-30-2001 05:03 AM

hmm well yes the triggeraction is performed with a seperate weapon npc. thats why the leaps work. Even after i take them out it still won't perform the serverside triggeraction...:(

grim_squeaker_x 10-30-2001 07:15 PM

Very strange, for as far as I know triggeraction should work both client and serverside, of course perhaps it doesn't work when you try to trigger something both client and serverside.

wark2 10-31-2001 12:44 AM

!
 
I think you have to put //#CLIENTSIDE before every script to make it work...?!
I dunno i aint no good scripters like you guys!

AlexH 10-31-2001 02:10 AM

*wishes he knew P2P scripting*

Bravo_LAT-Admin 10-31-2001 03:57 AM

well wark putting clientside in the front will make the whole thing clientside therefore only the person doing the triggeraction will be able to see the image change and the variable will only change for them.. and grim i did try it by itself both ways...only the clientside worked...maybe it is a glitch in that case stefan needs to restart our npcserver..

TDK_RC2 10-31-2001 06:55 AM

no put //#CLIENTSIDE in the part thats clientside and //#SERVERSIDE on the other part that should work i dont remember

BocoC 10-31-2001 07:22 AM

Um. I really don't know how to answer this. Triggeraction seems to differ in the way it triggers for me. I dunno. I guess it should work. I once thought that only clientside triggeractions could modify clientside scripts, and serverside triggeractions only serverside scripts, but no, that isn't it. I dunno. I think Stefan should UPDATE commands.rtf and INCLUDE which commands are clientside, and which are serverside. Oh, and //#SERVERSIDE does not exist.

Loriel 11-03-2001 03:51 AM

Re: if (action)...clientside???
 
Quote:

Originally posted by Bravo_LAT-Admin
I have a simple question (might lead to the root of why my script won't work.) is if (action) commands only clientside? cause here is a test i did...and it worked clientside only.

if (actionberry)
{message ouch;}
//#CLIENTSIDE
if (actionberry)
{
if (playerdir==0) { putleaps 0,playerx+0.5,playery-1; };
if (playerdir==1) { putleaps 0,playerx-2,playery+1; };
if (playerdir==2) { putleaps 0,playerx+0.5,playery+2.5; };
if (playerdir==3) { putleaps 0,playerx+3,playery+1; };
}

Triggeraction works in every direction... clientside -> clientside, clientside -> serverside, serverside -> serverside and serverside -> clientside!
To fix your script, you need to use setshape or showcharacter to make the NPC server know the size of the NPC, so it can check if the trigger hit your NPC.
But an easier way would definately be making it all clientside: The triggering is sent to every player anyways, so it shows only locally, but locally for all players (only the NPC Server would not see the message then, but I doubt he cares).

Bravo_LAT-Admin 11-03-2001 09:55 AM

hmm
 
but each bush requires a this.variable to tell how many berrys are left of the bush if i make it all clientside there will be a different number for everybody.

Loriel 11-03-2001 06:48 PM

You can do the leap and message stuff clientside, and have the variable serverside. You need setshape/showcharacter then.

Bravo_LAT-Admin 11-04-2001 03:55 AM

ok thank you XD i forgive you for *accidently* disconnecting me last month =p lol

:D :D :D

kyle0654 11-04-2001 04:17 AM

Just do the whole thing serverside.

When you use triggeraction and a serverside npc recieves the action, it will automatically use player variables (playerx,playery,playerdir, all those) from the player that triggered the action.

Loriel 11-04-2001 04:22 AM

I don't think serverside putleaps are shown for the client. Actually I am quite sure they are not.

kyle0654 11-04-2001 04:34 AM

Ick, putleaps...evil, didn't notice that...thought it was a move code.

Bravo_LAT-Admin 11-04-2001 05:52 AM

the only thing showcharacter is doing is turning the bush into an npcperson 0.o

Loriel 11-04-2001 06:23 AM

Quote:

Originally posted by Bravo_LAT-Admin
the only thing showcharacter is doing is turning the bush into an npcperson 0.o
You need to use a gani then, of course, or just use setshape.


All times are GMT +2. The time now is 07:34 AM.

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