Results 1 to 4 of 4

Thread: Command Menu Help

  1. #1

    Command Menu Help

    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
    PHP Code:
    command CMD_STOP
    value in the config is replaced by something else.

    I've tried the following:

    PHP Code:
    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:

    PHP Code:
    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
    Not a script kiddie turned forum hero.

  2. #2
    PHP Code:
    if ( stop_button_is_pressed_so_condition_is_fufilled then {
        {
            
    doStop _x;
        } forEach (
    groupSelectedUnits player);
    }; 
    or in one line:


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

    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

    Code:
    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:

    PHP Code:
    class RscStatusRscSubmenu
    {
        
    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"

  3. #3
    Sergeant Major Das Attorney's Avatar
    Join Date
    Oct 27 2009
    Location
    Brighton
    Posts
    1,819
    Author of the Thread
    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

  4. #4
    glad i could help. gl in ur mod

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •