I've spent about a year and a half learning whatever I can about ARMA 3 scripting. Mostly to help improve game play on the Epoch servers I have helped Admin. Mostly pretty basic stuff, like adding code to improve existing mods and scripts. That's how I learn.
For example, I have written one addon already to add markers around the protected traders in Altis for the server I currently Admin. But it was so simple, I don't really consider it an addon. I have written and refined several missions from several of the popular mission systems as well.
Here is what I want to do:
Combine the code I have written for the Protected Trader Markers, Static Missions and Static Loot Crates into one, self starting addon.
Here is what I have so far:
$PBOPREFIX$ File:
RAGE
config.cpp File:
class CfgPatches {
class RAGE {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"A3_server_settings"};
};
};
class CfgFunctions {
class RAGE {
class RAGEmain {
file = "RAGE";
class init {
postInit = 1;
};
};
};
};
fn_init.sqf File:
This is the part of which I am unsure. From this fn_init.sqf, I am attempting to load my map markers file and wait for it to load. Then, load my functions and wait for them to be loaded. Of course reporting each step to the RPT.
// INITIALIZE SOME GLOBALS.
RAGE_Debug = true;
RAGE_PTMARKERS_LOADED = false;
RAGE_FUNCTIONS_LOADED = false;
// LOAD PROTECTED TRADER AND REPORT.
if (RAGE_Debug) then {
diag_log text format ["[RAGE]: Loading RAGE_PT_Markers.sqf."];
};
RAGE_PTMARKERS_LOADED = [] execVM "RAGE\ptmarkers\RAGE_PT_Markers.sqf";
waitUntil {RAGE_PTMARKERS_LOADED};
if (RAGE_Debug) then {
diag_log text format ["[RAGE]: RAGE_PT_Markers.sqf Loaded."];
};
// LOAD FUNCTIONS AND REPORT.
if (RAGE_Debug) then {
diag_log text format ["[RAGE]: Loading RAGE_Functions.sqf."];
};
RAGE_FUNCTIONS_LOADED = [] execVM "RAGE\RAGE_Functions.sqf";
// WAIT UNTIL FUNCTIONS ARE LOADED TO CONTINUE.
waitUntil {RAGE_FUNCTIONS_LOADED};
if (RAGE_Debug) then {
diag_log text format ["[RAGE]: RAGE_Functions.sqf Loaded."];
};
Am I on the right track here? The idea was to load each file and when RAGE_PTMARKERS_LOADED and RAGE_FUNCTIONS_LOADED report true, to move on to starting up the missions. Since the missions and crates rely on functions in RAGE_Functions.sqf and markers in RAGE_PT_Markers.sqf.
Question
Redbeard Actual
I've spent about a year and a half learning whatever I can about ARMA 3 scripting. Mostly to help improve game play on the Epoch servers I have helped Admin. Mostly pretty basic stuff, like adding code to improve existing mods and scripts. That's how I learn.
For example, I have written one addon already to add markers around the protected traders in Altis for the server I currently Admin. But it was so simple, I don't really consider it an addon. I have written and refined several missions from several of the popular mission systems as well.
Here is what I want to do:
Combine the code I have written for the Protected Trader Markers, Static Missions and Static Loot Crates into one, self starting addon.
Here is what I have so far:
$PBOPREFIX$ File:
RAGE
config.cpp File:
class CfgPatches { class RAGE { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"A3_server_settings"}; }; }; class CfgFunctions { class RAGE { class RAGEmain { file = "RAGE"; class init { postInit = 1; }; }; }; };
fn_init.sqf File:
This is the part of which I am unsure. From this fn_init.sqf, I am attempting to load my map markers file and wait for it to load. Then, load my functions and wait for them to be loaded. Of course reporting each step to the RPT.
// INITIALIZE SOME GLOBALS. RAGE_Debug = true; RAGE_PTMARKERS_LOADED = false; RAGE_FUNCTIONS_LOADED = false; // LOAD PROTECTED TRADER AND REPORT. if (RAGE_Debug) then { diag_log text format ["[RAGE]: Loading RAGE_PT_Markers.sqf."]; }; RAGE_PTMARKERS_LOADED = [] execVM "RAGE\ptmarkers\RAGE_PT_Markers.sqf"; waitUntil {RAGE_PTMARKERS_LOADED}; if (RAGE_Debug) then { diag_log text format ["[RAGE]: RAGE_PT_Markers.sqf Loaded."]; }; // LOAD FUNCTIONS AND REPORT. if (RAGE_Debug) then { diag_log text format ["[RAGE]: Loading RAGE_Functions.sqf."]; }; RAGE_FUNCTIONS_LOADED = [] execVM "RAGE\RAGE_Functions.sqf"; // WAIT UNTIL FUNCTIONS ARE LOADED TO CONTINUE. waitUntil {RAGE_FUNCTIONS_LOADED}; if (RAGE_Debug) then { diag_log text format ["[RAGE]: RAGE_Functions.sqf Loaded."]; };
Am I on the right track here? The idea was to load each file and when RAGE_PTMARKERS_LOADED and RAGE_FUNCTIONS_LOADED report true, to move on to starting up the missions. Since the missions and crates rely on functions in RAGE_Functions.sqf and markers in RAGE_PT_Markers.sqf.
Thank you to whoever reads and responds.
Link to comment
Share on other sites
25 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now