Jump to content

Recommended Posts

Hey Davidoss,

 

I tried to bring your much-needed improvement to the ACE3 Medical system into a mission I'm working on, but I don't get your script to work.  The AI medics still stand around and don't help.

 

I have copied the automedic code into a automedic.SQF and put it into my mission's folder; also I created a new folder within the mission folder named "scripts", where I put the automedic.SQF in as well, just in case... But no luck!

 

For my medics I copied the code

 

dummy = [this, units (group this)] execVM "scripts\automedic.sqf";

 

into their INIT line. 

 

What have I done wrong?  Please help me out :unsure:

 

tourist

Share this post


Link to post
Share on other sites

The medic script works i am using it since ace3 was out.

There are minor problem with ai behavior because if the group is under fire the medic is not reacting. His first challenge is wipe out enemy.

I tried  to set him a behavior but unfortunately this affect whole group.

Some time medic cant reach the wounded unit. Anyone knew the AI  wisdom.

 

Hard to say why is that not work for you. Make some test mission and public that i can see how you execute the code.

Share this post


Link to post
Share on other sites

Thanks for offering a look into it, davidoss.  I'll send you my addon-free (just ACE and CBA) test mission via PM now. 

Share this post


Link to post
Share on other sites

Well you have created a  Hospital or some kind of ER.

Creating such of medical scenario you should consider that there will be low place for combat.

 

In that  hospital scenario wounded units/ players don't even getting red status because the arma getDammage is not working anymore.

Some  ACE variables overrides it.

We need to look for  them and then edit the script for use them to define wounded unit.

 

For now i post your mission with changes i made to show you how the scripts works with.

 

Run the mission in editor and than shot your teammate AI (not medic) and look.

 

https://drive.google.com/file/d/0ByRTbY28pkpibTE3Q2UxYkdzZHc/view?usp=sharing

Share this post


Link to post
Share on other sites

Hi, Bardosy and davidoss!

 

I took this for a test drive, using setDamage to inflict about .9 damage on one of my AI. He indicated red wounded status, and the ACE medic using the davidoss edit worked great. But I realized in my actual mission none of my guys were showing up wounded and I wasn't seeing Bardosy's medic chat messages.

 

So I aggro-proofed my player with a rating add, and went to town shooting my guys. No medic treatment. Reading the most recent 2 posts here, I realize that the setDamage is using base Arma 3 damage, while the ACE damage is being ignored by the script and AI.

 

I'm using basic ACE medical right now. Does this script support advanced ACE medical as well? That is, once we figure out which ACE variables to use?

Share this post


Link to post
Share on other sites

The script works only with ACE basic medical for now (BIS damage) I will look for the ace damage variables in near further.

Share this post


Link to post
Share on other sites

Thank you for in-depth testing and making things clear!  Also great to hear that you are going to have a look on the variables - that's surely a huge amount of time-consuming work and I thank you for your efforts as well! 

 

Keep up your great scripting work!

Share this post


Link to post
Share on other sites

many thanks davidoss by the fast assistance, but I am unable to make my doctor automatically heal those who are wounded. I alternated between ON and OFF Automedic and my doctor didn't nothing. Please, what I am doing wrong? 

 

 

THANKSSSSSSS .... I'm too Noob, It works now!!!! many thanks.

Share this post


Link to post
Share on other sites

the Bardosy script is not working with me and the update made by davidoss is only running at singleplay mode. 

Share this post


Link to post
Share on other sites

@vurelo: do you use ACE or any other gameplay changer addon? Because my script work only if you don't use mods to change the wounding system.

Here is a sample mission,

If you don't use any addon and start this mission, you can shoot one of your men's leg with a pistol and wait a few second. The medic will radio message "I will heal you..." and run to the wounded soldier. Then heal it (it's not a fast process) and then both of theam (medic and healed man) will return to formation.

 

If you test my script in a real mission, be aware, the AI act very slow in firefight. So medic will not run like hell to the wounded. He fight, he take cover and when he can, he sneak to the wounded to heal.

But it works, same way as you order him to heal the wounded. but you don't have to order him.

 

(If you use automedic OFF menu, it will turn off the script, so don't use it when test! Leave everything as default.)

Share this post


Link to post
Share on other sites

the Bardosy script is not working with me and the update made by davidoss is only running at singleplay mode. 

 

This  is something new. :).

Share this post


Link to post
Share on other sites

Can anyone tell me how to make this awesome script start up in the off state rather than on?

 

Also is there any update on being able to use it with ACE?

Share this post


Link to post
Share on other sites

Only ON state for use with  ACE

 

unit init:

dummy = [this, units (group this)] execVM "scripts\automedic.sqf";

scripts\automedic.sqf

// ai medic using ACE3
#include "\z\ace\addons\medical\script_component.hpp"
private ["_needradio", "_medic", "_injured", "_deads"];
_medic = _this select 0;
_units = _this select 1;
_injured = objNull;
_needradio = true;

//main loop
while {alive _medic} do {

    sleep 2;
    //waiting for a wounded
    while {(isNull _injured) and (alive _medic)} do {
        //if the medic is injured
        if (_medic getvariable [QGVAR(isBleeding), false]) then {
            //if medic is already dead, then exit
            if (!alive _medic) exitWith{};
            //else he is the injured and he is a priority to heal himself
            _injured = _medic;
        } else {
            _deads = [];
            {
                if (!alive _x or isNull _x) then {
                    _deads = _deads + [_x];
                };
                if ((isNull _injured) and (_x getvariable [QGVAR(isBleeding), false]) and (alive _x) and (!isNull _x)) then {            
                    _injured = _x;
                    if (_needradio) then {_medic groupChat format["Keep calm %1, I will heal you.", (name _injured)];};
                };
            } foreach _units;
            _units = _units - _deads;
        };
        sleep 5;
    };

    if(!alive _medic) exitWith{};
    
    //we have an injured, stop him
    if ((!isPlayer _injured) and (_medic!=_injured)) then {
        _injured disableAI "MOVE";
        _injured setUnitPos "down";
    };
    if (_medic != _injured) then {
        //medic go for him
        _medic doMove (position _injured);
        while {(_medic distance _injured > 10) and (alive _injured) and (!isNull _injured)} do {        
            sleep 1;
            _medic doMove (position _injured);
            if(!alive _medic) exitWith{_injured enableAI "MOVE"; _injured setUnitPos "auto";};
        };
    };
    
    if(!alive _medic) exitWith{_injured enableAI "MOVE"; _injured setUnitPos "auto";};
    
    //when medic is close enough to the injured...
    //...and injured is still alive
    if ((alive _injured) and (!isNull _injured) and (alive _medic)) then {    
    
        //HEAL the injured
        // ******************************
        _medic allowDamage false;
        _medic action ["HealSoldier", _injured];
        _medic playMove "AinvPknlMstpSnonWnonDnon_medic_1";
        sleep 9;
        _injured setVariable [QGVAR(pain), 0, true];
        _injured setVariable [QGVAR(morphine), 0, true];
        _injured setVariable [QGVAR(bloodVolume), 100, true];
        _injured setVariable ["ACE_isUnconscious", false, true];
        _injured setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true];
        _injured setVariable [QGVAR(occludedMedications), nil, true];
        _injured setvariable [QGVAR(openWounds), [], true];
        _injured setvariable [QGVAR(bandagedWounds), [], true];
        _injured setVariable [QGVAR(internalWounds), [], true];
        _injured setvariable [QGVAR(lastUniqueWoundID), 1, true];
        _injured setVariable [QGVAR(heartRate), 80];
        _injured setvariable [QGVAR(heartRateAdjustments), []];
        _injured setvariable [QGVAR(bloodPressure), [80, 120]];
        _injured setVariable [QGVAR(peripheralResistance), 100];
        _injured setVariable [QGVAR(fractures), [], true];
        _injured setvariable [QGVAR(triageLevel), 0, true];
        _injured setvariable [QGVAR(triageCard), [], true];
        _injured setVariable [QGVAR(salineIVVolume), 0, true];
        _injured setVariable [QGVAR(plasmaIVVolume), 0, true];
        _injured setVariable [QGVAR(bloodIVVolume), 0, true];
        _injured setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true];
        _injured setvariable [QGVAR(airwayStatus), 100];
        _injured setVariable [QGVAR(airwayOccluded), false];
        _injured setvariable [QGVAR(airwayCollapsed), false];
        _injured setvariable [QGVAR(addedToUnitLoop), false, true];
        _injured setvariable [QGVAR(inCardiacArrest), false, true];
        _injured setvariable [QGVAR(hasLostBlood), 0, true];
        _injured setvariable [QGVAR(isBleeding), false, true];
        _injured setvariable [QGVAR(hasPain), false, true];
        _injured setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true];
        _injured setvariable [QGVAR(painSuppress), 0, true];
        _injured setDamage 0;        
        // ******************************
        //wait until injured is healed or dead
        waitUntil { !(_injured getvariable [QGVAR(isBleeding), false]) or (!alive _injured) };
        sleep 3;
        if (_medic != _injured) then {
            if (_needradio) then {_medic groupChat format["OK %1, you are ready to fight.", (name _injured)];};
        };
        _medic allowDamage true;
        //healed soldier is ready to fight
        _injured enableAI "MOVE";
        _injured setUnitPos "auto";
    };
    //we are ready for looking a new injured
    _injured = objNull;
    //doMove stops the medic, so we have to command him to follow his leader
    _medic doFollow (leader group _medic);
    if(!alive _medic) exitWith{_injured enableAI "MOVE"; _injured setUnitPos "auto";};
};

Share this post


Link to post
Share on other sites

Thanks for the fast response Davidoss but that didnt work me.

 

Without ACE running it did nothing at all and with ACE running it caused a 1 shot kill to my team mate when i shot him in the leg with my pistol.

 

Also if you can be bothered what i really wanted was to still have the ON/OFF toggle as it is very handy but just with the script starting in a default state of OFF rather than ON.

 

Your help is very much appreciated.

Share this post


Link to post
Share on other sites

Sorry guys but I see no sense on using ACE and trying to make an automated AI medic that heals everything for the unit. It's kinda cheating. ¿What's the fun or realism on that?

Share this post


Link to post
Share on other sites

Well i play with my nephew and neither of us want to be medic :)

Share this post


Link to post
Share on other sites

Thanks for the fast response Davidoss but that didnt work me.

 

Without ACE running it did nothing at all and with ACE running it caused a 1 shot kill to my team mate when i shot him in the leg with my pistol.

 

Also if you can be bothered what i really wanted was to still have the ON/OFF toggle as it is very handy but just with the script starting in a default state of OFF rather than ON.

 

Your help is very much appreciated.

 

Well the survive ability depends from ACE modules settings placed in editor.

 

 

Well i play with my nephew and neither of us want to be medic

 

Anyway for default medic off you need to edit the script but i am not sure if because the original Bardosy's script is always exiting when the medic is a  player.

//no need automedic if the medic is a player
if (isPlayer _medic) exitWith{};

 

Sorry guys but I see no sense on using ACE and trying to make an automated AI medic that heals everything for the unit. It's kinda cheating. ¿What's the fun or realism on that?

 

Well its can become handy if you are last player standing and unconscious. Your squad AI medic is just  right next to you but he is  doing nothing. What's the fun or realism on that?

Share this post


Link to post
Share on other sites

Well i play with my nephew and neither of us want to be medic :)

 

I am not an ACE expert, but there is for sure a way to disable the whole medical thing, isnt it?

 

 

Well its can become handy if you are last player standing and unconscious. Your squad AI medic is just  right next to you but he is  doing nothing. What's the fun or realism on that?

 

Yes man, but to avoid just that situation, in order to do it well, your less problem is to make a medic go in an automatic way to heal the injured, you gotta make a real integration for AI with ACE (something no one has done yet, so, you would be the first!!!) which is something complex. And if we instead make a domove and magically set all the variables as "new born soldier" (magically is against the reasons a player uses ACE IMHO), my first thought is "and why just not using ACE instead of coding anything?"... well is just thought...

Share this post


Link to post
Share on other sites

Another question, when the medic finishes healing is is told to  _medic setUnitPos "auto"  can i add a line to effectively add the command  Stay Back?

Share this post


Link to post
Share on other sites

Another question, when the medic finishes healing is is told to  _medic setUnitPos "auto"  can i add a line to effectively add the command  Stay Back?

 

It's no need, because he is on "return formation" command already. Only this script force him to stop (disableAI "MOVE"), so when he healed the wounded and script give him the control in himself (enableAI), he will return to the formation.

In firefight, the basic AI behaviour is stronger. So if you move forward in a firefight, the medic will not run after you, but sneak or crowl after you in very slow.

Share this post


Link to post
Share on other sites

OK so i have two teams both running this script, sometimes the medic from one team runs away to heal the other team, not a big problem... Until the two medics meet at which point they both get locked up and wont respond.

 

Is there a way to keep the medic healing only his own group?

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

×