Apologies about replying to this old thread but its similar to my issue and I cannot create a thread of my own.
I'm trying to make one friendly AI artillery fire at 3 separate targets using script.
The friendly artillery is a Zamak MRL with the variable name "art1"
I have placed 3 markers down in the editor and called them "target1" "target2" and "target3"
The script is activated by a trigger
The script works with no errors and actually fires 3 rounds on the first target, "target1" but it doesn't seem to be looping and is not proceeding to fire 3 rounds at the next target, "target2"
Here is the script named "ambient_art.sqf":
target_array = ["target1","target2","target3"];
target_index = 0;
while {(target_index <= 2)} do{
target_choice = (target_array select target_index);
ammo1 = getArtilleryAmmo [art1] select 0;
tgt = getMarkerPos target_choice;
art1 doArtilleryFire[tgt,ammo1,3];
target_index = target_index + 1;
sleep 3;
}
in the trigger, which is fired when the player walk in I have in the activation field
script = [] execVM "ambient_art.sqf"
Any help will be deeply appreciated