How-To Add Scroll Menu Actions

If you haven’t read “How-To Begin Customizing a DayZ Mod Server“, now is a good time.

If you’d like to add general scroll menu actions or actions associated with object while pointing at them, then a custom fn_selfActions.sqf is what you need. You will also need a custom compiles.sqf and custom variables.sqf.

Creating a custom fn_selfActionssqf

    1. Create a new directory, named “custom” in the mission folder
    2. Extract fn_selfActions.sqf from dayz_code.pbo\actions and put it in the directory
    3. Edit custom\fn_selfActions.sqf and add your custom actions.
      • Review this file and see the various state variables at the top. These variables are relatively self-explanatory:
        _vehicle = vehicle player;
        _inVehicle = (_vehicle != player); // is the player in a vehicle
        _cursorTarget = cursorTarget; // what the cursor is pointing at
        _primaryWeapon = primaryWeapon player; // the players primary weapon
        _currentWeapon = currentWeapon player; // the players current weapon
        _magazinesPlayer = magazines player; // the players current magazines (inventory items, not tools)
        _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; // is the player on a ladder
        _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder); // can the player "do" most actions

         

      • Review the various IF statements to see more state variables and cases where the player can perform an action, how the scripts are called and how the menus are set on/off.
      • Review the various IF statements and how the menu status variables are set on/off
    4. Edit custom\compiles.sqf to point to your custom fn_selfActions.sqf
    5. Edit custom\vaiables.sqf to declare new global variables, most likely for menu status.

 

[TODO – Add specific tutorials. I have code examples for Bury Body & Suicide]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s