Jump to content
duda123

Advanced AI Command

Recommended Posts

Still no luck unfortunately. Created an entirely new mission with new init and description but still couldn't get command. The only way is default it seems.

Can you send me the sample mission?

Share this post


Link to post
Share on other sites

Yeah of course, here it is: https://dl.dropboxusercontent.com/u/36308156/AICTest.Tanoa.zip

 

Tested vanilla and still the same result unfortunately. Thanks for looking into this!

 

Ok, I think the call to show the command control gets executed too soon when in the init field. Instead, name the player p1, remove its init field and then put in your init.sqf file:

 

if(p1 == player) then {
    ["CSSCommand",true] call AIC_fnc_showCommandControl; 
};

Share this post


Link to post
Share on other sites

Well it now works perfectly in the mission I sent you, but not in the more complex mission I'm working on! I'll see if executing that a few seconds after the mission has loaded does anything helpful. 

 

 

Edit: It works on the more complex mission if I execute it via debug console after the mission has started. I'll see if I can write a little script to do this automatically. 

Share this post


Link to post
Share on other sites

And thank you again for working through this with me, it's really appreciated!!

 

Try putting this at the top of your init.sqf file:

 

if (!isDedicated) then {waitUntil {!isNull player && isPlayer player};};

Share this post


Link to post
Share on other sites

I have a feeling that it may mess with some other functions I'm running (for some reason ALiVE load order is a bit messed up for me at the moment) so I've got a loop that works quite well now. Here it is: 

while { true } do
{ 
	sleep 30; 
	if((SRROp == player) or (sniperTeamLead == player)) then { 
    ["FullCommand",true] call AIC_fnc_showCommandControl;  
	};
	if((strikeTeamLead == player) or (SRROp == player) or (sniperTeamLead == player)) then { 
    ["CSSCommand",true] call AIC_fnc_showCommandControl;  
	};
};

Works perfectly! Thanks Duda. 

 

EDIT: Seems this method won't work on dedicated server... for fck's sake Arma!! 

 

EDIT 2: Your way works! I'm a numpty. 

Edited by Incontinentia

Share this post


Link to post
Share on other sites

Give this a try on dedicated:

#define playerIsUnit(playername) ((missionNamespace getVariable [playername,objNull]) == player)
if(hasInterface) then {
	[] spawn {
		while {true} do {
			if(playerIsUnit("SRROp") || playerIsUnit("sniperTeamLead")) then {
				["FullCommand",true] call AIC_fnc_showCommandControl;
			};
			if(playerIsUnit("strikeTeamLead") || playerIsUnit("SRROp") || playerIsUnit("sniperTeamLead")) then {
				["CSSCommand",true] call AIC_fnc_showCommandControl;
			};
			if(!playerIsUnit("strikeTeamLead") && !playerIsUnit("SRROp") && !playerIsUnit("sniperTeamLead")) then {
				["FullCommand",false] call AIC_fnc_showCommandControl;
				["CSSCommand",false] call AIC_fnc_showCommandControl;
			};
			sleep 10;
		};
	};
};

Share this post


Link to post
Share on other sites

Edited the post above to take away command if you're not one of those players

Share this post


Link to post
Share on other sites

That works much better, thank you! One last little issue (I hope!!) is that I can't stop giving waypoints once I've started now. This is only a problem with running on dedi but it means once I've decided to give a group a waypoint I then can't do anything else on the map (same goes for assign vehicle if there isn't one nearby - basically anything involving waypoints)! Secondary mouse button doesn't work. Only way out is to exit the mission. Sorry for all the hassle! Another donation inbound. 

Share this post


Link to post
Share on other sites

Second mouse button should work. Keep the mouse still when you click. If that doesn't work, I've heard also holding ctrl or alt while clicking sometime works.

Share this post


Link to post
Share on other sites

Thanks. I think the confusion is that ALiVE and / or ACE changes the bindings to Ctrl + Alt + Sec Mouse, which works fine. 

Share this post


Link to post
Share on other sites

Hi again Duda! Just wondering if I could trouble you once more (sorry!); is there a way to get Advanced AI Command to initialise during a mission on a dedicated server for all clients rather than at the start?

 

I'm having some issues with ALiVE at the moment which means I need to auto-initialise the server and join once the mission has loaded fully. However, when I join, the scripts above don't work unless I quit and join again. I run my own dedicated server on my machine so I need to start it up again pretty much each time I play. No worries if it's not obvious! Just hoping to tap into your scripting knowledge again if I can. 

 

Really enjoying the mod, it's really difficult to play without now! Adds so much to the game. 

Share this post


Link to post
Share on other sites

Hi again Duda! Just wondering if I could trouble you once more (sorry!); is there a way to get Advanced AI Command to initialise during a mission on a dedicated server for all clients rather than at the start?

 

I'm having some issues with ALiVE at the moment which means I need to auto-initialise the server and join once the mission has loaded fully. However, when I join, the scripts above don't work unless I quit and join again. I run my own dedicated server on my machine so I need to start it up again pretty much each time I play. No worries if it's not obvious! Just hoping to tap into your scripting knowledge again if I can. 

 

Really enjoying the mod, it's really difficult to play without now! Adds so much to the game. 

 

 

Try using this and let me know if you get hint messages (upper right) when you join. You should get a new message every 10 seconds.

#define playerIsUnit(playername) ((missionNamespace getVariable [playername,objNull]) == player)
if(hasInterface) then {
	[] spawn {
		while {true} do {
			if(playerIsUnit("SRROp") || playerIsUnit("sniperTeamLead")) then {
				["FullCommand",true] call AIC_fnc_showCommandControl;
				hint ("Player Assigned FullCommand at " + str diag_ticktime);
			};
			if(playerIsUnit("strikeTeamLead") || playerIsUnit("SRROp") || playerIsUnit("sniperTeamLead")) then {
				["CSSCommand",true] call AIC_fnc_showCommandControl;
				hint ("Player Assigned CSSCommandat " + str diag_ticktime);
			};
			if(!playerIsUnit("strikeTeamLead") && !playerIsUnit("SRROp") && !playerIsUnit("sniperTeamLead")) then {
				["FullCommand",false] call AIC_fnc_showCommandControl;
				["CSSCommand",false] call AIC_fnc_showCommandControl;
				hint ("Player Assigned No Command at " + str diag_ticktime);
			};
			sleep 10;
		};
	};
};

Share this post


Link to post
Share on other sites

Hi Duda, I'm getting the debug hints but nothing is showing on the map so no AI Command still unfortunately. 

Share this post


Link to post
Share on other sites

Hey there! Just some quick suggestions for possible features that could be added to improve the control one has over the AI:

  • A way to see who is left in the group
  • Groups that are in contact will show where the contact is if they have found them
  • A clear building waypoint (?)
  • A garrison building waypoint (?)
  • Telling the medic to heal a certain unit, perhaps even if the unit is not in that group
  • A way to tell AI to get into specific seats in a vehicle (for example, if you want a player to fly a helicopter and AI to sit in the back)
  • An option to remove the command symbols from player-controlled groups from the map
  • A "rearm" waypoint (perhaps it could detect ammo boxes within a certain range and then take compatible magazines?)
  • A "demolition" waypoint (for instance, the player would click on a point on the map, the AI would place a charge there, and a "detonate charge" option would be added to the group menu?)

I'm not a scripter by any means, and so I don't know what any of this would take, but I think they would be very helpful for using AI more effectively. One last thing: if a player could maintain his current TFAR settings and radios while remote controlling a group leader, it would be very helpful, and it's actually one of my largest concerns for this mod. Anyway, thank you for this mod! I'm excited to see where it goes and how great it becomes in the future.

Share this post


Link to post
Share on other sites

This mod breaks HCC - High Command Converter by Igitur.

 

I've posted a similar reply in HCC's thread as well informing them of this.

Just wanted to let you guys know.

 

Anyway, as I suggested to Igitur; Perhaps you should collaborate on making one AI command system?

Share this post


Link to post
Share on other sites

This mod breaks HCC - High Command Converter by Igitur.

 

I've posted a similar reply in HCC's thread as well informing them of this.

Just wanted to let you guys know.

 

Anyway, as I suggested to Igitur; Perhaps you should collaborate on making one AI command system?

 

This mod was designed as a full replacement of vanilla high command. Vanilla high command or high command + HCC won't work with this mod.

 

I wouldn't recommend using them together.

 

This mod is designed to make AI group movement (land, vehicle or vehicle transport) easy and intuitive. HC+HCC provides a more fine-grained approach to commanding groups (but with that comes more complexity). Choosing one or the other depends on what type of experience you're looking for. Since they serve different needs, I don't think it makes sense to combine them.

  • Like 1

Share this post


Link to post
Share on other sites

Amazing addon. Please if is it possible add more flyinheight option (1000,1500m) in next version

Share this post


Link to post
Share on other sites

Is this mod dedicated compatible ? If not, are there any intentions to make it work on a dedicated server ? 

I really like it and would it like some more to have it on my server ;) 

Share this post


Link to post
Share on other sites

Yes, it works on dedicated servers

Share this post


Link to post
Share on other sites

Hey Duda, your Advanced High Command is really impressive and useful. Thank you so much! Can´t believe BI has not developed High Command in a proper way. Maybe that´s the whole point of this game!

Question:
Could you control via script which specific units/groups are going to be under your command, instead of having control automatically of each unit of your side inside the game?
Or in reverse, could you exclude via script some specific units/groups of your command?
I´m working on a mission where I have troops that spawn for defend bases and some other units spawn on those same bases but for attack purposes and I have all the units icons mixed on the map and I want to exclude defensive units.

Thanks again!

Share this post


Link to post
Share on other sites

Hey Duda, your Advanced High Command is really impressive and useful. Thank you so much! Can´t believe BI has not developed High Command in a proper way. Maybe that´s the whole point of this game!

Question:

Could you control via script which specific units/groups are going to be under your command, instead of having control automatically of each unit of your side inside the game?

Or in reverse, could you exclude via script some specific units/groups of your command?

I´m working on a mission where I have troops that spawn for defend bases and some other units spawn on those same bases but for attack purposes and I have all the units icons mixed on the map and I want to exclude defensive units.

Thanks again!

There's some instructions earlier on in the thread for just that. Good news is that it's relatively straightforward to implement! 

Share this post


Link to post
Share on other sites

Yes

 

1. Add this to your init.sqf file:

 

[false] call AIC_fnc_initAICommand;

["MY_COMMAND_CONTROL"] call AIC_fnc_createCommandControl;

 

2. For all groups you want to control, add this to their leader's init field:

 

["MY_COMMAND_CONTROL", group this] call AIC_fnc_commandControlAddGroup;

 

3. For all players doing commanding, add this to their init field:

 

["MY_COMMAND_CONTROL",true] call AIC_fnc_showCommandControl;

 

The "MY_COMMAND_CONTROL" name is just a unique identifier you're assigning to a command control. You basically add groups you want to control to the command control, and then show the command control only to the players you want to give command access to. You can have as many command controls as you want, as long as they have unique names. There are some default command controls called ALL_EAST, ALL_WEST, ALL_CIV and ALL_GUER which already have all groups of the specified side added. Those are what's used when you use the addon version.

 

Also, when including the hpp files in your description.ext, don't include cfgfunctionsaddon.hpp

There's an example description.ext file on the github project. (https://github.com/sethduda/AIC)

 

Also, FYI, the sample init.sqf file on github doesn't pass "false" init the AIC_fnc_initAICommand. This causes it to auto-configure itself and give all units on a side command over their entire side. Passing false disables this auto-configuration, and you have to do it manually like I described above.

  • Like 1

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

×