////////////////////////// Respawn Script Notes

This respawn script makes use of the existing "Soldiers" and "Team 0" to "Team 15" actions that hold subjects. The rest is self contained.

Create a new monster/unit set of tags in Fear. This unit will be used in a part of the map the player can't see. Must be unable to move, have no attacks, no visibility, and must not be targetable. Ensure the tag ID is something you can type into Loathing (i.e. no special characters/ascii). Add them to the map. One per team and set to uncontrollable.

Import script to a new map. Go to (GEOM) "Find DM Sensors". Add the tag ID of the new unit into the "Tests for Monsters of Type" parameter. This way less individual clicking for you as the GEOM finds them instead. You only have to do this once as the script you import in the other maps will be based on your first complete version of this script.

////////////////////////// Steps to take each time you import the script.

1) Add the dummy unit (i.e. the hawk ) to all the GEOMs in the respawn script which are the following: "Find DM Sensors", "Find Respawners", and all 16 "Check Spawn" actions.

2) Go to (MOMA) "Move 0" found under (ACLI) "Start Your Engines". Add destination points to all 16 (MOMA) "Move" actions where each number matches the team number of the units. So Move 0's destination point must be Team 0 unit's location on map.

3) Export scripting and copy your new move destination points to their matching (GEOM) "Check Spawn" actions. Copy them to the "Circle Centerpoint" parameter. This saves you clicking and keeps them the same. Copy them to their matching (MUNG) "Spawn" actions as well. Only copy them to the first "world_point2d dest" and not the second one.

4) Import the scripting back to the map. Go to (MUNG) "Spawn" actions and add the destinations points to the second "world_point2d dest" parameters which are meant for the Observer Movement actions for respawning. Add the camera's "Final Facing" to these actions by adding them to the "angle faci" parameters.

5) Move the soldiers to an area in the map where they do not start in and will not be seen in. This could be the edge of the map nearest to them or a specific part of the map. Make sure to give these units space or they will attack each other on respawn if the script does not catch them in time. Now add the polygon points of the area covering their new location to the (GEOM) "Find Respawners" action. If the soldiers are all moved to their closest map edge, this GEOM may need to be modfied to ensure it looks only in thoses areas for these units. No unit should be able to walk to this area or they will get catch in the script.

6) Modify anything else to your needs. Some action trigger times may need adjusting.

////////////////////////// Explanation for the script.

The relocation of the soldiers is done to remove the situation where a unit spawns in its start location and then disappears to its new spawn point. This will be less confusing to users seeing a unit suddenly appear and disappear. This also prevents a unit from appearing in a location near enemies. The script is set to move the units to their start locations via the (MOMA) "Move" actions whether or not deathmatch is enabled. Since this is done at the start of the game, players don't notice the units' relocation at all.

The "DM Sensors" are used to detect if deathmatch is enabled by killing units and testing for them in case they respawn. If DM is detected, the respawn script is started and the GEOM looking for the respawners will blind the player from their unit until a spawn point is picked. 

To cut down the number of actions needed, the script is set up to work for one unit at a time. However using LOCKs enables for a nearly instantanous test of all spawn points. It then randomly picks one that had no enemies and MUNGs the MOMA, OBMO, and other actions to move the soldier unit. After that it continues looking for the next "dead" unit that will be awaiting in the limbo section of the map.

The script is untested, but the theory is sound. Let me know if you run into problems.

////////////////////////// Testing Tip

If you need to test each team, one way of doing it without 16 myth clients or lots of restarts is by using the "Prohibited Netgame Teams" map action. This action is different from the rest in that you don't need to set it to initially active or trigger it at all for it to work. In the only parameter it has, just add the value matching the gametype you are testing in. This is described in the parameter description. Then add all the values matching the team indices that you wish to block from loading. This way on the first try you can load as the specific team you want.
