Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   triggeraction problem. (https://forums.graalonline.com/forums/showthread.php?t=46451)

Thought 07-24-2003 08:27 AM

triggeraction problem.
 
Ok, i'm scripting a player house system and i've run into a bit of trouble with the doors for the houses.

Currently the owner list is stored via a Server NPC (Database-esq). So I have to have the checking server-side, because the client cannot see the Server NPC flags.

It appears that the server cannot triggeraction events to the client (?).

Is this right? Or is there some special way I need to do it?

I'm currently trying to use:

NPC Code:
with (getplayer(#p(0)) {
triggeraction x, y, srdoor2, ;
}

//#CLIENTSIDE
if (actionsrdoor2) {
//blah
}


TribulationStaff 07-24-2003 08:33 AM

First thing to check is to setshape that npc. That has helped me in times past.

Kaimetsu 07-24-2003 08:36 AM

Why do you need to trigger the player? Why not just open the door on the server's side and let the player through?

Thought 07-24-2003 08:41 AM

Because it opens up for everyone else too, I want it to open up only for that player.

AFAIK the *local commands don't work serverside.

konidias 07-24-2003 09:05 AM

Quote:

Originally posted by Thought
Because it opens up for everyone else too, I want it to open up only for that player.

AFAIK the *local commands don't work serverside.

Then why not be logical and have the player send a triggeraction to the door? :P

Thought 07-24-2003 09:10 AM

Quote:

Originally posted by konidias


Then why not be logical and have the player send a triggeraction to the door? :P

It already does that, I have no way to send a trigger back to the client (?).

Tseng 07-24-2003 09:26 AM

Quote:

Originally posted by Thought


It already does that, I have no way to send a trigger back to the client (?).

You don't need to, though, is what he's saying.

Alternatively, you could: open the door for everyone and handle the warping with an NPC instead of a level link; have it check his account serverside before warping.

You could also not use a door at all, but a warper.

The possibilities are several.

But if you must do it only for that player, I do not understand why you would need...or want, for that matter...to send a triggeraction to the player...

Thought 07-24-2003 09:29 AM

Would:

NPC Code:
with (getplayer(blah)) {
hide;
}



Only have it do that for that player?

osrs 07-24-2003 10:08 AM

Basically all you have to do is check the player account (if he is the owner) and warp him. ^_^

NPC Code:

if(created){
setstring this.door_owner,osrs;
}

if(playertouchsme){
if(strcontains(#s(this.door_owner),#a)) //warp;
else say2 You aren't the owner;
}


Kaimetsu 07-24-2003 11:03 AM

Y'know, guys, when somebody asks how to do something, they generally don't want you to bombard them with alternate designs. They'd prefer you to solve the problem they showed you, not one that you think would be better.

Anyway:

Yes, setshape is an obvious consideration. To my knowledge, there shouldn't be any problem triggering a clientside component from the serverside, but I don't think I've ever tried it before. If not then, as a last resort, you always try setting a save[] or #P() variable to something that uniquely identifies the relevant player, and have the clientside section repeatedly check for such a value.

Thought 07-24-2003 01:42 PM

Problem solved thanks to Chrisz :cool:

You can close this thread now, if you like...


All times are GMT +2. The time now is 01:42 AM.

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