OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: schultz187 on 21 Mar 2003, 17:16:37

Title: NearestBuilding problem
Post by: schultz187 on 21 Mar 2003, 17:16:37
Hi, everyone!

Primary question: There is a Radio Tower that I want to destroy. It takes about 10 satchels to destroy it so I thought 4 is really enough. There's a trigger named trigger1 that is placed on the tower. Two Spetznaz soldiers put 4 satchel charges at the getpos trigget1.  Now, I got a script that goes like this:
Code: [Select]
tower = nearestbuilding trigger1
if (getdammage trigger1> 0.1) tower setdammage 1

The ID of the buildin that is returned is  the small building 100 meters away from the tower (not the tower itself). Am I doing anything wrong or is there a way to avoid this problem. I really need toat tower destroyed, otherwise the choppers won't come  ;D

Thanx anyway
Schultz
Title: Re:NearestBuilding problem
Post by: schultz187 on 21 Mar 2003, 17:22:09
Shit, I'm too drunk..... :o

Of course the code is
Code: [Select]
tower = NearestBuilding trigger1
?(getdammage tower > 0.1) tower setdammage 1

And the secondaru question:
When the SpetzNaz attacks the enemy base, I have a trigger that has an effect Trigger = Alarm . how do I turn it off after a couple of minutes??

TIA

Schultz
Title: Re:NearestBuilding problem
Post by: macguba on 21 Mar 2003, 18:41:40
Dunno about the nearest builiding problem.    Presumably everything works fine if you try it with another building, the problem is just identifying this building, yes?

I don't know if this is possible, but if you could detect satchels going off you could do it that way instead.

Happily, I can help with the alarm.    Make a seperate trigger that has the alarm sound, but does nothing else.    Set it to  Repeatedly

Condition:   alarmOn

Use the variable alarmOn to contro the effect:  when the variable is true, the alarm will sound.   When it's false, it will not.
Title: Re:NearestBuilding problem
Post by: schultz187 on 22 Mar 2003, 04:48:37
Thanx man, one problem solved!

Well, it's not a problem to detect the blow, the problem is to get the handle of that building so I could do more damage to it.

Hope, I'll get some more help on that issue

Schultz
Title: Re:NearestBuilding problem
Post by: Sol Fire on 22 Mar 2003, 04:53:46
Cam Create a few more satchel? how i wouldnt know