Jump to content
Sign in to follow this  
rscarrab

Help with Init.sqf syntax

Recommended Posts

Hi there :), im having a bit of lag at the start of a mission ive made. Im sure it has to do with all the scripts im running coupled with the fact that i know zilch about how an init file should be constructed.

All the scripts work, but ive got a feeling i might be able to make it run better if someone could advise me as to how i should have it constructed. ;)

Any help would be appreciated. Cheers.

:cheers:

Init.sqf

//begin init.sqf

// JIP fix - why does ArmA execute init.sqf for JIP players, if 'player' is not sync'd yet

if ((!isServer) && (player != player)) then

{

waitUntil {player == player};

};

// make the briefing ( this really is required )

execVM "briefing.sqf";

civilian setFriend[East, 0];

"zone1" setMarkerAlpha 0;

"zone2" setMarkerAlpha 0;

"zone3" setMarkerAlpha 0;

"zone4" setMarkerAlpha 0;

"AerialPatrol_1" setMarkerAlpha 0;

cutText ["FOB Revolver Day 2: Someones having a picnic in hell and its our job to crash it...", "BLACK FADED", 0];

sleep 3;

cutText ["FOB Revolver Day 2: Someones having a picnic in hell and its our job to crash it...", "BLACK IN", 3];

sleep 3;

[str ("Joint Ops : Chernarus") , str(date select 1) + "." + str(date select 2) + "." + str(date select 0), str("=NF= Naked Fanatics")] spawn BIS_fnc_infoText;

nul = execVM "=BTC=Lift\LiftInit.sqf";

//Initialise revive script (this next line is needed for revive script)

server execVM "revive_init.sqf";

waitUntil{!(isNil "BIS_fnc_init")};

if (isServer) then

{

//Init UPSMON scritp

call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";

};

#include "ECHO\Includes\Paths.hpp"

private [

"_acm_list",

"_mission_hour",

"_visibility",

"_us_spotters",

"_us_batteries",

"_shot",

"_splash",

"_comp",

"_nomish",

"_check",

"_ok"

];

// this just prevents the auto-save when in the mp-editor, not required for you at all

enableSaving [false, false];

// F2 - ShackTactical Fireteam Member Markers

// Credits: Please see the F2 online manual (http://www.ferstaberinde.com/f2/en/)

null = execVM "AT_Adj\AT_init.sqf";

[] execVM "markers\ShackTac_setlocalFTMemberMarkers.sqf";

// Default values will be used:

[2500, 1000, 4000, 3, 2, 5] execVM "otfgfx\otfgfx_scripts.sqf";

//Let's preprocess a file to act as a function to handle the key presses:

DFS_keySpoof = compile preprocessFileLineNumbers "ehHandling.sqf";

//Adding a display EH - each time a button is pressed the function is called to process it:

(findDisplay 46) displaySetEventHandler ["KeyDown", "_this call DFS_keySpoof"];

if ( isServer ) then {

// Mission parameters

skiptime (paramsArray select 0);

sleep 5;

// Start Fire Director.

_us_batteries = [A_Battery, B_Battery];

_us_spotters = [OB1, OB2, OB3, OB4, OB5, OB6, OB7, OB8, OB9, OB10, OB11, OB12, OB13, OB14, OB15 , OB16, OB17, OB18, OB19, OB20, OB21, OB22, OB23];

_shot = {

private ["_ob", "_bat", "_pos", "_grid"];

_ob = _this select 0;

_bat = _this select 1;

_pos = _this select 2;

_grid = _pos call BIS_fnc_PosToGrid;

_ob globalChat format["%1 - Shot. Grid %2%3", _bat, _grid select 0, _grid select 1];

};

_splash = {

private ["_ob", "_bat", "_pos"];

_ob = _this select 0;

_bat = _this select 1;

_pos = _this select 2;

_ob globalChat format["%1 - Splas

h.", _bat];

};

_comp = {

private ["_ob", "_bat", "_pos"];

_ob = _this select 0;

_bat = _this select 1;

_pos = _this select 2;

_ob globalChat format["%1 - Rounds complete.", _bat];

};

_nomish = {

private ["_ob", "_bat", "_pos"];

_ob = _this select 0;

_bat = _this select 1;

_pos = _this select 2;

_ob globalChat format["%1 - No mission. Out", _bat];

};

_check = {

private ["_ob", "_bat", "_pos"];

_ob = _this select 0;

_bat = _this select 1;

_pos = _this select 2;

_ob globalChat format["%1 - Checking fire. Out", _bat];

};

waituntil { not isNil "bis_fnc_init"};

waitUntil { not isNil "BIS_ARTY_LOADED"};

_ok = [OB1, 600] call ECHO_fnc_SetSpotterRange;

_ok = [OB2, 550] call ECHO_fnc_SetSpotterRange;

_ok = [OB3, 500] call ECHO_fnc_SetSpotterRange;

_ok = [OB4, 600] call ECHO_fnc_SetSpotterRange;

_ok = [OB5, 550] call ECHO_fnc_SetSpotterRange;

_ok = [OB6, 500] call ECHO_fnc_SetSpotterRange;

_ok = [OB7, 480] call ECHO_fnc_SetSpotterRange;

_ok = [OB8, 450] call ECHO_fnc_SetSpotterRange;

_ok = [OB9, 500] call ECHO_fnc_SetSpotterRange;

_ok = [OB10, 600] call ECHO_fnc_SetSpotterRange;

_ok = [OB11, 550] call ECHO_fnc_SetSpotterRange;

_ok = [OB12, 600] call ECHO_fnc_SetSpotterRange;

_ok = [OB13, 550] call ECHO_fnc_SetSpotterRange;

_ok = [A_Battery, 6.9] call ECHO_fnc_SetBatteryMaxSpeed;

_ok = [A_Battery, 12.5] call ECHO_fnc_SetBatteryMinDispersion;

_ok = [A_Battery, [EZ1, EZ2, EZ3, EZ4, EZ5, EZ6]] call ECHO_fnc_SetBatteryExclusionList;

_ok = [b_Battery, 6.9] call ECHO_fnc_SetBatteryMaxSpeed;

_ok = [b_Battery, 12.5] call ECHO_fnc_SetBatteryMinDispersion;

_ok = [b_Battery, [EZ1, EZ2, EZ3, EZ4, EZ5, EZ6]] call ECHO_fnc_SetBatteryExclusionList;

call ECHO_fnc_SetBatteryDialog;

FD_US = [_us_spotters, _us_batteries, 60, 20, 1] execFSM ECHO_FD_FSMDIR+"FireDirector2.fsm";

};

//non-JIP player, someone who's went through role selection and briefing

if (!(isNull player)) then

{

// ==================================================

// GeneralCarver Vehicle Ammo Crate v3 Init Scripting

gc_veh_ammo_crate_script_action_manager = execVM "scripts\gc_veh_ammo_crate\gc_veh_ammo_crate_action_manager.sqf";

gc_veh_ammo_crate_vehicle_array = [r_mobile_spawn_vcl];

gc_veh_ammo_crate_ammo_crate_array = [ammovehicle_crate];

gc_veh_ammo_crate_storage_marker_array = ["ammovehicle_crate_marker"];

gc_veh_ammo_crate_y_offset_value = [-6];

gc_veh_ammo_crate_script_active = false;

//

// ==================================================

};

//JIP player, role selection then right into mission.

if (!isServer && isNull player) then

{

waitUntil {!isNull player};

// ==================================================

// GeneralCarver Vehicle Ammo Crate v3 Init Scripting

gc_veh_ammo_crate_script_action_manager = execVM "scripts\gc_veh_ammo_crate\gc_veh_ammo_crate_action_manager.sqf";

gc_veh_ammo_crate_vehicle_array = [r_mobile_spawn_vcl];

gc_veh_ammo_crate_ammo_crate_array = [ammovehicle_crate];

gc_veh_ammo_crate_storage_marker_array = ["ammovehicle_crate_marker"];

gc_veh_ammo_crate_y_offset_value = [-6];

gc_veh_ammo_crate_script_active = false;

//

// ==================================================

};

setviewdistance 2500;

//Process statements stored using setVehicleInit

processInitCommands;

//Finish world initialization before mission is launched.

finishMissionInit;

//_ok = [] call BIS_fnc_help;

if(true) exitWith {};

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  

×