OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: AnarCHy on 19 Jul 2004, 12:07:43

Title: allowfleeing all?
Post by: AnarCHy on 19 Jul 2004, 12:07:43
I am re-creating the last battle from Platoon (the movie), the one between the U.S. and the 145th(?) NVA Regiment.

I have created a lot of different groups for the NVA, and I am wondering if it is possible to put a trigger somewhere or summat that makes them all "allowfleeing 0", so i dont have to put the command in every single init line?
Title: Re:allowfleeing all?
Post by: macguba on 19 Jul 2004, 12:35:53
"_x allowFleeing 0" forEach [array of units you want it to apply to]

or

"_x allowFleeing 0" forEach units grp1

or

charlieGrp = units grp1 + units grp2
"_x allowFleeing 0" forEach charlieGrp

Syntax not guaranteed
Title: Re:allowfleeing all?
Post by: AnarCHy on 19 Jul 2004, 12:45:40
Thanks but the thing is that none of the NVA units are grouped together, to keep it more realistic and have there actions vary, so which option you think will be best for this?
Title: Re:allowfleeing all?
Post by: dmakatra on 19 Jul 2004, 12:56:47
Make a huge trigger, and in on act field type something like:

"_x allowFleeing 0" forEach units thislist and side == east

I'm not sure it'll work.

:beat: *Gets Shot* :beat:
Title: Re:allowfleeing all?
Post by: AnarCHy on 19 Jul 2004, 13:10:06
It yelled at me  :'(

Not really but it gave me the infamous "invalid number in expression" warning again and pointed to the == in the last part of the trigger
Title: Re:allowfleeing all?
Post by: Messiah on 19 Jul 2004, 13:30:07
try removing the ==
Title: Re:allowfleeing all?
Post by: macguba on 19 Jul 2004, 13:46:11
Try this.  

Area:  whole map
Activation box:   East present
On Activation:    "_x allowFleeing 0" forEach thislist
Title: Re:allowfleeing all?
Post by: dmakatra on 19 Jul 2004, 13:47:14
Wouldn't that cause every1 to allowfleeing 0? Cause everyone is in the trigger. Or am I misstaking?

:beat: *Gets Shot* :beat:
Title: Re:allowfleeing all?
Post by: macguba on 19 Jul 2004, 13:56:36
thislist returns all the units that could activate the trigger, according to first the Activation box.    In this case it would return all the east units.     If you put anybody it would return all the units on the map.    It makes no difference if you put present or not present or whatever.   Here present is good because that will also make the trigger fire.

I always get confused by arrays, but I believe that you only need the "units" bit if you are dealing with a group.   A group is not treated as an array.   Thus

"_x allowFleeing 0" forEach thislist

and

"_x allowFleeing 0" forEach units grp1
Title: Re:allowfleeing all?
Post by: AnarCHy on 19 Jul 2004, 18:58:19
Hey it worx!

I killed like 10 o dem and the others werent gettin scared and running away!

Thanks Macguba +armstrong