OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: dalton on 30 Jan 2004, 04:29:47
-
i want an east group to stay alive. so if the group is dead, i want the closest west person to die for this. is there ne way to do so?
-
ne1 knoiw?
-
ne1?
-
i dunno how you would punish the nearest westerner but to punish the player if the eastern group dies, use a trigger
Condition
eastgroup count units < 1
On Activation
player setdammage 1.0
and in the Init field of the leader of the eastern group type eastgroup = group this
when i get back home i'll fire up OFP and see if i can detect nearest westerner
-
it says: invalid number in expression
and the curser points right before the < in the condition field
-
im sorry, stupid syntax error
try this count units eastgroup < 1
-
k that works
ty
now how to kill the nearest west guuy?
-
Condition
count units eastgroup < 1
On Activation
nearestObject [leader,"soldierE" setdammage 1.0
put this in the init of the group leader (called leader) type eastgroup = group this
that may work
-
no the east leader would already be dead
-
i tried it w/o the [leader,"soldierE" thing so it would just be nearestObject setdammage1.0
but it said "unknown operator"
-
ne1 know the syntax?
-
It's in the command reference.
-
which 1? or is there only 1?
-
There are several versions, mostly in the Editors Depot - Tutorials - References. The Unofficial command reference guide is a little old now but still excellent.
The only exception is the online version, which you can access directly from the Editors Depot homepage. Look down the left hand menu column till you find COMMAND. It is just the official comref but with added Comments, which can be very useful.
Whenever you see a command mentioned in the forum that you want to use, you should always [/i]check it in the comref. Although forum posts are almost always substantially correct, copying and pasting directly from a forum post rarely works. In any case, unless you get to understand how a command works you won't have learned anything.