Full disclosure: I'm very new to scripting - I know I'm probably not doing things the most efficient way, so any tips will be warmly welcomed!
I'm making an Exile WWII zombie server using Ravage zombies. The built-in ambient spawner for Ravage works okay, but I wanted to add greater variety in uniforms, loot, etc, so tried to write something myself. As disclosed above, this isn't my strong suit at all.
I want the script to trigger at certain locations. I'd got in mind that I'd create an array (called _trgPos) that would hold the positions and radii of each trigger then create each trigger in a loop. This is what I've got so far:
_trgpos = [
[[7365.57,2201.88,0],200], // A
[[6422.59,2424.74,0],200] // B
pos = _x select 0;
_rad = _x select 1;
_trg = createTrigger ["EmptyDetector", pos, true];
systemChat format["Creating trigger at %1",pos];
_trg setTriggerArea [_rad, _rad, 0, false, _rad];
_trg setTriggerActivation ["GUER", "PRESENT", true];
_trg setTriggerStatements ["this", "null = [pos] execVM 'zombiespawner.sqf'; systemChat format['Spawning zombies at %1',pos];", ""];
} forEach _trgpos;
It's meant to pass pos to the script, which then causes the zombies to spawn when an Exile player enters the area.
What actually happens is both triggers are created at their correct location, but when either A or B trigger is activated, the zombies spawn at the location of B. I've seen it works like this in 3DEN or when executed on the server.
It seems that B's location is being passed to the script on both triggers.
Have I missed something basic? Any insight anyone could offer would be fantastic!
(Including zombiespawner.sqf in case it's useful):