Hey gents,
was thinking about how to keep track of all player positions in MP via scripting, and without using any triggers.
Possible approach:
Activation distance is set to 500m. Areas are represented by markers, set to markersize 0,0 so they can't be seen but you can still use them for storing information. For example, set its color or set its rotation if a player is inside a 500m radius. That way you could activate anything that needs to be done if a player is near, like spawning civilians & enemy forces & special structures.
A MP script handling player activated markers would need to handle 3 situations:
1. Sole player is inside a marker radius
2. Sole player is outside "
3. Several players are inside a marker. 1 player left the marker radius while others are still inside the marker.
Obviously, the 3rd is the tricky one. Imo this can't be done without all scripts synced via a clock signal. For example: if every player checks his position every 1 second, a script would need 2 seconds (2 clocks) to solve the problem of the 3rd situation:
- 1st clock signal: 1st and 2nd player are inside the marker
- 2nd clock signal: 1 is outside, 1 is inside the marker. (we can't know if the marker setting is right now or was overwritten with a false setting)
- 3rd clock signal: only 1 player is signalling: i'm inside
So basically the script would only need to signal once that a player left the marker but only if he was inside the same marker before.
What i'd like to know is if somebody has a more easier approach to this. Anyone?