Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-24-2003, 08:27 AM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
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
}

__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #2  
Old 07-24-2003, 08:33 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
First thing to check is to setshape that npc. That has helped me in times past.
__________________


Help me keep scripting
Reply With Quote
  #3  
Old 07-24-2003, 08:36 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Why do you need to trigger the player? Why not just open the door on the server's side and let the player through?
__________________
Reply With Quote
  #4  
Old 07-24-2003, 08:41 AM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
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.
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #5  
Old 07-24-2003, 09:05 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
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
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #6  
Old 07-24-2003, 09:10 AM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
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 (?).
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #7  
Old 07-24-2003, 09:26 AM
Tseng Tseng is offline
Sublime
Tseng's Avatar
Join Date: Jan 2003
Location: California
Posts: 0
Tseng is on a distinguished road
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...
__________________
Funny Things:
Quote:
Originally posted by Stefan
I didn't ban you, I only played a little bit with my RC.
-----
Reply With Quote
  #8  
Old 07-24-2003, 09:29 AM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
Would:

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



Only have it do that for that player?
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #9  
Old 07-24-2003, 10:08 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
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;
}

__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #10  
Old 07-24-2003, 11:03 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #11  
Old 07-24-2003, 01:42 PM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
Problem solved thanks to Chrisz

You can close this thread now, if you like...
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
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 01:50 PM.


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