OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: MeltedAd on 29 Sep 2003, 09:57:44

Title: MEDIC
Post by: MeltedAd on 29 Sep 2003, 09:57:44
Can a script be made so when a member of a group is wounded he shouts for a medic? I see there are three different Medic calls availible in the editor. would not a script detecting wounds be able to get that unit to call medic?

I only know alittle bit about scripting if someone can point me in the right direction i would be greatful.
Title: Re:MEDIC
Post by: dmakatra on 29 Sep 2003, 14:22:36
Use the getdammage along with the action command for healing at medic. Although the getdammage is strange.
Title: Re:MEDIC
Post by: keou on 29 Sep 2003, 16:02:42
Use the getdammage along with the action command for healing at medic. Although the getdammage is strange.

i did a seach and couldn't find the action command for healing at the medic.  do you know where i could locate this?  it sounds interesting. :)
Title: Re:MEDIC
Post by: dmakatra on 29 Sep 2003, 16:39:57
Look at the thread "The Time For Action Has Come!" at Ed/scripting general.

:beat: *Gets Mediced* :beat:
Title: Re:MEDIC
Post by: General Barron on 29 Sep 2003, 21:56:30
Place a trigger, and in the "activation" field, replace "this" with: getdammage man > 0. man is the name of the man you want to shout. Then press the "effects" button, and choose the appropriate medic sound.

That is about the simplest way to do it.
Title: Re:MEDIC
Post by: KyleSarnik on 03 Oct 2003, 03:20:46
Ok I just put this little script together and it works perfectly.
Title: Re:MEDIC
Post by: General Barron on 03 Oct 2003, 22:40:36
Your script looks good, except for the very first part:

Code: [Select]
#health
_unithealth = Getdammage _unit
? _unithealth > 0.3 : goto "callmedic"

~5

?!(alive _unit) ; goto "exit"
goto "health"

This would be better if you used the @condition command, instead of doing a constant loop:

Code: [Select]
#health
@(getdammage _unit > 0.3) OR !(alive _unit)
?!(alive _unit) ; goto "exit"
goto "callmedic"

This would run better and reduce lag.
Title: Re:MEDIC
Post by: deaddog on 04 Oct 2003, 01:28:41
It is actually better to use a loop with a 5 second delay.  The @ condition checks every .5 seconds, thus using more processor time (like a trigger).
Title: Re:MEDIC
Post by: General Barron on 04 Oct 2003, 07:52:26
Roger that.
Title: Re:MEDIC
Post by: MeltedAd on 04 Oct 2003, 11:46:01
Thanks guys ;D This is bloody perfect :thumbsup:I suppose a similar script could also shout "cover me", "Enemy spotted, open fire!" or "Let em have it" when the enemy is detected?

I just have two questions.

1/Would it be possible for the injured unit to roll around on the floor untill the medic gets to him and the healing process begins ???

2/Can the "Medic" call be louder???
Title: Re:MEDIC
Post by: KyleSarnik on 04 Oct 2003, 18:07:57
1. Explain..?

2. Not with out making a new sound...
Title: Re:MEDIC
Post by: GrimMonkey on 04 Oct 2003, 19:08:26
1: I think he means have the injured roll on his back like he does when being healed while prone. It's some sort of: This SwitchMove "FXLying...something" just look for it ;)

2: The only way I see it possible is to use the FadeMusic command but make it louder instead (possible  ???).


Beware the GrimMonkey
Title: Re:MEDIC
Post by: MeltedAd on 04 Oct 2003, 19:10:41
The healing anime. Could this be looped or something to draw it out abit? So when a unit is quite injured he does the healing anime(rollin around) untill a medic turns up and heals him.
Title: Re:MEDIC
Post by: KyleSarnik on 04 Oct 2003, 21:25:22
You could use switchmove in a loop.... but I dont know the switchmove for healing... plus you would have to force him on the ground: _unit setunitpos "DOWN"  Well maybe I will update the script, but right now im workin on another one....   ::)
Title: Re:MEDIC
Post by: KyleSarnik on 04 Oct 2003, 23:24:37
Ok he rolls around on the ground now when hes hit, but if I use the heal action  he will heal at the medic before the medic even gets do him, so how do I would I make him to it if the medic was a certain distance away from him?