PDA

View Full Version : local NPC's(putnpc2)


DustyPorViva
01-11-2008, 06:22 AM
So I was making a little pet script... and it works great, sort of.
I create make a putnpc2, and access it... warp it around and such. That all works great, but whenever I want to change something it won't update until it's warped.
For example, I have it so I can set it's chat. If I do "/pet chat testing", it won't set the chat, but if I leave to another level and it warps to me, it's chat will change to testing. Is there anyway I can get these changes to update without warping it?

Chompy
01-11-2008, 03:55 PM
this.trigger("update", 0);

hmm? :o

Novo
01-11-2008, 04:13 PM
I would try restarting the NPC Server to see if it persists... To me, it seems like the packets aren't being sent when particular variables are changed: Restarting might fix that problem.

cbk1994
01-12-2008, 02:02 AM
Happened to me, I believe I fixed it, but can't recall how :x

bscharff
01-12-2008, 02:56 AM
If you're using this.chat = ""; or chat = ""; try using message("");

If you're already using message(""); good luck lol.

DustyPorViva
01-12-2008, 03:12 AM
I tried message(), no luck. It happens whenever I try to change anything... introducing a timeout into the NPC fixed it though.

Skyld
01-12-2008, 03:22 PM
I tried message(), no luck. It happens whenever I try to change anything... introducing a timeout into the NPC fixed it though.
That suggests that the NPC execution is being restored when the NPC experiences an event of some kind (i.e. in this case, the timeout). Are you using a sleep or waitfor anywhere?

Admins
01-12-2008, 03:59 PM
Do trigger("update","") or similar to wake the npc up, like Chompy said. Only attributes of active npcs are sent to the player.