OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: dalton on 30 Jan 2004, 04:29:47

Title: chain reaction of deaths
Post 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?
Title: Re:chain reaction of deaths
Post by: dalton on 30 Jan 2004, 13:20:15
ne1 knoiw?
Title: Re:chain reaction of deaths
Post by: dalton on 30 Jan 2004, 14:41:19
ne1?
Title: Re:chain reaction of deaths
Post by: StonedSoldier on 30 Jan 2004, 14:51:58
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
Title: Re:chain reaction of deaths
Post by: dalton on 30 Jan 2004, 14:59:22
it says: invalid number in expression

and the curser points right before the < in the condition field
Title: Re:chain reaction of deaths
Post by: StonedSoldier on 30 Jan 2004, 15:04:29
im sorry, stupid syntax error

try this count units eastgroup < 1
Title: Re:chain reaction of deaths
Post by: dalton on 30 Jan 2004, 15:25:10
k that works
ty

now how to kill the nearest west guuy?
Title: Re:chain reaction of deaths
Post by: HuNtA on 30 Jan 2004, 17:52:14
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
Title: Re:chain reaction of deaths
Post by: dalton on 30 Jan 2004, 19:59:51
no the east leader would already be dead
Title: Re:chain reaction of deaths
Post by: dalton on 30 Jan 2004, 20:09:11
i tried it w/o the [leader,"soldierE" thing so it would just be nearestObject setdammage1.0

but it said "unknown operator"
Title: Re:chain reaction of deaths
Post by: dalton on 31 Jan 2004, 10:41:08
ne1 know the syntax?
Title: Re:chain reaction of deaths
Post by: macguba on 31 Jan 2004, 10:45:25
It's in the command reference.
Title: Re:chain reaction of deaths
Post by: dalton on 31 Jan 2004, 11:14:38
which 1? or is there only 1?
Title: Re:chain reaction of deaths
Post by: macguba on 31 Jan 2004, 11:29:00
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.