Jump to content
avibird 1

Can't see the the missing error in this simple one line code. Help please and thank you

Recommended Posts

this is the code

[] spawn { while {sleep 1; alive medic_1} do {{ if (damage _x *symbol of greater than 0) then { medic_1 action ["healsoldier", _x]}} forEach units team_1}}

 

this is the error

'...ve medic_1} do {{ if (damage _x *symbol |#| of greater than0) then {medic_1 action...' error missing)

 

 

Share this post


Link to post
Share on other sites

symbol of greater than is not a proper command or a operator. Do you mean < ?

  • Like 2

Share this post


Link to post
Share on other sites

>

[] spawn { while { sleep 1; alive medic_1} do {{ if (damage _x > 0) then { medic_1 action ["healsoldier", _x]}} forEach units team_1}};

 

But not sure how the medic will react when bombarded with multiple heal commands every second.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hey @Harzach

 

Look at this 

 

This guy has this simple auto medic script that appears to work without using a mod. I have a auto medic mod that works ok but some issues with the mod. I was trying to see if this can get the job done with better overall performance. I can't get the script to work because of a missing error and your code that you provided does not work as well. Sincerely Avibird. 

Share this post


Link to post
Share on other sites

This was the original script for Arma2 

This is a mod based off the original script

https://steamcommunity.com/sharedfiles/filedetails/?id=1344167676

 

The mod does not work well with my my modified revive and wound system that I use. I don't think the original mod was ever intended to be used with playable units only AI medics.

 

I just want to see if I can get the  first script working that is not based on the original script for Arma 2 or the mod version that somebody made.

Share this post


Link to post
Share on other sites

Hello,

For your first post, it seems you simply need to replace

Quote

*symbol greater

The correct answer will be:

Quote

[] spawn { while {sleep 1; alive medic_1} do {{ if (damage _x > 0) then { medic_1 action ["healsoldier", _x]}} forEach units team_1

 

For your question about bardosy's script, do you have any error ?

I just look at the script and see no command that seems no more relevant.

 

Share this post


Link to post
Share on other sites

Hello @cool=azroul13 

You code adjustment still give a error. Can you look at the script above 

 

 To see if you can get it to work it's a simple one line code he is using

 

Share this post


Link to post
Share on other sites

My bad I forget the end brackets:

Quote

[] spawn { while {sleep 1; alive medic_1} do {{ if (damage _x > 0) then { medic_1 action ["healsoldier", _x]}} forEach units team_1}}

I test it and it works, it's just a hacky way to do it as the medic is "spawned" on the injured unit.

 

Avibird

Spoiler

Can you look at your MP message ? thanks

 

For Bardosy's script, it works well, there is just one line you could change if you want the medic to perform his animation (and not the unit to heal himself):
 

Quote

 

line 103 : automedic

_medic action ["healsoldier", _injured];

 

 

 

Share this post


Link to post
Share on other sites

Hello @cool=azroul13 

 

Thanks got it to work but yes it's limited the medic will only heal units very close to it's location and it does teleport to injured unit. It will not move very far to heal a unit. After a few round of heal units close together like information the dometic will get stuck in no position and not move again. 

 

Automated medic by bardosy I have used in the past. I can't get that to work. I have tried both methods with the code in the medic init and the code in the mission init.  I have the original 1.0 version that I used years ago perhaps that is not working anymore. Could you be so kind to post a sample mission of that script version that you used.

 

The mod version that was based off of bardosy works good but yes there is a but the medic will heal itself but not fully and other AI can not heal the medic only a player can once the medic get taking down.  Like I said I use a heavy modified version of the AiS that the playable units will never due only go unconscious. The mission ends when all playable units are unconscious. I call it the last man standing mode. If one playable units is not unconscious you could revive the entire squad.

 

Thanks Avibird. 

 

Share this post


Link to post
Share on other sites

I just download the script link in bardosy's first post and I had no error when I tried it.

I just put the following line in the medic init:

Quote

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

Can you give more information on what is the problem you encounter ?

Share this post


Link to post
Share on other sites

Lol nothing worked. Describing just stayed put when I was the team leader and shot some of my teammates. I can put that code in the MedEx store box as well as the two files in the scripts folder. Perhaps my old version was corrupted somehow it's been here since I used it. Let me download the script again and I will test it when I get home. I do remember that the Medicare cannot be probably in it can only be AI that is one of the reasons I stopped using the script. 

 

What I did love about the mod version is that medic unit would heal non-squad members on the map less than 200 m away but if the let it gets killed with my modified one system that I use and I cannot be healed by a AI only ba human player and sometimes the medic became invincible.

Share this post


Link to post
Share on other sites

Hey cool I just download the simple mission from bardosy page it works as it should.  My old copy of it must have been corrupted. The issues is I use a modified wound revive system that I changed the original script to meet my needs.

What I did was the playable/switchable units will ll never die only get incapacitated. The mission ends when all playable units are down. I like to refer to this as last man standing mode. I got the script working as I wanted it to allow me to play my preferred way of playing. I don't like to play with respawns and my missions have multiple objectives that can take a few hours to complete. 

 

The revive script has two parts first you need to stabilize and then heal the unit. AI have no issues with the management of the two however the original bardosy script the medic will attempt to heal the soldier but only halfway. the healed unit will go to a knee position but will not be fully healed the injured icon is still on the unit and the unit will not follow any waypoint for the commander.

 

 The mod version of bardosy script on steam works well to get the injured units back up and running as well as has proper animations for healing process but if the medic gets injured the other AI units can not heal him only the player  can heal the medic but he becomes invincible.  Lol we can't have that. 

 

There has to be a simple way to get a medic to heal units without all the micro management that goes along. I remember in OFP medics would heal any unit on the same side without orders.  That's why I was hoping that the simple revive code could be modified to work better but it's very hacky way as your said. 

 

I still can't believe after all this time Bohemia has never really invested in the revive system like it should. Avibird 

 

Share this post


Link to post
Share on other sites

Have you tried to replace the lines I quoted in my previous message (2nd I believe) ?

I think it will correct the first problem.

Share this post


Link to post
Share on other sites

Cool the issues is I am using  someone else's  script/mod for my wound and revive system that I heavily modified for my preferred way of playing.

 

I don't think there's any revive systems that the playable or switchable units will never die. I have not seen anything like that in all my years of playing arma. So  adding  and messing around with another system that alters the health and revive system  may not play well with each other. 

The priority is keeping my wound system working the way it does. It would have been nice and less micromanagement during gameplay if the automatic function would work but I think there's too many things trying to influence the same functions. My real lack of knowledge of scripting will prevent me from figuring this out. The AiS wound system is very complex the auto medic script is not that much but I really have no clue how to fix the issue. The mod version of the auto medic script has the fix you mentioned.

 

I will keep on trying to figure this out sincerely  avibird thanks for the input.

 

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

×