Jump to content
Sign in to follow this  
das attorney

Command Menu Help

Recommended Posts

I'm making a little mod to change the STOP command on the quick menu and command menu to doStop.

The reasons are that the command in the menu overrides any script based commands issued to your AI squad.

For example: If you order your men to STOP and then use something like doMove on them or doFollow, they will still be stopped. There are ways round some of these problems, but not all of them.

I want to change the STOP command so the

command = CMD_STOP;

value in the config is replaced by something else.

I've tried the following:

class CfgPatches {
class HORDEtestMod {
                                     //  snip
};
};

class RscGroupRootMenu {
access = ReadAndWrite;
title = "";
atomic = 0;
vocabulary = "";
contexsensitive = 1;

class Items {		
	class Stop {
		command = "{doStop _x} forEach (groupSelectedUnits player);";
	};

	class StopAuto {
		command = "{doStop _x} forEach (groupSelectedUnits player);";
	};
};
};

class RscSubmenu {
access = ReadAndWrite;
atomic = 0;

class Separator {
	title = "";
	shortcuts[] = {0};
	command = -1;
};

class Back {
	title = "";
	shortcuts[] = {14};
	command = -4;
	speechId = 0;
};
};

class RscMoveHigh : RscSubmenu {
title = $STR_MOVE;
vocabulary = "";
items[] = {"Join", "Separator", "Advance", "StayBack", "FlankLeft", "FlankRight", "Separator", "Stop", "Expect", "Hide", "Separator", "NextWP", "Back"};

class Stop {
	command = "{doStop _x} forEach (groupSelectedUnits player);";
};

};

Now when I open the command menu or select the units with the space bar, they go into STOP mode instantly. What scripting command can I use to determine that the STOP button is pressed and then doStop all the selected units?

I think it should look something like this:

command = "if ( stop_button_is_pressed_so_condition_is_fufilled ) then {doStop _x} forEach (groupSelectedUnits player);";

But I don't know how to find the correct condition.

Can anyone help?

Thanks, DA

Share this post


Link to post
Share on other sites

if ( stop_button_is_pressed_so_condition_is_fufilled ) then {
{
	doStop _x;
} forEach (groupSelectedUnits player);
};

or in one line:

if ( stop_button_is_pressed_so_condition_is_fufilled ) then [color="#FF0000"]{[/color]{doStop _x[color="#FF0000"];[/color]} forEach (groupSelectedUnits player);[color="#FF0000"]};[/color]

I know sqs does not require ";" ending lines, not sure how it goes on configs (i always use sqf syntax), but if the issue is only syntax you missed what is colored red.

Then I don't know what you mean by checking if the button is pressed...

---------- Post added at 22:12 ---------- Previous post was at 21:52 ----------

Just noticed another thing... the

command = ...

accepts integer values... corresponding to something i can't remember right now. and I can't find the reference I used.

what i did to customize the vanilla menu in one of my mods was:

class RscStatus: RscSubmenu
{
title = "$STR_MENU_STATUS";
vocabulary = "";
items[] = {"Support","FuelLow","AmmoLow","Injured","WhereAreYou","Report","UnderFire","OneLess","IsDown","ReportTarget","Back"}; // Note "ReportTarget" added here
class ReportTarget // Added class
{
	title = "Report target";
	shortcuts[] = {10};
	command = -5; // I really can't find the reference for this but this one > http://community.bistudio.com/wiki/Talk:showCommandingMenu
	class Params
	{
		// REFERENCE: http://community.bistudio.com/wiki/showCommandingMenu
		expression = "[groupSelectedUnits player,_pos,_is3D] execVM 'GAM\GAM_ClockfacingReport_CO\scripts\addActions.sqf'"; // custom code to run, note that I am passing relevant variable here
	};
	show = "1";
	enable = "1";
};
};

So i believe for one to run custom code you must add the class Params there and follow in the "expression = ..."

---

Reference is on that page, though not visible

"// CMD: (for main menu: ) CMD_SEPARATOR -1; CMD_NOTHING -2; CMD_HIDE_MENU -3; CMD_BACK -4; (for custom menu: ) CMD_EXECUTE -5"

Edited by gammadust

Share this post


Link to post
Share on other sites

Thank you very much for your post. That's exactly what I'm looking for. I've had a play about with it and got it in game and working.

Much obliged for the detailed explanation :)

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  

×