Home   Help Search Login Register  

Author Topic: medic script  (Read 849 times)

0 Members and 1 Guest are viewing this topic.

headshot_snipe

  • Guest
medic script
« on: 14 Feb 2003, 18:44:30 »
i'm trying to make a script so that when sumone is injured or dead the medic of the team goes up to the dead person(or injured) heals them or in the case of the dead, bends over the body for a few seconds (like picking up a weapon) and then they just walk off.
 what i would like to know is:

      -the playmove for bending over or picking up a weapon
      -how you would get the medic to go and heal the guy when his health is below a certain point (is it something like: "?<0.99")
       
i'm crap at scripting so i'm asking anyone who has the time to help me with that and if any of you know where i could get a tut on how to make "?" work.

thx   :cheers:


           

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re:medic script
« Reply #1 on: 14 Feb 2003, 19:56:52 »
Just make them automatically call for a medic when hurt.  How to do that, I have no idea.

Doolittle

Offline XCess

  • Former Staff
  • ****
Re:medic script
« Reply #2 on: 15 Feb 2003, 16:28:13 »
to get the dammage opf a unit you do this:
getdammage unitName

To make it a condition for the medic going to the hurt unit use this:
?(getDammage unitName) > 0.7 : goto"healUnitName"

healUnitName wil be where the medic goes to the injured soldier.

Try the following script:

_medic = _this select 0

; The damage the medic wll heal a wounded unit at
_dammage = _this select 1

; units medic will heal
_unit1 = _this select 2
_unit2 = _this select 3

#main
?(getDammage _unit1) > _dammage : goto"unit1hurt"
?(getDammage _unit1) > _dammage : goto"unit2hurt"
goto"main"


; Medic heals unit2 if not dead, would be better to make as another script
#unit2hurt

; Goes to medic doesn't heal if unit's dead
?(getDammage _unit2 >= 1 : goto "dead"

_unit2 stop true
_medic doMove getPos _unit2

@(_medic distance _unit2 ) <= 2
; not sure if anims right, check in Lusty Pooh's comref
medic switchMove"combatToMedic"
~1
_unit2 setDammage 0
_unit2 stop false

goto"main"


#dead
; dont know pick up anim
_medic playmove
goto"main"



I think this will work, you'll have to ad different areas for each unit. It would be beter to make another script though. After the getdammage line under #mainexecute the other script with the one variable, the unit's local variable defined at the top of the script. Copy everything between #unit1hurt and goto "main" (not including those lines) and everything under and including #dead, replacegot "main" with exit though.






headshot_snipe

  • Guest
Re:medic script
« Reply #3 on: 15 Feb 2003, 18:38:22 »
Thx a lot  :cheers: