OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Bad Maniac on 27 Apr 2003, 00:27:57
-
This game is so stupid >:(...
in the init line of a group leader I type:
this CommandMove object2
and only the leader goes off, the other units in the group just sits around doing nothing.
I tried
groupname CommandFollow leader groupname but it says "error expecting unit or array"
so I did
[T1,T2,T3,T4] CommandFollow leader groupname
and the error goes away, but still only the leader moves, all the other units just stays put.
I need a hand here, how can I make the whole group move?
-
Whats wrong with waypoints?
If that is a problem try this:
"_x commandMove object2" forEach units group this
in the init field of the officer.
-
(_x commandFollow leader T1) forEach units group T1;
Error Local Variable in Global Space.
???
help, what's wrong with the above code?
The thing is, I have a script that makes the leader follow another unit NOT in the same group. I just need the other units in the same group as T1 to follow T1.
-
Tgrp = group this;"_x commandMove object2" foreach units Tgrp
Type that in the groupleaders init. field...
... hope it helps... :P
-
Use your orginal line, but replace commandmove with move. eg.
this Move object2
Also, shouldn't there be a getpos in there somewhere? eg.
this Move getpos object2
Anyway, the differences between the move command:
- Move: Effectively gives the unit (or group) a new move waypoint at the position specified.
- Commandmove: The same as the units leader ordering the unit to move to a postion. Hence, only one unit will follow the order, not the whole group
- Domove: The silent version of commandmove (ie. no "6 move to 23 4" order is given)
Also, I'm not too sure you can put orders like that in an init line...
If those suggestions still don't work, try giving the unit a waypoint and putting the line in it's OnAct field ;)
-
I'm putting the orders in a script, and Move isn't in the command ref...
funny thing is, move works when I put it in the init field to try it, but it does nothing at all when I put move in my script... I'm going insane, I just want a group to follow a unit, from another group, can someone give me a hand with the script?
-
just attach your script to your next post, ppl will DL & analyse it (if you're lucky) :D
-
;Unit Follow Script
_obj1 = _this select 0
_obj2 = _this select 1
#Start
_obj1 Move GetPos _obj2;
~1
? (alive _obj1) : goto "Start"
exit
Never mind the bollocks. I solved the problem after LOTS![/u] of experimenting :D
the above script works , only Move MUST be move
I don't know why, but the move command is case sensitive when you place it in a script... weird no?