OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: wi77ard on 07 May 2005, 10:09:47

Title: blackouts for players
Post by: wi77ard on 07 May 2005, 10:09:47
hiya

basicly i want to be able to create blackouts and crosshair wobbles for a player when his stamina drops too low, i have a script reducing stamina for each player.

when i tried doing this before it happened for everyone not just the player i was trying to get it to work on

please help
Title: Re:blackouts for players
Post by: 456820 on 07 May 2005, 11:51:25
i rememebr seeing something like this in the editors depot when the player has been shot after a while he kind of faints same with running long distances he starts to faint
i will have alook some time and se if i can get a link for you
Title: Re:blackouts for players
Post by: wi77ard on 07 May 2005, 13:37:24
thanks
Title: Re:blackouts for players
Post by: wi77ard on 18 May 2005, 00:38:06
bump

any other offers?
Title: Re:blackouts for players
Post by: Terox on 18 May 2005, 15:37:39
attach a hit eventhandler to the units you want a possible blackout for

and then run something like the following script from it



Quote
_unit = _this select 0
#START
~2
?(getdammage _unit >0.8): goto "HURTBADLY"
?!(alive _unit): exit
goto "START"

#HURTBADLY
_possibility = random 10
?(_possibility >9): goto "BLACKOUT"
exit

#BLACKOUT
titlecut ["You are unconscious","black out",0.001]
_comatime = random 300
#LOOP
~1
_comatime = _comatime - 1
?(_comatime <= 0): goto "END"
?!(alive _unit): goto "END"
goto "BLACKOUT"

#END
titlecut ["","black in",1]
exit

you could have the unit run some animations forcing the unit to lay down etc