Quote:
Originally Posted by smogo
I'm a bit confused about moving, and grids, in general. Does the logic belong to zone.exe through the DB, quests scripts, ...
|
Its all done in mobai.cpp. The waypoints are loaded and the destination wp is saved in the mob. The entire zone loops through all entities - doors,npcs,clients, etc - processing each in turn.
When it processes an npc, it calculates the distince it will move based on the speed. It determines the direction it is going and calculates the new position where it should be, sending a packet to the client telling it to move the npc to that position.
When it reaches a wp, it sets a timer and waits until the time is up. This means that during that time, each time it processes the npc, it does not move it. Once the time is up, it determines the next destination wp, loads that into the npc and starts moving to it.
Quote:
Could you plese point to, or post to explain how you 'd use your wish list, if it's not 'know-how secret' ?
|
A couple of examples might be... after talking with a player, the npc does a moveto() towards a door. When it arrives, the event_wp is triggered. It then does an opendoor(). Turns to the player using facetarget() and tells the player "what you are looking for is in here".
Another one might be use signal() and targlobal(). By setting a var to a specific value and sending it to the other npc, then doing a signal, you can create a conversation between 2 or more npcs. On event_signal, it checks the global var and does a say() depending on what is in it. Then it does a targlobal() back with a signal to that npc - who checks the var and does a say() based on what is in it... and back and forth.
zsignal() would be used by boats among other things ... but we won't go into that yet.