This script gives your team mates a slightly better chance of surviving, provided that you do your job. I wrote it for a campaign mission where you play the medic.
When a unit is hit he/she will fall to the ground screaming. If the medic is fast enough (aprox. 2.5 minutes) they can be saved. The script is intended for a human medic in SP mode.
I would like some general feedback and help with the fine tuning.
Just place a single AI unit on the map, initialize the script, play a medic and shoot the friendly loon in the leg - great fun
The script can be initialized using a single eventHandler:
this addeventhandler ["hit",{(_this select 0) setdammage 0.75; [_this select 0] exec "surgeon.sqs"}]SURGEON.SQS - by nominesine (BETA 0.95)
_screamCount = 0
_obj = _this select 0
_obj setCaptive true
_obj removeAllEventHandlers "hit"
#scream
_screamCount = _screamCount +1
? _screamCount == 1: _obj say "eng23"
? _screamCount == 2: _obj say "eng32"
? _screamCount == 5: _obj say "eng23"
? _screamCount == 7: _obj say "eng33"
? _screamCount == 9: _obj say "eng34"
? _screamCount == 11: _obj say "eng23"
? _screamCount == 13: _obj setDamage 1
? _screamCount == 14: exit
_obj switchMove "LyingToTreatedLying"
? !(alive _obj): exit
? damage _obj < 0.75: _obj setCaptive false; exit
~9
goto "scream"
Known bugs:
* Sometimes the eventhandler causes the script to start twice from a single hit. This makes the wounded cry out twice, i.e "Help! help!" and "Medic I'm hit! Medic I'm hit!" instead of "Help!", "Medic I'm hit!" (a small problem IMO).
* If you kill the loon while he's screaming for help he might twitch a few times after death (but actually it looks rather cool).
* Even slightly wounded soldiers starts to cry like babies, rather than fighting the pain (in my mission it doesn't matter, but for a more general script I think there should be some sort of damage level before the screaming kicks in - suggestions???)
Post Scriptum: In blatant disregard for proper posting routines, I haven't suplied the script with an example mission.
The reason for this is that the script is so simple it only takes a little proofreading skills. Hope no one minds?