OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: aazell on 16 Jul 2003, 02:56:32

Title: How do I set a unit to not alive without setting dammage?
Post by: aazell on 16 Jul 2003, 02:56:32
Hi

I need to set 3 units in my map to not alive at one point. I've tried unitname setdammage 3 and yes they blow up very well but they do not always register as not alive.
There is no set notalive command so do I have to set them to null?

Anyone?

Title: Re:How do I set a unit to not alive without setting dammage?
Post by: Artak on 16 Jul 2003, 10:18:02
excuse me? you want to what?

setting units to 'not alive' sounds like setting units 'to dead'. not alive == dead  ??? :P


Anyhow, you think there could be some other way to achieve what you're trying to do there? Maybe if you told us what it is you're driving at we might offer you an alternative solution..

If you just simply want to take their lives, do it with the setdammage command. It's scale goes from 0 to 1 basicly.

unitname setdammage 1                will make them 'not alive'  ;D
Title: Re:How do I set a unit to not alive without setting dammage?
Post by: aazell on 16 Jul 2003, 10:54:11
Sorry I know this is a weird question.

Why in most scripts that I have read do people check for 2 values to find out a unit's health.

example
?_dammagetruck >0.5 or !(alive truck):goto exit

Why do you need to add the !(alive truck) bit?

When I removed the !(alive truck) bit from my scripts they no longer worked correctly. The dammage of truck had reached 1 (I know because I had a hint displaying the dammage value of truck every second) and yet my script could not detect this until I added the !(alive truck) bit.

using a bit of logic (which could be floored) I have deduced that having a dammage value of 1 and being not alive are 2 different things. SO how do I set  a unit to not alive?

aaz
Title: Re:How do I set a unit to not alive without setting dammage?
Post by: KTottE on 16 Jul 2003, 11:03:23
You should really differentiate between units and vehicles, as vehicles have special rules.
You can setDammage 4.0 on vehicles, and that will be the same as setDammage 1.0 for a unit.

If something has full-out damage, it is dead.
But it can also be dead before they top-out on the getDammage meter.
Therefore you will need the or !(alive unit), as it will detect "If damage is above X or if the unit is dead".
Because, it is quite possible for something/someone to "die" before they go above getDammage 0.5, and then the script/trigger will never be true.
Title: Re:How do I set a unit to not alive without setting dammage?
Post by: aazell on 16 Jul 2003, 14:22:43
Great thanks