Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   NPC Server->Client, Client->Server Identification (https://forums.graalonline.com/forums/showthread.php?t=63603)

jake13jake 01-21-2006 05:00 AM

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?

Rick 01-21-2006 11:24 AM

npc.name

Make sure you validate what the client sends though, or they could potentially edit it to affect a different NPC.

jake13jake 01-21-2006 09:17 PM

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.

ZeLpH_MyStiK 01-21-2006 11:25 PM

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.

jake13jake 01-22-2006 12:28 AM

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.

ZeLpH_MyStiK 01-22-2006 12:56 AM

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

Yen 01-22-2006 02:21 AM

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.

Admins 01-22-2006 04:04 PM

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?

jake13jake 01-22-2006 08:55 PM

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.

Inverness 01-22-2006 10:33 PM

this.attr[index] is constant between Serverside and Clientside if thats what you mean.


All times are GMT +2. The time now is 11:25 PM.

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