Sign in to follow this  
WeabusUltimas

Scripts and Tips

7 posts in this topic

Welcome to the Fighting 13th Script Collection and Mission Making Tips. Please feel free to post and/or contribute any Arma 3 scripts or Mission Making Tips and they will be added to this top post for easy access as long as they follow the guidelines or are determined to be useful.

Rules:

  1.  Scripts should be short and sweet. We don't want your whole mission file just the little pieces that make your life easier. (Respawn, arsenals, ambient lights, etc)
  2.  A short description of what the script does and any requirements it may have. (Requires separate sqf, place in unit init, etc)
  3. Tips should be short and concise as well. We are not looking for guides but potential shortcuts, little known hotkeys, and other similar things.

Scripts

  • Arsenal

This script allows for any unit or object to give access to the arsenal through the vanilla interaction menu. Must be placed in the unit or objects init

this addaction ["Arsenal", { ["Open",true] call BIS_fnc_arsenal; }];

 

Tips

  • Missions do not need to be compressed into a .pbo to run on the server

This can be helpful as it means you or the server admins can edit any scripts you may have in the mission file while on server rather than submitting a  new .pbo every time you change something

Share this post


Link to post
Share on other sites

AWESOME!  I can't wait to see what kind of missions we can put out when working together.

Share this post


Link to post
Share on other sites

Legend
||= select variable and delete bracket
//= Notes


//Limit respawns to 3
    myRespawns = 0;

    while {true} do {
        waitUntil {!alive player};
        if (myRespawns >= 3) then {endMission "END1"};
        waitUntil {alive player};
    myRespawns = myRespawns + 1;

//How to Mark a moving target (save as Init.sqf) Change VIP1 To another name to have multiple targets represented. Change .05 to change intel time on map.
    [] spawn {
    while{not isnull |Target name|} do {"Marker_VIP1" setmarkerpos getpos VIP1; sleep .05;};
    };

//Text file
    Respawn|West/East| = "|Base/Instant/Group/Side|"
    Respawndelay = "|Amount in Sec|"

//Marker Name
    respawn_|West/East|

//Initiallization remove script
    Removeallweapons this;

//Trigger Conditions. ! means not. Checks if both targets are dead
    !Alive |Target name| && !Alive |Target name|

//Weapons In cargo Example change variables
this addweaponcargo ["arifle_MX_F", 20];

//Magazine In Cargo Example change variables
this addMagazinecargo ["30Rnd_65x39_Caseless_mag", 100];

//Items In Cargo Example Change variables
this additemcargo ["Zasleh2",20];

Share this post


Link to post
Share on other sites

------------------------------------------------------------------------

----           PRESET TFAR SETTINGS FOR ALL PLAYERS         ----

------------------------------------------------------------------------

In your mission folder create a file called init.sqf

Insert following code:

// TFR mod configuration
#include "\task_force_radio\functions\common.sqf";

tf_give_personal_radio_to_regular_soldier = true;
publicVariable "tf_give_personal_radio_to_regular_soldier";

tf_same_sw_frequencies_for_side = true;
publicVariable "tf_same_sw_frequencies_for_side";

tf_same_lr_frequencies_for_side = true;
publicVariable "tf_same_lr_frequencies_for_side";

_settingsSwWest = false call TFAR_fnc_generateSwSettings;
_settingsSwWest set [2, ["101","102","103","104","105","106","107","108"]];
tf_freq_west = _settingsSwWest;
publicVariable "tf_freq_west";

_settingsLRWest = false call TFAR_fnc_generateLRSettings; 
_settingsLRWest set [2, ["50","60","52","53","54","55","56","57","58"]]; 
tf_freq_west_lr = _settingsLRWest; 
publicVariable "tf_freq_west_lr";

 

------------------------------------------------------------------------

----                TURN OFF ALL NPC RADIO CHATTER                ----

------------------------------------------------------------------------

In your mission folder create a file called init.sqf

Insert following code:

//Mute radio chatter
0 fadeRadio 0;

Share this post


Link to post
Share on other sites

------------------------------------------------------------------------

----                SET MISSION START DATE & TIME                    ----

----              SET DAYLIGHT AND NIGHT DURATION                ----

----       & SET TIME TO GO FASTER AT NIGHT THAN DAY     ----

------------------------------------------------------------------------

In your mission folder create a file called time.sqf

Insert following code:

setDate [2036, 2, 25, 13, 00];  //(4:00pm February 25, 1986)

if (!isServer) exitWith {};

while {true} do
{
    if (daytime >= 19 || daytime < 5) then   // after 7pm and before 5am time multiplier changes
    {
        setTimeMultiplier 16      // adjust this value for slower or faster night cycle ( 24 hours will take 1 hour )
    }
    else
    {
        setTimeMultiplier 8      // adjust this value for slower or faster day cycle  ( 12 hours will take 1 hour )
    };

    uiSleep 30;
};

 

In your mission folder create a file called init.sqf

Insert following code:

//TIME ACCELERATION
[] execVM "time.sqf";

 

Share this post


Link to post
Share on other sites

------------------------------------------------------------------------

----           ANIMATE BAR GATES TO OPEN AND CLOSE        ----

------------------------------------------------------------------------

  1. In the editor: Create a bargate and give it a name. Example - gate01
  2. Create a trigger and place in desired location. 
  3. Double click the trigger, and set the desired condition.
    • Example: ACTIVATION: BLUFOR   |  ACTIVATION TYPE: PRESENT - will trigger when any BLUFOR unit is present, player or AI
  4. Activate the REPEATABLE option (optional)
  5. In ON ACTIVATION enter the following code:
gate01 animate ["Door_1_rot", 1]

In ON DEACTIVATION enter the following code:

gate01 animate ["Door_1_rot", 0]

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this