Home   Help Search Login Register  

Author Topic: how to use getdammage obj  (Read 1596 times)

0 Members and 1 Guest are viewing this topic.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
how to use getdammage obj
« on: 11 Jan 2009, 02:01:46 »
Hi, Im trying to create a short script using the getdammage obj.  It's values are 0 and 1. How do you go inbetween 0 and 1? Like say if you just want the player to die slowly?

I'm trying to implement that into the script..

thanks. by using this command only..
 :D
Who's hyped for Arma4, long live Arma!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: how to use getdammage obj
« Reply #1 on: 11 Jan 2009, 02:31:32 »
getDammage merely tells you what damage the object has, for example:

_dvalue = getDammage _mytruck

Now the variable _dvalue will hold the damage value that _mytruck had at the time the line was run.

The damage values run from 0 (no damage) to 1 (full damage), therefore if your truck was exactly half damaged _dvalue would be 0.5.

It sounds to me that you really want the setDamage or setDammage commands, in order to set the damage of the object.
In which case, if you want to set the damage to half you would use:

_mytruck setDamage 0.5

Unless of course I misread your question.   ::)


Planck
I know a little about a lot, and a lot about a little.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re: how to use getdammage obj
« Reply #2 on: 11 Jan 2009, 04:55:57 »
nope not at all, I was wondering what the values were in between the two main values.

Scale of values:

(alive) 0 0.1 0.2 0.3 0.4 0.5 (half) 0.6 0.7 0.8 0.9 1 (dead)

Isn't that how it goes?

thanks.
Who's hyped for Arma4, long live Arma!

Offline eegore

  • Members
  • *
Re: how to use getdammage obj
« Reply #3 on: 11 Jan 2009, 08:59:20 »

  You are right.  I used the same type of thing in a few triggers to simulate radiation once.  Your health dropped as you neared metal objects. 

  Player setdammage .5   would be half dammage.

  Player setdammage .9   would mean if a hummingbird sneezed within 30 meters of your soldier he's screwed.


Offline zwobot

  • Members
  • *
Re: how to use getdammage obj
« Reply #4 on: 11 Jan 2009, 11:17:46 »
Scale of values:

(alive) 0 0.1 0.2 0.3 0.4 0.5 (half) 0.6 0.7 0.8 0.9 1 (dead)

Isn't that how it goes?
Basically yes. But there are infinite (well almost) scales between no damage and dead - they are not discrete. For example getDammage player could return something like 0.45232
I don't know how many digits fraction numbers in Ofp can have but it definitely is enough  ;)
"Executing tactics in real combat is the hardest thing one can ever do...well I've never given birth but..well whatever."

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re: how to use getdammage obj
« Reply #5 on: 11 Jan 2009, 17:33:28 »
Thanks, yeah the getdammage command can  be used in many ways. I say they should rewrite the COMREF and use a much possible syntax's with the commands and uses so players can more easily use scripting withouth having to ask a bunch of time on something. 

I'm using this for a hunger script.  The player gets hungry.. :)
Who's hyped for Arma4, long live Arma!

Walter_E_Kurtz

  • Guest
Re: how to use getdammage obj
« Reply #6 on: 11 Jan 2009, 21:43:44 »
It may be a linear scale, in that 0.5 is half-dead, but the effects tend to be inconsistent and unpredictable. My guesstimates:

Up to 0.1 - probably unnoticed, aiming unaffected

0.1 to 0.6 - reasonable range for your purposes - the annoyance is the display of wound textures

0.85 - start suffering leg wounds - forced to crawl or body-pop (stand-up, run, scream, fall over, repeat)

0.95 - immobile, won't even crawl

For the early stages, you might want to try "blah setDammage -1" (either spelling Damage/Dammage should work). This should give the wavering aim of being wounded, but without any other effects.

Offline eegore

  • Members
  • *
Re: how to use getdammage obj
« Reply #7 on: 13 Jan 2009, 07:53:05 »


  If I recall correctly anything over .9 will drop you to a crawl, but no medic can heal you.

  Is there a reliable way to injure units that medics can attend to?