Jump to content

Recommended Posts

I never saw a "recruit script", but it seems to correct. In my missions I use checkpoints when I detect if player's own medic is dead and then I create (spawn) a medic and add this line into his init.

Can you please post your script for doing this? I've been at it for an hour and nothing is working for script spawned medics.

Share this post


Link to post
Share on other sites

Hey bardosy. Have you sorted the addon version of this amazing script yet? It is the holy grail!

Share this post


Link to post
Share on other sites

hello

ive tried the other healing (chessmasters) mod, and im not sure it works people i dont think get healed. Does this one work as it should on SP campaign, and can/how do you use the script.

Dan

Also why in arma 3 when you get downed 100% times you die. In A2 mostly you will be in agony on the floor but in need of medic, ive not seen that in A3.

Share this post


Link to post
Share on other sites

@lawndartleo

_vanmedic = false;
{
	if (alive _x) then {
		_vanmedic = _vanmedic or (typeOf _x == "O_medic_F");
	};
} forEach units group player;

if (!_vanmedic) then {		
	_unit = pgrp createUnit ["O_medic_F", _spawnlck, [], 0, "NONE"];
	_unit setBehaviour "AWARE";
	_unit setRank "CORPORAL";
	_unit setskill 1;	
	setPlayable _unit;				
	_unit sideChat format["%1 rookie reporting for duty! I'm your new medic.",name _unit];
	_dummy = [_unit, units group _unit] execVM "automedic.sqf";
};

This script checks your medic is alive yet (it's an east side mission, you have to change o_medic to b_medic in west side missions) and if your medic is dead, create a new one at position "_spawnlck" and start the automedic script for him.

---------- Post added at 20:05 ---------- Previous post was at 20:03 ----------

Hey bardosy. Have you sorted the addon version of this amazing script yet? It is the holy grail!

No, I never made a single addon. And I avoid from addons. Back in OFP I made a lot of campaign with addons but it caused so many problems, so I decided to create only addon-free missions.

  • Like 1

Share this post


Link to post
Share on other sites

For me, the only thing that works is the medic healing himself. If any other unit gets injured he won't do anything. Did a patch break it or something?

Edited by bolbies

Share this post


Link to post
Share on other sites

I create a very simple sample mission.

You can download from dropbox.

You have a squad. Change your weapon to pistol and shoot your non-medic soldier in his leg. He will be wounded and wait a few seconds. The medic will go there and heal him. Wait an other few seconds and the medic and the healed soldier will follow you again.

Share this post


Link to post
Share on other sites

Hello bardosy!

Very interesting your work. I have searched for something like this since I started playing A3 (have a few days playing). I know very little of the game script and do not know anything. So I can not run your scripts, despite his explanations for this ... I've played missions produzidaa by other players and downloaded from Steam, can not find the file init.sqf them. How do I run their scipts this situation?

I appreciate your attention and tolerance with my ignorance.

Share this post


Link to post
Share on other sites
I create a very simple sample mission.

You can download from dropbox.

You have a squad. Change your weapon to pistol and shoot your non-medic soldier in his leg. He will be wounded and wait a few seconds. The medic will go there and heal him. Wait an other few seconds and the medic and the healed soldier will follow you again.

Now we just need medics from other groups to heal those in need. Possible at the moment ?

Share this post


Link to post
Share on other sites

@Dida44: Sorry, but if you are a player and not a mission maker, you cannot use this script. Mission makers can decide to put this script in their mission or not. If you download missions from Steam, I suggest you to try my mission "Mazi Beachhead" and you will find, how this script work. I (as a mission maker) apply this script to my missions. But I publish it to other mission makers, so they can use it if they want. But you (as a player) cannot force a mission to use it. Sorry.

@Kremator: Currently I'm not playing/editing ArmA. It's a standard procedure since OFP: sometimes I take a few month brake. Without these pauses I could bore the game. But I love it, so sometimes I left it for a few month to make it interesting again. :)

Share this post


Link to post
Share on other sites

Thanks for your attention and for your kind response, bardosy! I'll try it your mission ... Success!

Share this post


Link to post
Share on other sites

Does this script still work! Does anyone currently use this or have something esle like this that works. Script not working now ):

Share this post


Link to post
Share on other sites

In this topic, in comment #31 there is a sample mission. You can check it. And I will too soon.

Share this post


Link to post
Share on other sites

@bardosy I already attempted to get that simple mission to work! The script did not work. The on/off function shows up in the menu but the medic never moves out of formation to heal the units in the player group.

Share this post


Link to post
Share on other sites

I use this frequently, Thanks Bardosy, and just loaded up a mission and the script works for me... I loaded in the editor with low health and the unit radioed me and came over and healed me all automedic like ...

  • Like 1

Share this post


Link to post
Share on other sites

@cosmiC10tR are you using the SPEDITOR editor or MP editor. It is not working for me with the MP editor. Can you post your mission here so I can take a look.

Share this post


Link to post
Share on other sites
@cosmiC10tR are you using the SPEDITOR editor or MP editor. It is not working for me with the MP editor. Can you post your mission here so I can take a look.

That's the issue then likely as this is SP. I'm using it the standard way in sp.

Share this post


Link to post
Share on other sites

@bardosy was your script ever designed for MP? If not could you make a version for MP and to allow the script to work on dynamic spawn medics during the mission that joins the player group. There is nothing like this for arma3 right now. It would be a great help for a lot of missions. Management of the wounded units in your group is a pain in the ass.

Share this post


Link to post
Share on other sites

What is MP editor? When I make MP missions I use THE editor and save as multiplayer. How can you start an MP editor?

This script was MP compatible a few month ago (when I last checked), but CiA group suggested me to switch it off in my missions if MP and use Psyco's revive script, because in MP no need an automated medic: the player who is the medic have to do his job.

Or you what to play less player then position and left the medic for AI to automated heal the real players?

I'm not sure it can work with spawn, but never tested. But very strange what you reported: the sample mission won't work. Because there is no spawn in the sample mission.

Please tell me what you mean MP editor and I will test it tonight.

Note: I just wandering, when you start the sample mission, you have not to use any action! There is an action in the action menu "Automedic OFF", but don't use it! It turn OFF the automedic script. Just start the mission, switch to pistol (the carabine can easily kill your soldier) and shoot your non medic soldier in his leg.

Share this post


Link to post
Share on other sites

Ok. I think I found what you call MP editor (in Play/Multiplayer/New/<<New-mission>>).

I copied my sample mission into MPmissions folder and load it into this MP editor. Run the mission. Didn't activate any action in the action menu. Change my weapon to pistol. Shoot my soldier's leg. He shout and my medic radioed "oh, wait, I will heal you", the he wait a few seconds (standard reaction time in BIS AI) then run for the wounded, heal him, radioed "you will survive", then run back to formation and wounded soldier (now healed) also return to formation.

It seems works for me.

I use only official patch (not devbranch) and vanilla arma3 without any mod.

Share this post


Link to post
Share on other sites

@bardosy the only mod I have on are MCC and DAC! I will retest it with them off.

Share this post


Link to post
Share on other sites

@bardosy I found out way it was not working. The script that was preventing your script from working was AI FIRST AID SUPPORT 0.2.5 by DAP. I use it has a better wound system and revive system in my misisons works great however still has a few bug issues and DAP has left the game ): the issues are very tolerable for all the benefits.

I did notice a small issue with your script. when the medic moves to the wounded unit the medic just goes into a squat position and the wounded unit heals themselves lol not a big deal. Was this by design by you are a issue getting the medic animations working correctly.

? are you still currently working on upgrading this script or have you moved on to new projects. If you are still messing around with it couls you make it that the script could be used on dynamic spawning of player group medics. If someone is using this in a coop mission and using AI squad mates once your editor placed medic is down the script function is over for that squad leader. Avibird

Share this post


Link to post
Share on other sites

Hi Avibird, thanks for the feedback.

Currently I just patching my arma3 projects and try to follow the news, but I'm not planning to add robust features to my script.

I completely understand you prefer one of the revive script then the vanilla heal system. But when I create this script I was strict to my no-mod policy and designed to my missions (without any mod or revive-script). The animation (what you mention) is not applicated by me, because I decided to keep this script lightweight as I can and not insert animations. So what you saw is the BIS animation, if you call the original heal function. I agreed with you, BIS did it strange when they animate the wounded and not the medic. But I didn't want to interfere with this, because it's mean less issues. ;)

When first time I was requested to implement a revive script to one of my mission, I found this issue (the original heal is not compatible with other wounded-systems) and tried to solve it: add a specific section parallel to the original heal, but working for the specific (psyco's) revive-script. I failed. So I just not use the two script in same time: if player want revive, then disable the automedic or if he want automedic, it disable the revive.

Just asking: I don't know DAP revive system, so please clarify: if you play and someone is wounded (not lightly, but activate the revive part) and you order your AI medic to revive, can he revive the wounded?

Share this post


Link to post
Share on other sites

Dr@don report a bug: if the medic use his ability to heal automatically, the "sound of healing" is permanently stucked and you can hear it in the mission.

Did anyone else found this bug too?

I try to fix it.

Share this post


Link to post
Share on other sites

_injured action ["Heal", _medic];

should be

_medic action ["HealSoldier", _injured];

You can also add

_medic playMove "AinvPknlMstpSnonWnonDnon_medic_1";

for better look.

Share this post


Link to post
Share on other sites

Hi.

I  edited the bardosy excellent script to make it working with ACE3.

From now you can have AI medic able to heal you and your team members when bad stuff happen. :D

All regards to bardosy  for the brilliant code.

 

Here is the code:

// 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(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";};
};

And here is the code to call it:

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

for eg ;

/* 
recruit medic via addactions:
put this inside some object init
this addAction ["<t color='#0000FF'>Recruit Medic</t>", "scripts\recruit_medic.sqf",[],4.9,false,true,"","(_target distance _this) < 5"];
addons required : ACE, RHS
*/

private ["_unit", "_chief"];
_chief = _this select 1;
if (_chief != (leader group _chief)) exitWith {
hint "Only team leader can recruit team members!";
};
hint "Recruiting Medic";
_unit = group _chief createUnit ["B_medic_F", getPos _chief, [], 5, "PRIVATE"];
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
_unit forceAddUniform "rhs_uniform_cu_ucp";
for "_i" from 1 to 10 do {_unit addItemToUniform "ACE_fieldDressing";};
for "_i" from 1 to 3 do {_unit addItemToUniform "ACE_morphine";};
for "_i" from 1 to 3 do {_unit addItemToUniform "ACE_epinephrine";};
_unit addItemToUniform "ACE_NVG_Gen4";
_unit addVest "rhsusf_iotv_ucp_Medic";
for "_i" from 1 to 15 do {_unit addItemToVest "ACE_quikclot";};
for "_i" from 1 to 2 do {_unit addItemToVest "ACE_CableTie";};
_unit addItemToVest "rhsusf_acc_nt4_black";
for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_an_m8hc";};
for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_m18_red";};
for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_m18_green";};
for "_i" from 1 to 8 do {_unit addItemToVest "rhs_mag_30Rnd_556x45_Mk318_Stanag";};
_unit addItemToVest "rhs_mag_m67";
_unit addBackpack "B_Carryall_mcamo";
for "_i" from 1 to 50 do {_unit addItemToBackpack "ACE_fieldDressing";};
for "_i" from 1 to 25 do {_unit addItemToBackpack "ACE_morphine";};
for "_i" from 1 to 25 do {_unit addItemToBackpack "ACE_epinephrine";};
for "_i" from 1 to 15 do {_unit addItemToBackpack "ACE_bloodIV";};
for "_i" from 1 to 15 do {_unit addItemToBackpack "ACE_quikclot";};
for "_i" from 1 to 2 do {_unit addItemToBackpack "ACE_bodyBag";};
_unit addItemToBackpack "ACE_personalAidKit";
_unit addHeadgear "rhsusf_ach_helmet_headset_ucp";
_unit addGoggles "G_Combat";
_unit addWeapon "rhs_weap_m16a4_carryhandle_grip_pmag";
_unit addPrimaryWeaponItem "rhsusf_acc_anpeq15A";
_unit addPrimaryWeaponItem "optic_Nightstalker";
_unit addPrimaryWeaponItem "bipod_01_F_blk";
_unit addWeapon "Laserdesignator";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ACE_Altimeter";
_unit linkItem "ItemGPS";
_unit enableFatigue false;
dummy = [_unit, units (group _unit)] execVM "scripts\automedic.sqf";
hint "Medic joined your team";

Greatings.

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

×