Home   Help Search Login Register  

Author Topic: Help Mixing Two Scripts..  (Read 892 times)

0 Members and 2 Guests are viewing this topic.

Offline DeathFromAbove

  • Members
  • *
Help Mixing Two Scripts..
« on: 19 Jul 2008, 11:52:31 »
Hey hello...been playing ofp for years and it just gets better and better but anyways.

A while back I found the paramedic script which I thought was very interesting but it seemed like it was more for cut scenes. I always thought about using it on a battle field where I could have medics come in and take the dead away. It had a certain way of working though, I've only recently started playing around with scripts so I couldn't think of a way of somehow finding a way to name all the people who die 'dead' so the medics would pick them up and take them away.

The other day I downloaded the WWI mod. Which I'm having a lot of fun with. It has this neat script where you can set up people to come and bury the dead (as to reduce lag, since WWI was a war of attrition of course). The script makes a list of the dead and then the medics come and seek them out and then bury them.

I'm using a mix I did of the ECP and SLX mod and the SLX mod has that great body dragging feature.
But what I'd really like is this....

Since the medic's bury the dead with the WWI mod script.
I'd really like a script that has medics search for INJURED soldiers and picks them up in a simulated stretcher (like the paramedic script does except with the dead) then carry them off to a location of my choosing or a distance away (just away from the inital area, nothing major) and then heals them. The soldier would just run back to their group. And the Medics would thus again look for the injured.

I saw in the command references theres a way to see if the hands are hit. I wouldn't mind if the scripts detects if either they're hands/legs or what not are damaged.

The ECP SLX mod also comes with a bleed feature so I think this script would be great  because it would heal the wounded soldiers before they eventually die (if no squad medic comes)

Code: (deadlistadd.sqs) [Select]
;adds every dead unit in a list called "dealist", used by deadpic.sqs
;create a big trigger covering every units, activated once, by everybody, with on activation field :
;deadlist=[];"driver _x addeventhandler [{killed},{_this exec {\PGM_scripts\deadlistadd.sqs}}]" foreach thislist

_unit = _this select 0


~0.5

deadlist = deadlist + [_unit]

~0.5

exit



Code: (deadpic.sqs) [Select]
;[unit] exec "\PGM_scripts\deadpic.sqs" in the init line of dead pickers, or using a trigger


_Unit = _this select 0

group driver _unit setcombatmode "blue"
group driver _unit setbehaviour "careless"
driver _unit allowfleeing 0

_pos = getpos _unit

#FindTarget

~0.01

? !(Alive driver _Unit): Exit

? (count deadlist == 0) : goto "FindTarget"

~random 1

? (count deadlist == 0) : goto "FindTarget"

_Tgt = deadlist select 0

deadlist = deadlist - [_tgt]


#Sprint

~1

? !(Alive driver _Unit): Exit

_Unit domove getpos _Tgt

@ (_Unit distance _tgt <= 10) or !(alive driver _unit) or (unitready driver _Unit)
? !(Alive driver _Unit): Exit

_grave = "grave" createvehicle [0,0,0]
_grave setdir getdir _tgt
~0.1
_grave setpos getpos _Tgt

@ (unitready driver _Unit) or !(alive driver _unit)
? !(Alive driver _Unit): Exit
~1
_unit action ["HIDEBODY", _Tgt]
~3

? (count deadlist == 0) : _Unit domove _pos
~1

goto "FindTarget"

Exit

-------------
   Deadpic.sqs / deadlistadd.sqs => grave diggers burying dead bodies (to avoid lag due to many dead units)
   Example : [this] exec {\PGM_SCRIPTS\deadpic.sqs} (in the init line of dead pickers)
   And : deadlist=[];"driver _x addeventhandler [{killed},{_this exec {\PGM_scripts\deadlistadd.sqs}}]" foreach thislist
   (in a big trigger covering every units, activated once, by everybody, in the on activation field)

^ scripts from inside the pbo.
------------------

Those are the two scripts used in the WWI mod. The paramedic script is around here. This stuff is beyond me right now, could someone knowledgeable  put it together? Kudos to the original script makers also! Sorry this was really long.
« Last Edit: 21 Jul 2008, 21:38:45 by bedges »