Jump to content
Sign in to follow this  
jamesj505

Alternative to setCombatMode?

Recommended Posts

Hey everyone, I am trying to edit a life mission script it is a convoy script that I am editing. I've added a GPK to escort the MTVR back to police base and it drives perfectly fine and I no problems what so ever in that department however I can't for the life of me make the AI open fire on the civilian side or return fire on the civilian side. I can't do most of the side relations stuff due to the way life missions work sadly and my scripting level isn't all that high. I've tried setCombatMode as from looking at the scripting commands it looked like the only viable option to make the GPK defend itself and return fire. The command doesn't seem to be working even when under fire it doesn't return fire on "GREEN" and even if I set the CombatMode to "RED" it doesn't engage at all.

The following function is called from the main script if anyone knows an alternative way to make AI return fire I would love to hear it:

GovernmentConvoyGPK50m = {
if (alive player and isciv and player distance convoytruck <= 50) then {
 gpkguard setCombatMode "GREEN";
 gpkguard1 setCombatMode "GREEN";
 gpkguard2 setCombatMode "GREEN";
 gpkguard3 setCombatMode "GREEN";
 gpkguard4 setCombatMode "GREEN";
 gpkguard setBehaviour "AWARE";
 gpkguard1 setBehaviour "AWARE";
 gpkguard2 setBehaviour "AWARE";
 gpkguard3 setBehaviour "AWARE";
 gpkguard4 setBehaviour "AWARE";
 govconvoygroup setCombatMode "GREEN";
 govconvoygroup setBehaviour "AWARE";
 hint "You are within 50m of the convoy! Leave the area immediately!";
 };

};

This has me beat! It displays the hint at the end so I know it's being called correctly.

Share this post


Link to post
Share on other sites

try to set the combatmode to yellow or red.

Description: Set group combat mode (engagement rules). Mode may be one of:

"BLUE" (Never fire)

"GREEN" (Hold fire - defend only)

"WHITE" (Hold fire, engage at will)

"YELLOW" (Fire at will)

"RED" (Fire at will, engage at will)

Share this post


Link to post
Share on other sites

Hey there! Thanks for the response I tried with "RED" also but to no avail sadly. It's my guess that there might be something somewhere in the mission effecting the AI as it is a life mission. I'm currently looking through the files seeing if I can spot anything that might have an effect on the AI.

Share this post


Link to post
Share on other sites

...make a civilian as a hostile,

basic trick:

civilianNAME addrating -100000;

Share this post


Link to post
Share on other sites

Thanks Morieza! I've managed to make them hostile but for some reason they still wont open fire. I've done a search of the files to make sure that disableAI wasn't disabling parts of the AI but I couldn't find anything however I re-enabled parts of the AI in-case I missed it along with setting the skill of the convoy AI to 1. The AI will now aim at me constantly and even though when I space-bar they display as hostile they still wont open fire on me despite both sides being hostile to each other and the aimbot like aim they have on me.

Share this post


Link to post
Share on other sites

- What is the 'govconvoygroup' faction ?

- They 're hostile to you, but are you sure that you (Civilian) also as hostile to them ?

- Maybe setbehaviour "careless" still looping from another script ?

- Did you try doFire or suppressFor ?

Edited by Morieza

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  

×