Jump to content
Sign in to follow this  
alexluthor

calling ace wounds functions via trigger

Recommended Posts

Guys, I’m trying to create the following scenario. The informant is a tribal leader and will only give up some valuable information if the allied medics heal his soldiers.

To represent the wounded soldiers, I placed the following function on a few soldiers (replacing the name where applicable):

[soldier1, 0.6] call ace_sys_wounds_fnc_addDamage;

I’m using the ACE Wounds System Module and the function works fine if I place it on the init line of the unit.

The problem is that this phase of the mission requires a half hour of gameplay and by the time the players reach the area, the victims have all died from the untreated injuries.

I figured I could solve this by calling the function only when the players are nearing the victims. So I placed the same function via trigger, by having it detect bluefor in the trigger radius and, on the activation field, placed the same code. Unfortunately, when run by the trigger it doesn’t work.

Anyone have any ideas about what I'm doing wrong or suggestions to get around this?

thanks in advance

AlexLuthor

Share this post


Link to post
Share on other sites

Hi.

Not sure why this is. But trigger fields are a bit limited when it comes to scripting commands... However... this should do it:

Trigger, on activation:

Call_ACE_Dmg = true;

Unit init:

nul = this spawn { waitUntil {!(isNil"Call_ACE_Dmg")}; [_this, 0.6] call ace_sys_wounds_fnc_addDamage; };

Or without the trigger (distance check):

Unit init:

nul = this spawn { waitUntil {player distance _this < 20}; [_this, 0.6] call ace_sys_wounds_fnc_addDamage; };

Share this post


Link to post
Share on other sites

Hey man, thanks for the help, unfortunately, it didn't work : (

It ocurred to me that I was trying the function only on AI units. When I tried it on a player controlled unit the function worked. Your script worked like a charm with a player controlled unit as well, so I guess the ACE functions works differently depending of who controls the units.

Researching the developer's site: http://ace.dev-heaven.net/wagn/Wounding_System+notes I found that there is a global variable that monitors whether AI units are subject to the ACE wounds effects (ace_sys_wounds_noai).

The problem is that I don't know how to check if these variable is in the missionNamespace or how to erase it from there. Do you have any idea how to work with these variable?

Share this post


Link to post
Share on other sites

Okay i tried it myself now...

Got it working with this:

- Delete all the ACE Wounds Modules in the editor.

- Put this into your init.sqf:

ace_sys_wounds_enabled = true; // activates wounds
ace_wounds_prevtime = 200; // time limit (in seconds)
//ace_sys_wounds_withSpect = true; // enable spectator if you want to
//ace_sys_wounds_auto_assist = true; // ai heals mates automatically
ace_sys_wounds_all_medics = true; // everybody can heal

Do not define the ace_sys_wounds_noai variable.

With that my above codes are working on AI. :thumbsup:

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  

×