a bit of refactoring and added readmes

This commit is contained in:
Eero af Heurlin 2016-07-25 20:49:54 +03:00
parent b2504acf33
commit 0e29582b38
11 changed files with 92 additions and 72 deletions

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# ArmA III missions
I need some place to keep track of the changes, pbos will appear to withsix or steam at some point.
For my part you're free to reuse anything anywhere as long as you give credit.

View File

@ -0,0 +1,10 @@
# Multiplayer helicopter training mission
Multiplayer conversion (and almost complete rewrite on the script side) of [Wibblers mission][wbmp].
Probably will not run as singplayer scenario at all but that doesn't matter, just host a LAN game even if you're the only one playing.
Also includes code borrowed from [Kylania][kex].
[wbm]: http://steamcommunity.com/sharedfiles/filedetails/?id=192094335&searchtext=helicopter+training
[kex]: http://www.kylania.com/ex/

View File

@ -10,7 +10,7 @@ switch (side player) do
{
player createDiaryRecord ["Diary", ["I found a bug?",
"No you didn't. Shhh."]];
"Use github: <a href='https://github.com/rambo/arma3_missions'>https://github.com/rambo/arma3_missions</a><br>Based on <a href='http://steamcommunity.com/sharedfiles/filedetails/?id=192094335&searchtext=helicopter+training'>Wibblers work</a>."]];
player createDiaryRecord ["Diary", ["Does it end?",
"Nope! The mission will continue on until you feel you've had enough training, at which point you can quit."]];
@ -24,8 +24,6 @@ switch (side player) do
player createDiaryRecord ["Diary", ["Mission Objectives",
"Select your chopper of choice and fly to the marked LZ. You'll be meeting up with fireteams who've requested EVAC and transporting them to other LZs. Watch out for enemy squads and anti-air troopers."]];
};

View File

@ -46,7 +46,7 @@ private _assignTo = [_assignToPlayer, west];
private _taskid = format["dropoff_%1", lzCounter];
[_assignTo,[_taskid],[_longdesc, _shortdesc, _shortestDesc],getPos _lzLocation,"AUTOASSIGNED",1,true, _taskType, true] call BIS_fnc_taskCreate;
private _trg = createTrigger["EmptyDetector",getPos _lzLocation, true];
private _trg = createTrigger["EmptyDetector",getPos _lzLocation, false];
_trg setTriggerArea[lzSize,lzSize,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];

View File

@ -52,7 +52,7 @@ if (bSmoke) then
[_squad, _lzLocation, 'green'] spawn spawnSmokeBySquad;
};
private _trg = createTrigger["EmptyDetector",getPos _lzLocation, true];
private _trg = createTrigger["EmptyDetector",getPos _lzLocation, false];
_trg setTriggerArea[lzSize,lzSize,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];

View File

@ -1,75 +1,18 @@
// Config constant globals
_lzCount = 86;
LZCOUNT = 86;
// Compile helpers
createDropoffLZ = compile preProcessfile "createDropoffLZ.sqf";
createPickupLZ = compile preProcessfile "createPickupLZ.sqf";
createSquad = compile preProcessfile "createSquad.sqf";
createEnemySquads = compile preProcessfile "createEnemySquads.sqf";
loadSquad = compile preProcessfile "loadSquad.sqf";
ejectSquad = compile preProcessfile "ejectSquad.sqf";
spawnSmokeBySquad = compile preProcessfile "spawnSmokeBySquad.sqf";
deleteSquads = compile preProcessfile "deleteSquads.sqf";
playerVehicleInList = compile preProcessfile "playerVehicleInList.sqf";
playerVehicleInListBool = compile preProcessfile "playerVehicleInListBool.sqf";
getSideTasks = compile preProcessfile "getSideTasks.sqf";
getSideActiveTasks = compile preProcessfile "getSideActiveTasks.sqf";
execVM "briefing.sqf";
// Precompile code
execVM "precompile.sqf";
//Handle MP parameters
execVM "readparams.sqf";
//Time of day
_time = paramsArray select 0;
if (_time != 1) then
{
skipTime (_time - daytime + 24 ) % 24;
}
else
{
skiptime (floor random 24);
};
//LZ size
lzSize = paramsArray select 1;
publicVariable "lzSize";
//Smoke setting
bSmoke = if ((paramsArray select 2) == 1) then {true} else {false};
publicVariable "bSmoke";
//Hot LZ chance
_hotLZParam = paramsArray select 3;
hotLZChance = if (_hotLZParam > 0) then {_hotLZParam / 100} else {0.0};
publicVariable "hotLZChance";
//Anti air chance
_AAParam = paramsArray select 4;
AAChance = if (_AAParam > 0) then {_AAParam / 100} else {0.0};
publicVariable "AAChance";
lzList = [];
_x = 0;
while {_x < _lzCount} do
{
_lz = missionNamespace getVariable ("lz" + format["%1", _x + 1]);
lzList = lzList + [_lz];
_x = _x + 1;
};
publicVariable "lzList";
lzCounter = 0;
publicVariable "lzCounter";
missionInitComplete = true;
publicVariable "missionInitComplete";
// We can't run this before
if (isServer) then
{
execVM "taskSpawner.sqf";
};
// Flag init complete
missionInitComplete = true;
publicVariable "missionInitComplete";

View File

@ -0,0 +1,2 @@
// Load the briefing (it will wait for the player object)
execVM "briefing.sqf";

View File

@ -0,0 +1 @@
// This is actually a bit early to do anything.

View File

@ -0,0 +1,17 @@
// Compile helpers
createDropoffLZ = compile preProcessfile "createDropoffLZ.sqf";
createPickupLZ = compile preProcessfile "createPickupLZ.sqf";
createSquad = compile preProcessfile "createSquad.sqf";
createEnemySquads = compile preProcessfile "createEnemySquads.sqf";
loadSquad = compile preProcessfile "loadSquad.sqf";
ejectSquad = compile preProcessfile "ejectSquad.sqf";
spawnSmokeBySquad = compile preProcessfile "spawnSmokeBySquad.sqf";
deleteSquads = compile preProcessfile "deleteSquads.sqf";
playerVehicleInList = compile preProcessfile "playerVehicleInList.sqf";
playerVehicleInListBool = compile preProcessfile "playerVehicleInListBool.sqf";
getSideTasks = compile preProcessfile "getSideTasks.sqf";
getSideActiveTasks = compile preProcessfile "getSideActiveTasks.sqf";
taskSpawner = compile preProcessfile "taskSpawner.sqf";

View File

@ -0,0 +1,44 @@
//Time of day
_time = paramsArray select 0;
if (_time != 1) then
{
skipTime (_time - daytime + 24 ) % 24;
}
else
{
skiptime (floor random 24);
};
//LZ size
lzSize = paramsArray select 1;
publicVariable "lzSize";
//Smoke setting
bSmoke = if ((paramsArray select 2) == 1) then {true} else {false};
publicVariable "bSmoke";
//Hot LZ chance
_hotLZParam = paramsArray select 3;
hotLZChance = if (_hotLZParam > 0) then {_hotLZParam / 100} else {0.0};
publicVariable "hotLZChance";
//Anti air chance
_AAParam = paramsArray select 4;
AAChance = if (_AAParam > 0) then {_AAParam / 100} else {0.0};
publicVariable "AAChance";
lzList = [];
_x = 0;
while {_x < LZCOUNT} do
{
_lz = missionNamespace getVariable ("lz" + format["%1", _x + 1]);
lzList = lzList + [_lz];
_x = _x + 1;
};
publicVariable "lzList";
// Keep track of how many LZ we have created, used to give tasks unique names and priorities
lzCounter = 0;
publicVariable "lzCounter";

View File

@ -4,7 +4,7 @@ private _smokeTgt = _this select 1;
private _smokeLocation = getPos _smokeTgt;
private _smokeColor = _this select 2;
private _trg = createTrigger["EmptyDetector", _smokeLocation, true];
private _trg = createTrigger["EmptyDetector", _smokeLocation, false];
_trg setTriggerArea[50,50,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
private _keepSpawning = true;