Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-21-2006, 05:00 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
NPC Server->Client, Client->Server Identification

NPCs can get complex, and sometimes you might want a means to pass an identification of an NPC from the clientside to the serverside or vice versa. Even from different NPCs. Any chance that there's ever going to be a constant var between the clientside and the serverside of an NPC?
Reply With Quote
  #2  
Old 01-21-2006, 11:24 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
npc.name

Make sure you validate what the client sends though, or they could potentially edit it to affect a different NPC.
Reply With Quote
  #3  
Old 01-21-2006, 09:17 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Rick
npc.name

Make sure you validate what the client sends though, or they could potentially edit it to affect a different NPC.
odarn, so that only works for system NPCs.
Reply With Quote
  #4  
Old 01-21-2006, 11:25 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by jake13jake
odarn, so that only works for system NPCs.
dbnpcs have an npc index.
same with level npcs, but you can also use the level for level npcs.
__________________
Reply With Quote
  #5  
Old 01-22-2006, 12:28 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ZeLpH_MyStiK
dbnpcs have an npc index.
same with level npcs, but you can also use the level for level npcs.
don't think the index is consistent clientside/serverside.
Reply With Quote
  #6  
Old 01-22-2006, 12:56 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by jake13jake
don't think the index is consistent clientside/serverside.
I actually don't know about that, but you can easily test it out. But even if the indeces aren't consistent, the level will be and both level npcs and dbnpcs will have a level (except Control-NPC).
__________________
Reply With Quote
  #7  
Old 01-22-2006, 02:21 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
It's not consistant.

I transfered the ID of the NPC from the clientside to the serverside, then made it set the NPC with that ID's chat on the serverside.
It set a random NPC with no image's chat, not the one it should have.
Reply With Quote
  #8  
Old 01-22-2006, 04:04 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by jake13jake
NPCs can get complex, and sometimes you might want a means to pass an identification of an NPC from the clientside to the serverside or vice versa. Even from different NPCs. Any chance that there's ever going to be a constant var between the clientside and the serverside of an NPC?
To be able to help better I would like to know what kind of things do you want to do exactly?
Reply With Quote
  #9  
Old 01-22-2006, 08:55 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Stefan
To be able to help better I would like to know what kind of things do you want to do exactly?
Well, pass a foreign NPC index/object through a triggeraction.
Reply With Quote
  #10  
Old 01-22-2006, 10:33 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
this.attr[index] is constant between Serverside and Clientside if thats what you mean.
__________________
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 04:55 PM.


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