Determining NPC vs Human - 27/09/14 03:45 PM
I'm working on a multiplayer mod. Each character not controlled by a human will be controlled by the computer. The system I'm using to determine NPC or human is crashing the editor. Would you guys mind taking a look? The general idea is to do the following:
1. Teleport the party
2. Ungroup the party so they don't follow the leader
3. Record the position of all characters in a character DB
4. Wait 2 seconds to give humans a chance to move their character
5. Set a DB flag to enable the determination system
6. Get the position for all of the characters in Character DB again.
7. If the original position matches the new position record the character as a NPC. Once the NPCs have been recorded record the others as humans.
The code I've copy pasted assumes the character DB was built in the INIT section, the party has already been teleported and the flag to enable the system has been set. I left these out because they are all working.
Here's the code:
1. Teleport the party
2. Ungroup the party so they don't follow the leader
3. Record the position of all characters in a character DB
4. Wait 2 seconds to give humans a chance to move their character
5. Set a DB flag to enable the determination system
6. Get the position for all of the characters in Character DB again.
7. If the original position matches the new position record the character as a NPC. Once the NPCs have been recorded record the others as humans.
The code I've copy pasted assumes the character DB was built in the INIT section, the party has already been teleported and the flag to enable the system has been set. I left these out because they are all working.
Here's the code: