OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Mock360 on 18 Aug 2007, 02:09:23
-
I created the following script. It does the job but I know there has to be a more "elegent" way of doing it. If anyone has the time to give a quick critique, I would appreciate it. Basically a teleport in a multiplayer game. Script is activated by Radio Alpha. Spot1 and tgt1 are Game Logics.
?!(local server) : exit
; tgt1.sqs
;--------------------------
tgt11 SetPos (GetPos spot1)
tgt12 SetPos (GetPos spot1)
tgt13 SetPos (GetPos spot1)
tgt14 SetPos (GetPos spot1)
tgt15 SetPos (GetPos spot1)
tgt16 SetPos (GetPos spot1)
{_x SetDir 180} forEach units opfgrp1
~2
{_x domove GetPos tgt1} forEach units opfgrp1
Thanks in advance.
-
?!(local server) : exit
; tgt1.sqs
;--------------------------
_tgtarray = ["tgt11","tgt12","tgt13","tgt14","tgt15","tgt16"]
{_x setpos (getpos spot1)} foreach _tgtarray
{_x SetDir 180} forEach units opfgrp1
~2
{_x domove GetPos tgt1} forEach units opfgrp1
Is that what you wanted?
-
what are tgt11-16?
-
Tgt11-16 are troops. Thanks for the help. Just trying to improve my scripting skills. :D
-
I think you will want to remove the quotes around the items in _tgtarray.