Home   Help Search Login Register  

Author Topic: weather damage script needed...  (Read 530 times)

0 Members and 1 Guest are viewing this topic.

veston pants

  • Guest
weather damage script needed...
« on: 23 Sep 2004, 11:29:56 »
Hello all.

I've set up a mission on kegetys winter nogova where i need to rescue a dude from the russians and get him back to base camp.

I need a script that counts down from about 20 -30 mins where if the civ isn't in some kind of shelter ie. a car, he starts to take damage from the elemnts and will eventually die out in the cold.

If he is placed into a vehicle, 5-10 mins inside should set his exposure time back up to 20-30 mins. Is this sort of script possible?

Also if he stands next to a fire it kind of defrosts him aswell lol.

Anyone fancy havin a go at scripting this?

Thanks very much.. :)


Offline The_Mark

  • Members
  • *
Re:weather damage script needed...
« Reply #1 on: 23 Sep 2004, 16:53:35 »
Code: [Select]
_freezetime=20*60 ;time to start takin damage =20 minutes
_damage=0.05  ; damage to take
_freezing=true
_coldtime=0
_dude=_this
_damaged=false

#loop
~10

?_freezing:_coldtime=_coldtime+10
?!_freezing:_coldtime=_coldtime-30
if(_coldtime>=_freezetime && _freezing) then {_dude setdammage (getdammage _dude)+_damage; _damaged=true} else {_damaged=false}
?_damaged: _dude sidechat "Damn it's cold in here"

_fire=nearestObject [_dude, "fire"]    ; not sure about the "fire"-part, it might be something else

if(vehicle _dude!=_dude || _dude distance _fire<=5 && inflamed _fire) then {_freezing=false} else {_freezing=true}
?!alive _dude:exit
goto "loop"


Save the script to your mission folder and execute it from the dues init field (this exec "script.sqs")

I think that should do it. It's not been tested though, so you might have to fix it a bit.
« Last Edit: 23 Sep 2004, 16:57:48 by The_Mark »
Silent enim leges inter arma.

veston pants

  • Guest
Re:weather damage script needed...
« Reply #2 on: 24 Sep 2004, 10:31:44 »
Thats great fella.
I'll get round to testing it later today.
Thanks very much  :)