Jump to content
Sign in to follow this  
TheRedBaron

Give medics a job

Recommended Posts

In real battles there are more wounded that killed, but in ofp its the exact opposite. Is there a way to may AI shot at a target just long enough to wound it instead of shooting the target until its dead. This way I would have more wounded than dead,the medics would actualy have something to do and it would make a much more realistic mission. Any suggestions?

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (TheRedBaron @ April 20 2003,15:04)</td></tr><tr><td id="QUOTE">In real battles there are more wounded that killed, but in ofp its the exact opposite. Is there a way to may AI shot at a target just long enough to wound it instead of shooting the target until its dead. This way I would have more wounded than dead,the medics would actualy have something to do and it would make a much more realistic mission. Any suggestions?<span id='postcolor'>

To put it in simple terms, No.

Why? because the wounded in OFP keep fighting, makeing them combatents that must be killed.

Then again, you could always make them setcaptive, and have them drop their weapons... confused.gif

Share this post


Link to post
Share on other sites

This could be done, but it would be very tricky to get it to look good. My suggestion, don't bother.

RED

Share this post


Link to post
Share on other sites

Edit

I think i find a trick to obtain something to simulate this

1-create a west grenadier , for the name : TEST

2-create far away you and a medic (west)

3-create a trigger (TEST must be in the array of it) , 500 Axis a and 500 Axis B, set it to Repeated

At the line Condition , type

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">GetDammage TEST >.1<span id='postcolor'>

This will detect if the soldier TEST is hurt (you can choose a number between .1 and .99 to simulate how many resistance to pain TEST have before being down for the count , if superior or equal to 1 , TEST is dead wink.gif )

At the line On Activation , type

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">removeallweapons TEST; TEST SideChat "I am badly hurt MEDIC !!!!"; TEST setunitpos "DOWN"; TESTDOWN=true<span id='postcolor'>

This will remove every weapon and items from TEST (so he will not continue to shoot , to simulate the "i am down for the count" effect) and will ask for help

I force him to stay down with the setunitpos (else he will walk to the medic instead of staying down and trying to reach him)

The TESTDOWN=True is there for the 4th part of my explanation, to prevent the 2nd trigger to come to activate before TEST is hurt

4-Create another trigger (TEST must be in the array of it) AxisA 500 AxisB 500

Set it to Repeated

At the line Condition

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">TESTDOWN and Getdammage TEST <=0<span id='postcolor'>

This way it only activate when TESTDOWN is true (first trigger) and TEST have no more wounds (so the medic finished to heal him)

At the line On Activation

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">TEST addmagazine "M16"; TEST addmagazine "M16"; TEST addmagazine "M16"; TEST addmagazine "M16"; TEST addmagazine "GrenadeLauncher"; TEST addmagazine "GrenadeLauncher"; TEST addmagazine "GrenadeLauncher"; TEST addweapon "M16GrenadeLauncher"; TEST SetUnitPos "AUTO"; TESTDOWN=false<span id='postcolor'>

With this i give again TEST his default equipment (he was grenadier in my example) with 4 magazines, 3 grenades and the M16M203

And with setunitpos to AUTO , he will be able to stand up (and when he decides to , to go prone)

With TESTDOWN=false, i deactivate the possibility og the second trigger to ramain permanent

5- Test ingame , shoot our friend TEST in the legs , after a few seconds he will try to move to the medic painfully , the medic will heal him .

Shoot again in the legs and the medic have again to do his job

Notice that when TEST is wounded he is downed and cant fire (as he has no weapon wink.gif )

Hope this helps (this works , i tested) , but you have to do this (and adapt the strings line and name) to every soldier in the battlefield

That can be very long (and be carefull with what name, and to report the correct name)

Someone more advanced in scripting could be able to give you a script that can do everything very easy , but i am not advanced in scripting sorry

Share this post


Link to post
Share on other sites

In fact , it is not complicated , as it just involves

1st Trigger

- detection of soldier being hit

- remove of every weapons he has , to prevent the AI to continue the fight

- prevent the AI to stand up until healed

2nd Trigger

- detection of the AI finished being healed

- give back to AI a specified equipment to allow the soldier to fight

- allow the AI to stand up

Now the problem is that this is very long , as you have to apply this (and create trigger) to every soldier in the mission.

that is why i hope some script expert will post some easy to use script for every AI guys without having to create lots of triggers

My method is not complicated , just loooooooong wink.gif

Share this post


Link to post
Share on other sites

Code Sample

GetDammage TEST >.1

Lol what a wussy, you should have it at more like >.6, .1 is like scratching you hands lightly.

Share this post


Link to post
Share on other sites

I just question the logic of it all. In OFP, even when a soldier is wounded, it still possesses a real threat. They are still able to fight, unlike in real life when soldiers go unconsious or are in too much pain to fight.

Just putting in my 2 cents

Share this post


Link to post
Share on other sites
Guest jacobaby

You could run a very simple line in each units INIT;

INIT;

[this] exec "wound.sqs"

and then the wound.sqs itself.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_guy = _this select 0

#loop

@ (getdammage _guy) >0.6

_guy setcaptive true

_guy setcombatmode "blue"

@ ((getdammage _guy) <0.5) ||(!(alive _guy)

?!(alive _guy):exit

_guy setcaptive false

_guy setcombatmode "red"

goto "loop"

<span id='postcolor'>

I havent tested that, but it should be ok, the 2nd wait might need looking at.

Basically it will stop a guy firing if he is hurt bad, and it will stop him being fired at, until he is healed.

Alter damage values to suit.

TJ

Share this post


Link to post
Share on other sites

Thanks Jacobaby

i have not tested it yet, but i will try

I am not a script expert, but

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">it will stop him being fired at<span id='postcolor'>

That is a problem

the "setcaptive" does not give a very realistic behaviour to the units in the middle of a firefight , i dont think someone will stop firing at a downed soldier to let him being healed (and so come back in the battlefield)

It is good to make this soldier stop firing, but the enemy soldier must be able to continue to open fire at him.

To simulate the downed soldier, something other than setcaptive must be used

Actually my heavy method works better for the simulation of the downed soldier with incapacity to open fire , but it is too heavy to use (i tested in a 2 squads fight, it took a lot of time to make all the trigger, so for more soldier, it must been hell , and for the cpu usage, it is not something very good too much trigger)

And as i am not a script expert, i cant translate this trigger usages in a simple script to exec in every soldier init line

Share this post


Link to post
Share on other sites
Guest jacobaby

well just remove the setcaptive then......but I thought you wanted to give your medics a job biggrin.gif

He will stop firing but the enemy will still kill him.

Really if you are a good commander you will have the AI doing all this stuff anyway. get your medic to hang back and get any hurt guys to break off and go and heal.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (jacobaby @ 26 April 2003,21:29)</td></tr><tr><td id="QUOTE">well just remove the setcaptive then......but I thought you wanted to give your medics a job  biggrin.gif

He will stop firing but the enemy will still kill him.<span id='postcolor'>

Now i look again at your script it was obvious , lol wink.gif thanks for pointing this

By the way, it was not me who wanted to give medics a job , i just wanted to simulate incapacited wounded soldier (so they cant fire when hurt and stay down) until healed.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×