![]() |
/reset npc NAME
It would be nice if you could reset DbNPC's via script
with a NPC.reset(); or if you could do sendToRc( "/reset npc" @ NPC); |
Why?
|
I have certain scripting needs...
|
Quote:
|
I'm using an NPC as a main plot point for my server. It goes to another room and some vars change. Both client and server sides. My current work around is a lot parts of the script setting all the vars back to what they were when I created the NPC, (warpto() and all that) it just be a lot easier if I could just reset the NPC via script. This is more so for convenience.
|
when you're doing a levelnpc in a DBNPC for easier testing, you often have to reset it because of clientside scripting to make the function "onCreated" to be called, therefor, i agree with this idea.
|
Quote:
|
Yeah but the convenience of .reset() seems more practical.
|
You can store all your variables in a new object..
Like this.state = new TStaticVar(); Then declare all the variables as such: this.state.health = 10; Then when you need to clear all the variables, you can do: this.state = null; and then simply initialize it again. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
onRCChat()
in the Control-NPC then you can do /npc reset whatever |
O_o I have to try this tomorrow, never heard of it.
|
Quote:
PHP Code:
|
I need the NPC itself to reset itself, not it to reset a player.
|
Quote:
|
bump
|
I still do not believe this is necessary. Like it was said earlier in the thread, if you are needing to reset an NPC routinely then you are doing something wrong.
|
Quote:
|
Quote:
Dang it, Deas beat me to it! |
You can silently update a level (server-side) using:
fileupdate("level.nw"); Perhaps that would satisfy your wants. |
Quote:
|
Quote:
|
Quote:
Quote:
so how are your little idea supposed to work to prevent having to do "reset" on the dbnpc to call clientsided "onCreated"? i've confused myself :cool: |
The only way you're going be able to "reset" an npc is with sendtorc("/npc reset dbname") on the server-side, if you update the level, you'll update the client-side scripts as well.
I personally believe you should probably be doing something differently if you have to reset the NPC to get it working properly. |
Quote:
i often use it when i do levelnpc instead of having to alter the level before ive made the script.. and then i put it in a class when im done.. is that different enuf for you? ;) |
Quote:
|
| All times are GMT +2. The time now is 12:06 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.