Home   Help Search Login Register  

Author Topic: How do I set a unit to not alive without setting dammage?  (Read 839 times)

0 Members and 1 Guest are viewing this topic.

aazell

  • Guest
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?


Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:How do I set a unit to not alive without setting dammage?
« Reply #1 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
« Last Edit: 16 Jul 2003, 10:20:05 by Artak »
Not all is lost.

aazell

  • Guest
Re:How do I set a unit to not alive without setting dammage?
« Reply #2 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

Offline KTottE

  • Former Staff
  • ****
Re:How do I set a unit to not alive without setting dammage?
« Reply #3 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.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

aazell

  • Guest
Re:How do I set a unit to not alive without setting dammage?
« Reply #4 on: 16 Jul 2003, 14:22:43 »
Great thanks