Jump to content

Recommended Posts

-Psycho-;2622071']Hi' date='

the first bug and your work around is a new thing for me. Thx!

The second one i dont like so. Cause i did not want that the unit is invulnerable while he is unconcious. Thats the reason i add this short delay (5s) after the "dead". (maybee you have see it)

Try this:

if (isPlayer _unit && {time < (_unit getVariable "tcb_ais_fall_in_agony_time_delay")} && {captive _unit}) exitwith {
   0
};

If this work well in combination with your other solution i will release a hotfix and you become a big place in the credits. :)

regards[/quote']

I've made quite a few more changes since I last posted code. I have the damage handler working MUCH better now but I still have the temporary invulnerability as it was. I was wondering what that timer is for so I'll definitely use that in a future build to properly handle damage while down. Also I have the AI healer code working better. Still working on getting AI not in your immediate group to come to your aid of nobody else can. As always the AIS code I'm working on is available in my code repository for our clan mission here.

Share this post


Link to post
Share on other sites

Hi,

i will flow over your code to see what you have done. I did this already yesterday (but the older code).

The timer build a delay for the time the unit is invulnerable. The value are by 5 seconds. (until the fall animation ends) But this method doesnt work in the same frame. Thats the reason for the temporary invulnerability.

btw: there some chance to highlight the version changments in your hosted code?

regards

Edit:

private["_unit"];
_unit = _this select 0;

if(isServer) then {
if (isNil {_unit getVariable "tcb_ais_agony"}) then {
_unit setVariable ["tcb_ais_agony", false];
};
while{(_unit getVariable "tcb_ais_agony") && (alive _unit)} do {
//diag_log format ["%1 agony state sending ...", _unit];

tcb_ais_in_agony = [_unit, true];
publicVariable "tcb_ais_in_agony";

//diag_log format ["%1 agony state sent", _unit];

sleep 15;
};
};

For what you add those codes? You know that this is a network traffic killer?!

One basic column of this system is the very low use of network traffic. You broke this column with your code.

Edited by [TcB]-Psycho-

Share this post


Link to post
Share on other sites
Still working on getting AI not in your immediate group to come to your aid of nobody else can.

THIS +1! Probably the change I would most like to see. :)

---------- Post added at 12:11 PM ---------- Previous post was at 11:24 AM ----------

-Psycho-;2594134']

Nothing else you have to do as start your hostage the script too. I a further version i add a easier possibility to include other units. At the moment you can execute it something like this: {[_x] execVM "..."} forEach (playableUnits + [myHostage]);

Hi! I know you posted this months ago in a response to a hostage mission I was working on. I never did try to get this to work. :blush:

Now I'm working on a much more elaborate mission for coop/dedi where players can "recruit" AI into their own groups. I have a script setup to do this and I wonder what must I include in this script so the spawned unit, grouped with a player, also receives the benefits of your AIS script? I thought maybe something like

call init_ais.sqf;

might work as it appears you are using functions but I know not enough about scripting to figure out the right way to do this.

Thanks in advance!

Share this post


Link to post
Share on other sites

Use simplay the same way like the standard init method but only on one unit:

[myUnit] call compile preprocessFile (TCB_AIS_PATH+"init_ais.sqf");

Share this post


Link to post
Share on other sites
-Psycho-;2624936']Use simplay the same way like the standard init method but only on one unit:

[myUnit] call compile preprocessFile (TCB_AIS_PATH+"init_ais.sqf");

Thanks! So does this look correct to you?

_soldier = (group player) createUnit ["B_mas_usr_soldier_Mh_F_gn",(getmarkerpos "snispawn"),[],0,"NONE"];
_soldier addUniform "u_b_ghilliesuit";//Add gear here,
_soldier call compile preprocessFile (TCB_AIS_PATH+"init_ais.sqf");
recname = name _soldier;
recrank = rank _soldier;
//hint format ["%2 %1 reporting for duty.", recname, recrank];
_soldier groupChat format ["%2 %1 reporting for duty.", recname, recrank];

(This script is called by a player addaction)

Share this post


Link to post
Share on other sites
-Psycho-;2624947']A german phrase: "probieren geht über studieren". ;)

LOL! Yeah, OK. It just takes several minutes for me to test this in my current mission due to long load up time and if that works I need to add it to five more scripts too ;)

Share this post


Link to post
Share on other sites

It works ;)

Just need AI same side, different group to heal now too :)

Also I notice that I don't get the "Treat yourself" option until after I've already been revived once. I'm pretty sure that's the case but I'll have to test it more yet... unless that is a "feature"?

Share this post


Link to post
Share on other sites
-Psycho-;2624873']Hi' date='

i will flow over your code to see what you have done. I did this already yesterday (but the older code).

The timer build a delay for the time the unit is invulnerable. The value are by 5 seconds. (until the fall animation ends) But this method doesnt work in the same frame. Thats the reason for the temporary invulnerability.

btw: there some chance to highlight the version changments in your hosted code?

regards

Edit:

private["_unit"];
_unit = _this select 0;

if(isServer) then {
if (isNil {_unit getVariable "tcb_ais_agony"}) then {
_unit setVariable ["tcb_ais_agony", false];
};
while{(_unit getVariable "tcb_ais_agony") && (alive _unit)} do {
//diag_log format ["%1 agony state sending ...", _unit];

tcb_ais_in_agony = [_unit, true];
publicVariable "tcb_ais_in_agony";

//diag_log format ["%1 agony state sent", _unit];

sleep 15;
};
};

For what you add those codes? You know that this is a network traffic killer?!

One basic column of this system is the very low use of network traffic. You broke this column with your code.[/quote']

That loop that goes off every 15 seconds was mainly for testing for sync'ing the wounded state for players that connect after the mission starts but while a unit is currently down. I haven't figured up a better solution yet. However, I have spend the last 4 days or so doing some pretty major overhauling on the code that you should check out here. It's still got some bugs but it works way better than it used to. I also added the start of the healing handler to work with the vanilla Treat option for bandaging outside of the First Aid revive.

The biggest change with my latest overhaul is that the unit damage is all handled server-side. Clients still capture and calculate damage and whether the unit is in agony but that is broadcast to the server so that there is a single authority for a given unit's damage values (both wounding damage values and game damage value). Currently the broadcast is a basic "publicVariable" type but I will soon have it working so that it is only sent to the server and not the other clients.

The second biggest change is with the First Aid. The way it works is still mostly the same but the way the damage is healed is much different and also now requires that you have at least some medical supplies on your person to even begin First Aid. The healing time also has a static minimum of 5 seconds just in case anything doesn't sync quite right to the injured unit so that the progress bar is always there for at least that time.

Also AI units that have wounding explicitly loaded on them can now bleed out. And related to bleeding, any unit that is a medic will see a percentage along with the usual name and distance on the 3D icon. This is the percent of blood left on that unit until they bleed out. Works on both AI and human wounded units.

I haven't had time to dig back into the sendAIHealer code to get non-group AI to come to your aid as I have been busy with core system changes+fixes but I'll be trying to get that finished and working soon.

Share this post


Link to post
Share on other sites

Sorry, dont understand this as a bad feedback but you havent any idea how multiplayer scripting work.

Your code go more worser and worser with any changement you add. You call it "pretty major overhauling" but you only add more and more checks and calculations around witch are doesnt needed. The result is a overload packet that do mutch more as needed for what it should expect. Now your strange "sync-loop" runs on every machine every 15 sec to every another machine. That means if for example 15 players on a server the code transimited every 15 seconds ((15^15)*agony units) times - you kill the hole bandwith of every system with your code. Next thing is, why you change damage handling to server side?! It doesnt matter who the damage are handled. You only produce traffic with no effect on the result of the scripting targets.

Next thing is you feed the config file with more and more variables for data handling changements. There is a reason why i try to keep this file clean and tight.

Keep your first and only target in your mind back: to fix the 99% problem. (make a 100% chance of revive) You build more and more code around, blow the calculations up with no effect on the wanted output but dont come any moment closer to the primary target. Pls take this feedback as a assistance and pathbreaking support from me to your scripting goals and knowledge. Remeber, everyone can blow up a code with many stuff. The magic is to find the middle way between a save path and a tight and straight line from the idea to the goal.

atm, nothing from your changements are helpfull to me.

regards

Edited by [TcB]-Psycho-

Share this post


Link to post
Share on other sites
-Psycho-;2627141']Sorry' date=' dont understand this as a bad feedback but you havent any idea how multiplayer scripting work.

Your code go more worser and worser with any changement you add. You call it "pretty major overhauling" but you only add more and more checks and calculations around witch are doesnt needed. The result is a overload packet that do mutch more as needed for what it should expect. Now your strange "sync-loop" runs on every machine every 15 sec to every another machine. That means if for example 15 players on a server the code transimited every 15 seconds ((15^15)*agony units) times - you kill the hole bandwith of every system with your code. Next thing is, why you change damage handling to server side?! It doesnt matter who the damage are handled. You only produce traffic with no effect on the result of the scripting targets.[/quote']

If you look at the most recent code from around the time I posted that loop has since been fully removed. It was also noted earlier that it was for testing and not intended to be permanent. As for the second point the damage handling was all moved server-side for two main reasons. First, so that the damage calculation and tracking of the wounding system damage values as well as the basic damage is uniformly synchronized. And second, so that all actual damage to the unit is set in one location and preventing death before going into agony becomes much more straightforward.

-Psycho-;2627141']Next thing is you feed the config file with more and more variables for data handling changements. There is a reason why i try to keep this file clean and tight.

I'm not quite sure what you mean here. Please elaborate?

-Psycho-;2627141']Keep your first and only target in your mind back: to fix the 99% problem. (make a 100% chance of revive) You build more and more code around' date=' blow the calculations up with no effect on the wanted output but dont come any moment closer to the primary target. Pls take this feedback as a assistance and pathbreaking support from me to your scripting goals and knowledge. Remeber, everyone can blow up a code with many stuff. The magic is to find the middle way between a save path and a tight and straight line from the idea to the goal.

atm, nothing from your changements are helpfull to me.

regards[/quote']

The primary goal, at least for me, is to make a consistent and fun wounding system that isn't overly complicated for the players and works well with both static missions and dynamic missions. Many of my changes have been in attempts to work around both the damage event handler bugs and around inconsistencies with using the public flag on setVariable. Yes it increases bandwidth a little having the server do the damage handling but it's not much different from the clients using setDamage as that also does a server broadcast. I've worked hard to keep things streamlined but due to Arma's peer-to-peer nature it requires more work to keep everything consistent (yes there's a server but it's mainly a gateway/router so the clients can shuffle info around). I hope that you are able to use the code that I've written but it's okay if you don't want to.

Share this post


Link to post
Share on other sites

I've spent the better part of the last few days going through and rewriting even more things to fix up the synchronization (and possibly bandwidth) mess. Damage handler now works 100% and always puts the unit down into agony (fixing the 99% bug, yay!). Currently there's a bug where the invulnerability isn't going away while down but you can still die from bleeding out.

Also there are a number of new features in recent commits such as pausing the unit's bleeding while doing First Aid. Also giving the medic more info and making it more visible for them.

Details for the commit are here

Known issues:

  • Units don't die from damage while in agony (but they can bleed out and die)
  • Sidechat messages are sometimes duplicated when a unit goes down
  • Revive counter is sometimes reset when a JIP arrives
  • Using Treat while the unit is in need of First Aid does weird things and doesn't help the unit
  • Healing from a medic when using a medikit during First Aid may not heal but will bring the unit back up (all other cases are fine)

Share this post


Link to post
Share on other sites

Ok first this Scriptpack works very well but i have 1 issue.

When i die and respawn Arma crashes. I don`t know what it could be had someone other a issue with some mods or scripts?.

Share this post


Link to post
Share on other sites

Feature request: I'd like to be able to still order units in my group while in "agony". Example: I was gunner in an attack helicopter flown by AI pilot in my group. We got shot up and landed to make repairs. I jumped out quick to fix the chopper and ended up getting shot. My pilot, while he could have healed me, staying in the helicopter and I was unable to order him to "disembark", so he could then heal me. I bled out less than 2m away from someone who could have fixed me up! :) I can imagine the same happening with wheeled vehicles on a convoy mission, etc.

Share this post


Link to post
Share on other sites
Ok first this Scriptpack works very well but i have 1 issue.

When i die and respawn Arma crashes. I don`t know what it could be had someone other a issue with some mods or scripts?.

Can you go to C:\Users\<Username>\AppData\Loca\Arma 3 and put the contents of the most recent .rpt file into a pastebin? I hightly doubt it's related to the script but crashes are nothing to sneeze at.

Share this post


Link to post
Share on other sites
Ok first this Scriptpack works very well but i have 1 issue.

When i die and respawn Arma crashes. I don`t know what it could be had someone other a issue with some mods or scripts?.

I _don't_ think this is specifically related to the A3 wounding system. I'm getting the exact same problem in some of my created missions and I've tried both A3 and BTC revive. Basically on 'respawn' when the players go into agony, it will sometimes randomly crash to desktop. It doesn't happen every time, and it doesn't happen to all players at once. Seems about 50% of the time it happens. I've checked my report and there's nothing in there other than a crashdump of arma3.exe. It does refer to the dump files, but there's no way to read them that I know of.

This only started cropping up for me since the 1.10 update and I've submitted this as a bug report but have yet to hear back from anyone.

Share this post


Link to post
Share on other sites

@cheesmaster: how does your version of ais work? tried it with my mission but it seemed that it wasn't initialized. did you change how the system was called in the init? i didn't see any of that in your missions init.sqf.

Share this post


Link to post
Share on other sites
@cheesmaster: how does your version of ais work? tried it with my mission but it seemed that it wasn't initialized. did you change how the system was called in the init? i didn't see any of that in your missions init.sqf.

Quite true, it initializes itself for players. This block here (which is at the bottom of init_ais.sqf) is what does the basic initialization:

//Globally loads AIS Wounding on all playable units
AIS_Load_Global_Players =
{
[[2, {{[_x] spawn AIS_Load} forEach playableUnits}], "CP_fnc_globalExecute", true, true] spawn BIS_fnc_MP;
};

call AIS_Load_Global_Players;

This causes the system to load for all players as soon as the script is loaded and remains persistent for players including JIP players. In order to load on a specific unit, such as on init for an AI, just put this in the init block:

[_this] spawn AIS_Load;

---------- Post added at 04:22 ---------- Previous post was at 04:08 ----------

And I think I just realized why it didn't load for you. I'm using a function from MCC for convenience (which I probably shouldn't be). Change the above block to this and it should load:

//Load AIS Wounding on all playable units
AIS_Load_Players =
{
{
	[_x] spawn AIS_Load;
} forEach playableUnits;
};

//Globally loads AIS Wounding on all playable units
AIS_Load_Global_Players =
{
[[], "AIS_Load_Players", true, true] spawn BIS_fnc_MP;
};

call AIS_Load_Global_Players;

I had meant to change this some time ago but forgot about the dependency. I will have it changed in the next build as well. Sorry about that :/

Share this post


Link to post
Share on other sites

Ok i should tell you the problem was not on the script. The Problem was that Mcc and the Developupdate give an error when you respawn.

thanks for the help :).

Share this post


Link to post
Share on other sites
Just need AI same side, different group to heal now too :)

Latest version I just pushed to the repository fixes all sorts of issues with sendAIHealer so that works now, yay!

Also I notice that I don't get the "Treat yourself" option until after I've already been revived once. I'm pretty sure that's the case but I'll have to test it more yet... unless that is a "feature"?

The treat mechanism has undergone several overhauls and now works substantially better. It's tightly integrated with the vanilla treat and should work normally for you now.

---------- Post added at 21:14 ---------- Previous post was at 21:12 ----------

Ok i should tell you the problem was not on the script. The Problem was that Mcc and the Developupdate give an error when you respawn.

thanks for the help :).

Glad to here it wasn't a script issue. I've also actually removed the dependency now so you should be able to just drag'n'drop the ais_injury folder and have it load up and go for you.

EDIT: Forgot to mention here that you still need this

call compile preprocessFile "ais_injury\init_ais.sqf";

somewhere in your init.sqf file,

#include "ais_injury\cfgFunctionsAIS.hpp"

in CfgFunctions, and

#include "ais_injury\dialogs\rscTitlesAIS.hpp"

in RscTitles

Edited by chessmaster42
Missing setup info

Share this post


Link to post
Share on other sites

Hey did someone try to add this revive script to VTS 4.0?

If someone was able to do it can you please explain how you did it? because I was able to get some functionality but with errors and is not working consistently.

Share this post


Link to post
Share on other sites

Neo, do you have any more specific information on what was causing the Crash to Desktop issue on respawn? I'm still getting it, but I'm not using MCC at all, and I'm using the Stable version, not dev.

Share this post


Link to post
Share on other sites

Maybe someone can help me... I already have rscTitles in my description.ext how should I append it?

Here is description.ext I have:

class RscTitles
{
titles[]={"vtsimg"};

class vtsimg
{
	idd=-1;
	movingEnable=0;
	duration=5;  
	fadein=2; 
       fadeout = 1;		  
	name="vtsimg";
	controls[]={"GR"};

	class GR : VTS_RscPicture
	{
		style=48;
		text="JTF2.jpg";
		sizeEx = 0.4;
		x=0.25;
           y=0.3;
           w=0.5;
           h=0.4;
       };
};
};

Share this post


Link to post
Share on other sites
Quite true, it initializes itself for players. This block here (which is at the bottom of init_ais.sqf) is what does the basic initialization:

//Globally loads AIS Wounding on all playable units
AIS_Load_Global_Players =
{
[[2, {{[_x] spawn AIS_Load} forEach playableUnits}], "CP_fnc_globalExecute", true, true] spawn BIS_fnc_MP;
};

call AIS_Load_Global_Players;

This causes the system to load for all players as soon as the script is loaded and remains persistent for players including JIP players. In order to load on a specific unit, such as on init for an AI, just put this in the init block:

[_this] spawn AIS_Load;

---------- Post added at 04:22 ---------- Previous post was at 04:08 ----------

And I think I just realized why it didn't load for you. I'm using a function from MCC for convenience (which I probably shouldn't be). Change the above block to this and it should load:

//Load AIS Wounding on all playable units
AIS_Load_Players =
{
{
	[_x] spawn AIS_Load;
} forEach playableUnits;
};

//Globally loads AIS Wounding on all playable units
AIS_Load_Global_Players =
{
[[], "AIS_Load_Players", true, true] spawn BIS_fnc_MP;
};

call AIS_Load_Global_Players;

I had meant to change this some time ago but forgot about the dependency. I will have it changed in the next build as well. Sorry about that :/

Hey no reason for being sorry. Script is still not working... correct me if im wrong but does the mission even start ais if theres no line in the init?

edit: do i still need the #include in the description.ext?

Share this post


Link to post
Share on other sites

@Meatball

Sry.

i dont know exactly what it was have you tryed to Start Arma without a Mod and then you try any mod you have.

At the momment i play with alot of Mods and everything works fine.

PS: do someone know how to get the respawnmenu working with the AIS script?

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

×