Cheers deaddog and MacGuba,
I have now got it working ... nearly ...
I used the "vehicle _x..." at the start of the loop, which successfully beamed a group of two cars and drivers to the correct position, but separately. For some reason, the cars were damaged quite badly (now I know why they could never get McCoy into those transporters) and the drivers leapt out and wandered off to the waypoint.
I'm betting that it's because one car is being dropped on top of the other since with a single car, the script now works without any problems (and is curiously entertaining to watch
).
I'd rather use groups than individual vehcles as it will save me some fat-fingering so if anyone can think of a way of teleporting the cars in a line spaced out by a few metres, I'll be grateful, but the principle works and might be useful for other things.
The script is:
;Script to loop vehicle between two checkpoints in one direction only
;Call the script from the init line of each vehicle
;in this example the start checkpoint is northGen and the end is westGen
_lead = _this select 0
_beamMeUp = group _lead
_scotty = units _beamMeUp
#checkpos
if (_lead distance westGen < 50) then {goto "beam"}
~1
goto "checkPos"
#beam
"vehicle _x setPos getPos northGen" forEach _scotty
"vehicle _x setDamage 0" forEach _scotty
player sideChat "Script executed"
goto "checkPos"
Now all I need to do is choose my checkpoint locations carefully. While I want to avoid any unwanted crashes between AI vehicles, a few smashes induced by the player weaving to avoid 50 cal rounds should give the right atmosphere.
I'll experiment to find the optimum traffic density. I have a 1.8 GHz Athlon- based system which gets 3488 on the OFP benchmark, which I guess is a sort of average PC. Does anyone have an estimate of the maximum number of units you can run at a decent speed on different benchmark ratings? I could even write a script to spawn extra vehicles on a fast PC if this would be useful.
Ade