OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 22 Jan 2005, 18:25:45

Title: Firing within a certain distance.
Post by: greg147 on 22 Jan 2005, 18:25:45
I'm trying to make a mission that involves you firing a grenade at a building (thats not all of it, just a small part  ;D ), but I need it so if the player fires within a certain area of the building (or by trigger), an object explodes (just setdamage 1). So, if I fired a grenade from 50 metres away, nothing extra would happen, but if I fired it from 20 meres away, a trigger would activate. Is this possible?

And one more thing, whats the line for when a unit reaches a certain damage. Like, if when the player got to half dead, a trigger would activate.  ;)

Thanks for any help
Title: Re:Firing within a certain distance.
Post by: StonedSoldier on 22 Jan 2005, 18:54:54
2) dammage unitname > 0.5
Title: Re:Firing within a certain distance.
Post by: greg147 on 22 Jan 2005, 19:02:19
Thanks for that one  ;)

Anyone know the answer to the first one?
Title: Re:Firing within a certain distance.
Post by: THobson on 22 Jan 2005, 20:00:53
I have not tested it but a fired event handler might be used to run a scrip that checks how far away you are.
Title: Re:Firing within a certain distance.
Post by: BronzeEagle on 24 Jan 2005, 16:03:16
what i would do is set the trigger so that

condition:  building distance player > 5  (or whatever) and damage building > .5

on activation: blah blah blah
Title: Re:Firing within a certain distance.
Post by: greg147 on 24 Jan 2005, 17:53:41
Ah yeah, that could work. I'll try that  ;)