OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Bad Maniac on 27 Apr 2003, 00:27:57

Title: Commanding a group to move?
Post 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?
Title: Re:Commanding a group to move?
Post by: The_Milky_Bar_Kid on 27 Apr 2003, 00:47:11
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.
Title: Re:Commanding a group to move?
Post by: Bad Maniac on 27 Apr 2003, 02:05:29
(_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.
Title: Re:Commanding a group to move?
Post by: Burn on 27 Apr 2003, 02:38:59
Tgrp = group this;"_x commandMove object2" foreach units Tgrp
Type that in the groupleaders init. field...
... hope it helps... :P
Title: Re:Commanding a group to move?
Post by: Sui on 27 Apr 2003, 02:53:17
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:
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 ;)
Title: Re:Commanding a group to move?
Post by: Bad Maniac on 27 Apr 2003, 12:49:50
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?
Title: Re:Commanding a group to move?
Post by: DrStrangelove on 27 Apr 2003, 14:18:29
just attach your script to your next post, ppl will DL & analyse it (if you're lucky)  :D
Title: Re:Commanding a group to move?
Post by: Bad Maniac on 27 Apr 2003, 14:26:49

;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?