0.3.8.0465

Epoch PBO packer 1.0
add playerNuisance variable
a few small optimizations
This commit is contained in:
vbawol 2016-05-18 11:48:48 -05:00
parent c363bad748
commit 6f169cff93
40 changed files with 290 additions and 236 deletions

View File

@ -31,26 +31,19 @@ params [
["_anim", ""], ["_anim", ""],
["_state", 0] ["_state", 0]
]; ];
if !(isNull _object) then{ if !(isNull _object) then{
_msg = "Missing Items"; _msg = "Missing Items";
// Get config // Get config
_config = 'CfgBaseBuilding' call EPOCH_returnConfig; _config = 'CfgBaseBuilding' call EPOCH_returnConfig;
// upgradeBuildingPart // upgradeBuildingPart
_objClass = typeOf _object; _objClass = typeOf _object;
// Add part // Add part
if (_state == 1) then{ if (_state == 1) then{
_recipe = getArray(_config >> _objClass >> "upgradeBuildingPart"); _recipe = getArray(_config >> _objClass >> "upgradeBuildingPart");
_mags = magazines player; _mags = magazines player;
_recipeCount = 0; _recipeCount = 0;
_numRemoved = 0; _numRemoved = 0;
_hasRecipeItems = true; _hasRecipeItems = true;
// Dry Run // Dry Run
{ {
_recipeItem = _x; _recipeItem = _x;
@ -66,7 +59,6 @@ if !(isNull _object) then {
_msg = format["Need %2 %1 Have %3", _recipeItem call EPOCH_itemDisplayName, _recipeCount, _currentCount]; _msg = format["Need %2 %1 Have %3", _recipeItem call EPOCH_itemDisplayName, _recipeCount, _currentCount];
}; };
}forEach _recipe; }forEach _recipe;
// remove item // remove item
if (_hasRecipeItems) then{ if (_hasRecipeItems) then{
{ {
@ -87,9 +79,7 @@ if !(isNull _object) then {
}; };
}; };
}; };
} else { } else {
_mags = magazines player; _mags = magazines player;
_currentCount = { _x == _recipeItem } count _mags; _currentCount = { _x == _recipeItem } count _mags;
if (_currentCount >= _recipeQty) then{ if (_currentCount >= _recipeQty) then{
@ -101,36 +91,22 @@ if !(isNull _object) then {
}; };
}; };
}; };
}forEach _recipe; }forEach _recipe;
}; };
if (_numRemoved == _recipeCount) then{ if (_numRemoved == _recipeCount) then{
_object animate[_anim, _state, true]; _object animate[_anim, _state, true];
// push interacted object to queue to save later // push interacted object to queue to save later
EPOCH_arr_interactedObjs pushBackUnique _object; EPOCH_arr_interactedObjs pushBackUnique _object;
[format["<t size='1.6' color='#99ffffff'>%1 part on %2</t>", "Added", _objClass call EPOCH_itemDisplayName], 5] call Epoch_dynamicText; [format["<t size='1.6' color='#99ffffff'>%1 part on %2</t>", "Added", _objClass call EPOCH_itemDisplayName], 5] call Epoch_dynamicText;
[format["<t size='1.6' color='#99ffffff'>%1 part on %2</t>","Added",_objClass call EPOCH_itemDisplayName], 5] call Epoch_dynamicText;
} else { } else {
[format["<t size='1.6' color='#99ffffff'>%1</t>", _msg], 5] call Epoch_dynamicText; [format["<t size='1.6' color='#99ffffff'>%1</t>", _msg], 5] call Epoch_dynamicText;
}; };
} else { } else {
// Remove part // Remove part
_recipe = getArray(_config >> _objClass >> "removeBuildingPart"); _recipe = getArray(_config >> _objClass >> "removeBuildingPart");
_object animate[_anim, _state, true]; _object animate[_anim, _state, true];
// push interacted object to save queue to save later // push interacted object to save queue to save later
EPOCH_arr_interactedObjs pushBackUnique _object; EPOCH_arr_interactedObjs pushBackUnique _object;
{ {
_craftItem = _x; _craftItem = _x;
_craftQty = 1; _craftQty = 1;
@ -142,8 +118,6 @@ if !(isNull _object) then {
_craftItem call EPOCH_fnc_addItemOverflow; _craftItem call EPOCH_fnc_addItemOverflow;
}; };
}forEach _recipe; }forEach _recipe;
[format["<t size='1.6' color='#99ffffff'>%1 part on %2</t>", "Removed", _objClass call EPOCH_itemDisplayName], 5] call Epoch_dynamicText; [format["<t size='1.6' color='#99ffffff'>%1 part on %2</t>", "Removed", _objClass call EPOCH_itemDisplayName], 5] call Epoch_dynamicText;
}; };
}; };

View File

@ -174,10 +174,7 @@ if (isText(_simulClassConfig)) then {
} forEach _snapArrayPerp; } forEach _snapArrayPerp;
}; };
if (_isSnap && _distance < 5) then { if (_isSnap && _distance < 5) then {
_pos2 = _snapPosition; _pos2 = AGLToASL _snapPosition;
if (!surfaceIsWater _pos2) then {
_pos2 = ATLtoASL _pos2;
};
_vel2 = (velocity _nearestObject); _vel2 = (velocity _nearestObject);
_direction = getDir _nearestObject; _direction = getDir _nearestObject;
if (_snapType == "perp") then { if (_snapType == "perp") then {

View File

@ -27,23 +27,21 @@
Returns: Returns:
NOTHING NOTHING
*/ */
private ["_heal","_highestDMG","_currentHIT","_currentDMG","_newDMG","_attachments","_cursorTarget","_repaired","_gesture","_droneChance"]; private ["_heal","_highestDMG","_currentHIT","_currentDMG","_newDMG","_attachments","_cursorTarget","_repaired","_gesture","_nuisanceLevel"];
params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"]; params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
EPOCH_lastFiredLocation = getPosATL player;
switch true do { switch true do {
case (_ammo isKindOf "B_EnergyPack"): { case (_ammo isKindOf "B_EnergyPack"): {
if (!isNull cursorTarget) then { if (!isNull cursorTarget) then {
_cursorTarget = cursorTarget; _cursorTarget = cursorTarget;
_repaired = false; _repaired = false;
if ((player distance _cursorTarget) <= 6) then { if ((player distance _cursorTarget) <= 6) then {
_attachments = handgunItems player; _attachments = handgunItems player;
_heal = false; _heal = false;
if (_cursorTarget isKindOf "Man") then { if (_cursorTarget isKindOf "Man") then {
if ("Heal_EPOCH" in _attachments) then { if ("Heal_EPOCH" in _attachments) then {
_heal = true; _heal = true;
}; };
if ("Defib_EPOCH" in _attachments) then { if ("Defib_EPOCH" in _attachments) then {
if (!alive _cursorTarget) then { if (!alive _cursorTarget) then {
[_cursorTarget,player,Epoch_personalToken] remoteExec ["EPOCH_server_revivePlayer",2]; [_cursorTarget,player,Epoch_personalToken] remoteExec ["EPOCH_server_revivePlayer",2];
@ -65,11 +63,8 @@ switch true do {
_currentHIT = _forEachIndex; _currentHIT = _forEachIndex;
}; };
}forEach((getAllHitPointsDamage _cursorTarget) param[2,[]]); }forEach((getAllHitPointsDamage _cursorTarget) param[2,[]]);
if (_highestDMG > 0) then { if (_highestDMG > 0) then {
_newDMG = ((_highestDMG - 0.5) max 0); _newDMG = ((_highestDMG - 0.5) max 0);
if (local _cursorTarget) then { if (local _cursorTarget) then {
[_cursorTarget,[_currentHIT,_newDMG]] call EPOCH_client_repairVehicle; [_cursorTarget,[_currentHIT,_newDMG]] call EPOCH_client_repairVehicle;
} else { } else {
@ -84,13 +79,11 @@ switch true do {
}; };
}; };
}; };
case (_ammo isKindOf "B_Hatchet"): { case (_ammo isKindOf "B_Hatchet"): {
_gesture = selectRandom ["GestureSwing0", "GestureSwing1", "GestureSwing2"]; _gesture = selectRandom ["GestureSwing0", "GestureSwing1", "GestureSwing2"];
player playActionNow _gesture; player playActionNow _gesture;
call EPOCH_chopWood; call EPOCH_chopWood;
}; };
case (_ammo isKindOf "B_Swing" || _ammo isKindOf "B_Stick") : { case (_ammo isKindOf "B_Swing" || _ammo isKindOf "B_Stick") : {
player playActionNow "SledgeSwing"; player playActionNow "SledgeSwing";
call EPOCH_mineRocks; call EPOCH_mineRocks;
@ -101,23 +94,26 @@ switch true do {
call EPOCH_fish; call EPOCH_fish;
}; };
}; };
case (_ammo isKindOf "ChainSaw_Bullet"): { case (_ammo isKindOf "ChainSaw_Bullet"): {
call EPOCH_chopWood; call EPOCH_chopWood;
}; };
default { default {
_droneChance = 2; _ammoConfig = (configFile >> "CfgAmmo" >> _ammo);
if !(EPOCH_nearestLocations isEqualTo[]) then{ _nuisanceLevel = ceil(getNumber (_ammoConfig >> "audibleFire") * getNumber (_ammoConfig >> "caliber"));
_droneChance = _droneChance * 2; // reduce when not in a city or town
if (EPOCH_nearestLocations isEqualTo[]) then{
_nuisanceLevel = _nuisanceLevel / 2;
}; };
// reduce chance to spawn by 50% if weapon has silencer // reduce if using a silencer
if (((player weaponAccessories _muzzle) select 0) != "") then{ if (((player weaponAccessories _muzzle) select 0) != "") then{
_droneChance = _droneChance / 2; _nuisanceLevel = _nuisanceLevel / 2;
};
// 2% chance (+ 4% chance if in city) to spawn drone if shot fired (1% - 2% Half if using silencer)
if (random EPOCH_droneRndChance < _droneChance) then{
"I_UAV_01_F" call EPOCH_unitSpawnIncrease;
}; };
// force spawn increase once player has become a Nuisance
if (EPOCH_playerNuisance >= 50 && {random EPOCH_droneRndChance < EPOCH_playerNuisance}) then{
(selectRandom ["I_UAV_01_F","Epoch_Sapper_F"]) call EPOCH_unitSpawnIncrease;
};
// Nuisance System 0.1
(EPOCH_customVarLimits select (EPOCH_customVars find "Nuisance")) params [["_playerLimitMax",100],["_playerLimitMin",0]];
EPOCH_playerNuisance = ((EPOCH_playerNuisance + _nuisanceLevel) min _playerLimitMax) max _playerLimitMin;
}; };
}; };

View File

@ -45,7 +45,6 @@ if !(EPOCH_playerEnergy isEqualTo _prevEnergy) then {
_display3 = uiNamespace getVariable "EPOCH_EpochGameUI3"; _display3 = uiNamespace getVariable "EPOCH_EpochGameUI3";
_energyDiff = round(EPOCH_playerEnergy - _prevEnergy); _energyDiff = round(EPOCH_playerEnergy - _prevEnergy);
_diffText = if (_energyDiff > 0) then {format["+%1",_energyDiff]} else {format["%1",_energyDiff]}; _diffText = if (_energyDiff > 0) then {format["+%1",_energyDiff]} else {format["%1",_energyDiff]};
// hint str [_energyValue,_prevEnergy,EPOCH_playerEnergy];
(_display3 displayCtrl 21210) ctrlSetText format["%1/%2 %3", round(EPOCH_playerEnergy), EPOCH_playerEnergyMax, _diffText]; (_display3 displayCtrl 21210) ctrlSetText format["%1/%2 %3", round(EPOCH_playerEnergy), EPOCH_playerEnergyMax, _diffText];
_prevEnergy = EPOCH_playerEnergy; _prevEnergy = EPOCH_playerEnergy;
}; };
@ -67,7 +66,6 @@ if !(_attackers isEqualTo[]) then {
(_attackers select 0) call EPOCH_client_bitePlayer; (_attackers select 0) call EPOCH_client_bitePlayer;
_panic = true; _panic = true;
} else { } else {
// custom poision
_toxicObjs = player nearobjects["SmokeShellCustom", 6]; _toxicObjs = player nearobjects["SmokeShellCustom", 6];
if!(_toxicObjs IsEqualTo[]) then { if!(_toxicObjs IsEqualTo[]) then {
(_toxicObjs select 0) call EPOCH_client_bitePlayer; (_toxicObjs select 0) call EPOCH_client_bitePlayer;
@ -95,3 +93,7 @@ EPOCH_playerThirst = (EPOCH_playerThirst - _HTlossRate) max 0;
call _lootBubble; call _lootBubble;
EPOCH_playerStaminaMax = (100 * (round(EPOCH_playerAliveTime/360)/10)) min 2500; EPOCH_playerStaminaMax = (100 * (round(EPOCH_playerAliveTime/360)/10)) min 2500;
// downtick Nuisance
(EPOCH_customVarLimits select (EPOCH_customVars find "Nuisance")) params [["_playerLimitMax",100],["_playerLimitMin",0]];
EPOCH_playerNuisance = ((EPOCH_playerNuisance - 1) min _playerLimitMax) max _playerLimitMin;

View File

@ -1,11 +1,4 @@
_nearByBobbersLocal = []; _nearByBobbersLocal = (player nearEntities[["Bobber_EPOCH"], 12]) select {local _x};
_nearByBobbers = player nearEntities[["Bobber_EPOCH"], 12];
{
if (local _x) then {
_nearByBobbersLocal pushBack _x
}
} forEach _nearByBobbers;
if !(_nearByBobbersLocal isEqualTo []) then { if !(_nearByBobbersLocal isEqualTo []) then {
if ((random 100) < 50) then { if ((random 100) < 50) then {
_bobber = selectRandom _nearByBobbersLocal; _bobber = selectRandom _nearByBobbersLocal;

View File

@ -54,6 +54,7 @@ EPOCH_soundLevel = 1;
EPOCH_arr_interactedObjs = []; EPOCH_arr_interactedObjs = [];
EPOCH_buildOption = 0; EPOCH_buildOption = 0;
EPOCH_nearestLocations = []; EPOCH_nearestLocations = [];
EPOCH_lastFiredLocation = [];
["EPOCH_onEachFrame", "onEachFrame", EPOCH_onEachFrame] call BIS_fnc_addStackedEventHandler; ["EPOCH_onEachFrame", "onEachFrame", EPOCH_onEachFrame] call BIS_fnc_addStackedEventHandler;

View File

@ -51,7 +51,8 @@ class CfgEpochClient
{"SpawnArray",{},{}}, {"SpawnArray",{},{}},
{"Karma",0,{50000,-50000}}, {"Karma",0,{50000,-50000}},
{"Alcohol",0,{100,0}}, {"Alcohol",0,{100,0}},
{"Radiation",0,{100,0}} {"Radiation",0,{100,0}},
{"Nuisance",0,{100,0}}
}; };
// controls max group limit and cost // controls max group limit and cost
group_upgrade_lvl[] = {4,"100",6,"300",8,"500",10,"1000",12,"1500",13,"1750",14,"2000",15,"3000",16,"5000"}; group_upgrade_lvl[] = {4,"100",6,"300",8,"500",10,"1000",12,"1500",13,"1750",14,"2000",15,"3000",16,"5000"};

View File

@ -1 +1 @@
build=456; build=465;

View File

@ -1 +1 @@
build=456; build=465;

View File

@ -54,6 +54,7 @@ if (isNil "_instanceID") exitWith{
EPOCH_modCUPWeaponsEnabled = (getNumber (configFile >> "CfgPatches" >> "CUP_WheeledVehicles_Core" >> "requiredVersion") > 0); EPOCH_modCUPWeaponsEnabled = (getNumber (configFile >> "CfgPatches" >> "CUP_WheeledVehicles_Core" >> "requiredVersion") > 0);
EPOCH_modCUPVehiclesEnabled = (getNumber (configFile >> "CfgPatches" >> "CUP_Weapons_WeaponsCore" >> "requiredVersion") > 0); EPOCH_modCUPVehiclesEnabled = (getNumber (configFile >> "CfgPatches" >> "CUP_Weapons_WeaponsCore" >> "requiredVersion") > 0);
EPOCH_mod_Ryanzombies_Enabled = (parseNumber (getText (configFile >> "CfgPatches" >> "Ryanzombies" >> "version")) >= 4.2);
if (EPOCH_modCUPWeaponsEnabled) then { if (EPOCH_modCUPWeaponsEnabled) then {
diag_log "Epoch: CUP Weapons detected"; diag_log "Epoch: CUP Weapons detected";
@ -61,6 +62,9 @@ if (EPOCH_modCUPWeaponsEnabled) then {
if (EPOCH_modCUPVehiclesEnabled) then { if (EPOCH_modCUPVehiclesEnabled) then {
diag_log "Epoch: CUP Vehicles detected"; diag_log "Epoch: CUP Vehicles detected";
}; };
if (EPOCH_mod_Ryanzombies_Enabled) then {
diag_log "Epoch: Ryanzombies detected";
};
diag_log "Epoch: Init Variables"; diag_log "Epoch: Init Variables";
call compile preprocessFileLineNumbers "\epoch_server\init\server_variables.sqf"; call compile preprocessFileLineNumbers "\epoch_server\init\server_variables.sqf";

View File

@ -1 +1 @@
build=456; build=465;

View File

@ -1 +1 @@
build=456; build=465;

Binary file not shown.

View File

@ -5,18 +5,22 @@
# <arguments /> # <arguments />
# <extractdir>%TEMP%</extractdir> # <extractdir>%TEMP%</extractdir>
# <files /> # <files />
# <usedefaulticon>true</usedefaulticon> # <usedefaulticon>false</usedefaulticon>
# <icon>F:\ARCHIVE\Downloads\logo_only_1024.ico</icon>
# <showinsystray>false</showinsystray> # <showinsystray>false</showinsystray>
# <tooltip>Epoch Mod PBO Packer</tooltip>
# <altcreds>false</altcreds> # <altcreds>false</altcreds>
# <efs>true</efs> # <efs>true</efs>
# <ntfs>true</ntfs> # <ntfs>true</ntfs>
# <local>false</local> # <local>false</local>
# <abortonfail>true</abortonfail> # <abortonfail>true</abortonfail>
# <product /> # <product>Epoch PBO Packing Tool</product>
# <internalname>Epoch PBO Packing Tool </internalname>
# <version>1.0.0.1</version> # <version>1.0.0.1</version>
# <versionstring /> # <versionstring>1.0</versionstring>
# <comments /> # <description>Tool to aid in the packing of Epoch Mod source files</description>
# <company /> # <comments>By Raimonds Virtoss and Aaron Clark</comments>
# <company>EpochMod.com</company>
# <includeinterpreter>false</includeinterpreter> # <includeinterpreter>false</includeinterpreter>
# <forcecomregistration>false</forcecomregistration> # <forcecomregistration>false</forcecomregistration>
# <consolemode>false</consolemode> # <consolemode>false</consolemode>
@ -65,7 +69,7 @@ $Label4.Anchor = ([System.Windows.Forms.AnchorStyles]([System.Windows.Forms.Anch
$Label4.Location = New-Object System.Drawing.Point(12, 9) $Label4.Location = New-Object System.Drawing.Point(12, 9)
$Label4.Size = New-Object System.Drawing.Size(808, 18) $Label4.Size = New-Object System.Drawing.Size(808, 18)
$Label4.TabIndex = 1 $Label4.TabIndex = 1
$Label4.Text = "Why do farts smell? So deaf people can enjoy them too." $Label4.Text = ""
$Label4.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter $Label4.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
$Label4.add_Click({Label4Click($Label4)}) $Label4.add_Click({Label4Click($Label4)})
#~~< TabControl1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #~~< TabControl1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -158,11 +162,25 @@ $TabPage2.Size = New-Object System.Drawing.Size(800, 503)
$TabPage2.TabIndex = 1 $TabPage2.TabIndex = 1
$TabPage2.Text = "Settings" $TabPage2.Text = "Settings"
$TabPage2.BackColor = [System.Drawing.SystemColors]::Control $TabPage2.BackColor = [System.Drawing.SystemColors]::Control
#~~< Label19 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Label19 = New-Object System.Windows.Forms.Label
$Label19.Location = New-Object System.Drawing.Point(7, 372)
$Label19.Size = New-Object System.Drawing.Size(145, 14)
$Label19.TabIndex = 38
$Label19.Text = "BIPrivatekey Location:"
#~~< TextBox13 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$TextBox13 = New-Object System.Windows.Forms.TextBox
$TextBox13.Location = New-Object System.Drawing.Point(139, 349)
$TextBox13.ReadOnly = $true
$TextBox13.Size = New-Object System.Drawing.Size(96, 20)
$TextBox13.TabIndex = 33
$TextBox13.Text = ""
$TextBox13.add_TextChanged({TextBox13TextChanged($TextBox13)})
#~~< Label18 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #~~< Label18 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Label18 = New-Object System.Windows.Forms.Label $Label18 = New-Object System.Windows.Forms.Label
$Label18.Font = New-Object System.Drawing.Font("Microsoft Sans Serif", 14.25, [System.Drawing.FontStyle]::Bold, [System.Drawing.GraphicsUnit]::Point, ([System.Byte](0))) $Label18.Font = New-Object System.Drawing.Font("Stencil Std", 12.0, [System.Drawing.FontStyle]::Bold, [System.Drawing.GraphicsUnit]::Point, ([System.Byte](0)))
$Label18.Location = New-Object System.Drawing.Point(270, 225) $Label18.Location = New-Object System.Drawing.Point(6, 223)
$Label18.Size = New-Object System.Drawing.Size(179, 29) $Label18.Size = New-Object System.Drawing.Size(235, 29)
$Label18.TabIndex = 37 $Label18.TabIndex = 37
$Label18.Text = "Sign File Settings" $Label18.Text = "Sign File Settings"
$Label18.add_Click({Label18Click($Label18)}) $Label18.add_Click({Label18Click($Label18)})
@ -171,8 +189,22 @@ $Label16 = New-Object System.Windows.Forms.Label
$Label16.Location = New-Object System.Drawing.Point(6, 292) $Label16.Location = New-Object System.Drawing.Point(6, 292)
$Label16.Size = New-Object System.Drawing.Size(643, 14) $Label16.Size = New-Object System.Drawing.Size(643, 14)
$Label16.TabIndex = 34 $Label16.TabIndex = 34
$Label16.Text = "Path to Arma 3 Tools (DSSignFile) biprivatekey:" $Label16.Text = "Path to Arma 3 Tools (DSCreateKey):"
$Label16.add_Click({Label16Click($Label16)}) $Label16.add_Click({Label16Click($Label16)})
#~~< Label15 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Label15 = New-Object System.Windows.Forms.Label
$Label15.Location = New-Object System.Drawing.Point(139, 332)
$Label15.Size = New-Object System.Drawing.Size(145, 14)
$Label15.TabIndex = 32
$Label15.Text = "Sign Version:"
$Label15.add_Click({Label15Click($Label15)})
#~~< Label13 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Label13 = New-Object System.Windows.Forms.Label
$Label13.Location = New-Object System.Drawing.Point(6, 386)
$Label13.Size = New-Object System.Drawing.Size(785, 15)
$Label13.TabIndex = 29
$Label13.Text = ""
$Label13.add_Click({Label13Click($Label13)})
#~~< Label17 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #~~< Label17 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Label17 = New-Object System.Windows.Forms.Label $Label17 = New-Object System.Windows.Forms.Label
$Label17.Location = New-Object System.Drawing.Point(6, 252) $Label17.Location = New-Object System.Drawing.Point(6, 252)
@ -349,8 +381,12 @@ $TextBox1.Location = New-Object System.Drawing.Point(6, 21)
$TextBox1.Size = New-Object System.Drawing.Size(726, 20) $TextBox1.Size = New-Object System.Drawing.Size(726, 20)
$TextBox1.TabIndex = 0 $TextBox1.TabIndex = 0
$TextBox1.Text = "" $TextBox1.Text = ""
$TabPage2.Controls.Add($Label19)
$TabPage2.Controls.Add($TextBox13)
$TabPage2.Controls.Add($Label18) $TabPage2.Controls.Add($Label18)
$TabPage2.Controls.Add($Label16) $TabPage2.Controls.Add($Label16)
$TabPage2.Controls.Add($Label15)
$TabPage2.Controls.Add($Label13)
$TabPage2.Controls.Add($Label17) $TabPage2.Controls.Add($Label17)
$TabPage2.Controls.Add($Button17) $TabPage2.Controls.Add($Button17)
$TabPage2.Controls.Add($Label14) $TabPage2.Controls.Add($Label14)
@ -385,27 +421,6 @@ $TabPage3.Size = New-Object System.Drawing.Size(800, 503)
$TabPage3.TabIndex = 2 $TabPage3.TabIndex = 2
$TabPage3.Text = "Developers" $TabPage3.Text = "Developers"
$TabPage3.BackColor = [System.Drawing.SystemColors]::Control $TabPage3.BackColor = [System.Drawing.SystemColors]::Control
#~~< TextBox13 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$TextBox13 = New-Object System.Windows.Forms.TextBox
$TextBox13.Location = New-Object System.Drawing.Point(6, 133)
$TextBox13.Size = New-Object System.Drawing.Size(96, 20)
$TextBox13.TabIndex = 33
$TextBox13.Text = ""
$TextBox13.add_TextChanged({TextBox13TextChanged($TextBox13)})
#~~< Label15 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Label15 = New-Object System.Windows.Forms.Label
$Label15.Location = New-Object System.Drawing.Point(6, 115)
$Label15.Size = New-Object System.Drawing.Size(145, 14)
$Label15.TabIndex = 32
$Label15.Text = "Sign Version:"
$Label15.add_Click({Label15Click($Label15)})
#~~< Label13 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Label13 = New-Object System.Windows.Forms.Label
$Label13.Location = New-Object System.Drawing.Point(6, 397)
$Label13.Size = New-Object System.Drawing.Size(785, 15)
$Label13.TabIndex = 29
$Label13.Text = ""
$Label13.add_Click({Label13Click($Label13)})
#~~< Button15 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #~~< Button15 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Button15 = New-Object System.Windows.Forms.Button $Button15 = New-Object System.Windows.Forms.Button
$Button15.Location = New-Object System.Drawing.Point(6, 240) $Button15.Location = New-Object System.Drawing.Point(6, 240)
@ -503,9 +518,6 @@ $Button4.Size = New-Object System.Drawing.Size(54, 21)
$Button4.TabIndex = 13 $Button4.TabIndex = 13
$Button4.Text = "Browse" $Button4.Text = "Browse"
$Button4.UseVisualStyleBackColor = $true $Button4.UseVisualStyleBackColor = $true
$TabPage3.Controls.Add($TextBox13)
$TabPage3.Controls.Add($Label15)
$TabPage3.Controls.Add($Label13)
$TabPage3.Controls.Add($Button15) $TabPage3.Controls.Add($Button15)
$TabPage3.Controls.Add($Button12) $TabPage3.Controls.Add($Button12)
$TabPage3.Controls.Add($Label6) $TabPage3.Controls.Add($Label6)
@ -564,6 +576,8 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
# Defines # Defines
$Label4.Text = Get-Random -InputObject "Bug? That's not a bug, that's a feature.", "A bug in the code is worth two in the documentation."
$ListView1.CheckBoxes = $true $ListView1.CheckBoxes = $true
$FolderBrowserDialog1.ShowNewFolderButton = $false $FolderBrowserDialog1.ShowNewFolderButton = $false
$TextBox1.Text = "Arma 3 not found" $TextBox1.Text = "Arma 3 not found"
@ -694,11 +708,34 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$p6 = Join-Path $Textbox4.Text "\version.txt" $p6 = Join-Path $Textbox4.Text "\version.txt"
$p7 = Join-Path $Textbox4.Text "\build.txt" $p7 = Join-Path $Textbox4.Text "\build.txt"
$p8 = Join-Path $Textbox2.Text "\build.txt" $p8 = Join-Path $Textbox2.Text "\build.txt"
$p9 = Join-Path $Textbox4.Text "\version_int.txt"
$Textbox6.Text = if (Test-Path $p6) { Get-Content $p6 } else { "Path not set" } $Textbox6.Text = if (Test-Path $p6) { Get-Content $p6 } else { "Path not set" }
$Textbox7.Text = if (Test-Path $p7) { Get-Content $p7 } else { "Path not set" } $Textbox7.Text = if (Test-Path $p7) { Get-Content $p7 } else { "Path not set" }
$Textbox8.Text = if (Test-Path $p8) { Get-Content $p8 } else { "Path not set" } $Textbox8.Text = if (Test-Path $p8) { Get-Content $p8 } else { "Path not set" }
$Textbox13.Text = if (Test-Path $p9) { Get-Content $p9 } else { "Path not set" } $Textbox13.Text = if (Test-Path $p6) { (Get-Content $p6) -replace '[.]','' } else { "" }
}
function fnc_updateBuildNumber($inpath, $outpath, $increment)
{
if ($Checkbox1.Checked)
{
$path = Join-Path $inpath "\build.txt"
if (Test-Path $path)
{
$in = Get-Content $path
$newBuild = [int]$in + $increment
$Out = @(
'build=' + [string]$newBuild + ';'
)
$Out | Out-File(Join-Path $outpath "\build.hpp") -Encoding "UTF8"
$newBuild | Out-File $path -Encoding "UTF8"
if ($increment -eq 1)
{
fnc_reloadVersions
}
}
}
} }
function fnc_updateVersions function fnc_updateVersions
@ -706,7 +743,6 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$p6 = Join-Path $Textbox4.Text "\version.txt" $p6 = Join-Path $Textbox4.Text "\version.txt"
$p7 = Join-Path $Textbox4.Text "\build.txt" $p7 = Join-Path $Textbox4.Text "\build.txt"
$p8 = Join-Path $Textbox2.Text "\build.txt" $p8 = Join-Path $Textbox2.Text "\build.txt"
$p9 = Join-Path $Textbox4.Text "\version_int.txt"
if (($Textbox6.Text -ne "Path not set") -and (Test-Path $p6)) if (($Textbox6.Text -ne "Path not set") -and (Test-Path $p6))
{ {
@ -720,10 +756,6 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
{ {
$TextBox8.Text | Out-File $p8 -Encoding "UTF8" $TextBox8.Text | Out-File $p8 -Encoding "UTF8"
} }
if (($Textbox9.Text -ne "Path not set") -and (Test-Path $p9))
{
$TextBox9.Text | Out-File $p9 -Encoding "UTF8"
}
} }
function fnc_getSetPath($switch) function fnc_getSetPath($switch)
@ -842,10 +874,14 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$TextBox7.Enabled = $cbstate $TextBox7.Enabled = $cbstate
$TextBox8.Enabled = $cbstate $TextBox8.Enabled = $cbstate
$TextBox13.Enabled = $cbstate $TextBox13.Enabled = $cbstate
$TextBox11.Enabled = $cbstate
$TextBoxPboPrefix.Enabled = $cbstate
$TextBoxBISignPrefix.Enabled = $cbstate
$Button4.Enabled = $cbstate $Button4.Enabled = $cbstate
$Button15.Enabled = $cbstate $Button15.Enabled = $cbstate
$Button12.Enabled = $cbstate $Button12.Enabled = $cbstate
$Button17.Enabled = $cbstate
$ComboBox1.Enabled = $cbstate $ComboBox1.Enabled = $cbstate
@ -853,6 +889,21 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
fnc_populateListView fnc_populateListView
} }
function fnc_outputmodcpp
{
$Output = Join-Path $TextBox1.Text $ComboBox1.SelectedItem
$Out = @(
'dir = "@Epoch";'
'name = "Epoch Mod ' + $Textbox6.Text + '";'
'actionName = "Website";'
'picture = "mod.paa";'
'action = "http://www.epochmod.com";'
'overview = "Open world survival mod set in the year 2035, Just two years after the mass extinction of billions of people. Those that remain are left with remnants of a once technological society. Try to survive, build, or explore your way through the harsh dynamic environment.";'
)
$Out | Out-File (Join-Path $Output "mod.cpp")
}
function fnc_settingsSave function fnc_settingsSave
{ {
$Out = @( $Out = @(
@ -903,13 +954,15 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
function fnc_CreatePBO function fnc_CreatePBO
{ {
# #
$signName = ($TextBox12.Text + $TextBox13.Text) $signName = ($TextBoxBISignPrefix.Text + $TextBox13.Text)
$signFileName = ($signName + ".biprivatekey") $signFileName = ($signName + ".biprivatekey")
$signfile = Join-Path $TextBox11.Text $signFileName $signfile = Join-Path $TextBox11.Text $signFileName
# make privatekey if it does not exist # make privatekey if it does not exist
if (!(Test-Path $signfile)) { if (!(Test-Path $signfile))
{
$createKeyExecutable = Join-Path $TextBox11.Text "DSCreateKey.exe" $createKeyExecutable = Join-Path $TextBox11.Text "DSCreateKey.exe"
$argz = @($signName) $argz = @($signName)
Start-Process -FilePath $createKeyExecutable -WorkingDirectory $TextBox11.Text -ArgumentList $argz -WindowStyle Minimized -Wait Start-Process -FilePath $createKeyExecutable -WorkingDirectory $TextBox11.Text -ArgumentList $argz -WindowStyle Minimized -Wait
@ -917,6 +970,13 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$Label4.Refresh() $Label4.Refresh()
} }
fnc_outputmodcpp
# increase build numbers
$incrementClientBuild = 1
$incrementServerBuild = 1
$Bob = Join-Path $TextBox3.Text "\AddonBuilder.exe" $Bob = Join-Path $TextBox3.Text "\AddonBuilder.exe"
$includes = "P:\includes.txt" $includes = "P:\includes.txt"
if (!(Test-Path $includes)) { "*.xml;*.pac;*.paa;*.sqf;*.sqs;*.bikb;*.fsm;*.wss;*.ogg;*.wav;*.fxy;*.csv;*.html;*.lip;*.txt;*.wrp;*.bisurf;*.rvmat;*.sqm;*.ext;*.hpp" | Out-File $includes -Encoding "UTF8"} if (!(Test-Path $includes)) { "*.xml;*.pac;*.paa;*.sqf;*.sqs;*.bikb;*.fsm;*.wss;*.ogg;*.wav;*.fxy;*.csv;*.html;*.lip;*.txt;*.wrp;*.bisurf;*.rvmat;*.sqm;*.ext;*.hpp" | Out-File $includes -Encoding "UTF8"}
@ -944,7 +1004,13 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse } if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse }
Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse
$argz = @($tmp, ( '"' + $Output + '"' ), "-packonly", "-clear", "-prefix=$name", "-project=$tmp", "-include=$includes") fnc_updateBuildNumber $TextBox2.Text ($x.subitems[1].Text) $incrementServerBuild
$incrementServerBuild = 0
$argz = @($tmp, ( '"' + $Output + '"' ), "-packonly", "-clear", "-prefix=$name", "-project=P:\", "-include=$includes")
$Label4.Text = "Building Server PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait"
$Label4.Refresh()
Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Minimized -Wait Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Minimized -Wait
} }
@ -953,6 +1019,9 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$name = Join-Path $TextBoxPboPrefix.Text $name $name = Join-Path $TextBoxPboPrefix.Text $name
$tmp = "P:\$name" $tmp = "P:\$name"
fnc_updateBuildNumber $TextBox4.Text ($x.subitems[1].Text) $incrementClientBuild
$incrementClientBuild = 0
$Output = $TextBox1.Text + "\" + $ComboBox1.SelectedItem + "\Addons" $Output = $TextBox1.Text + "\" + $ComboBox1.SelectedItem + "\Addons"
if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse } if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse }
Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse
@ -960,8 +1029,10 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$signFlag = "" $signFlag = ""
if (Test-Path $signfile) { $signFlag = ('-sign="' + $signfile + '"') } if (Test-Path $signfile) { $signFlag = ('-sign="' + $signfile + '"') }
$argz = @($tmp, ( '"' + $Output + '"' ), "-clear", "-prefix=$name", "-project=P:\", "-include=$includes", $signFlag)
$argz = @($tmp, ( '"' + $Output + '"' ), "-clear", "-prefix=$name", "-project=$tmp", "-include=$includes", $signFlag) $Label4.Text = "Building Client PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait"
$Label4.Refresh()
Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Minimized -Wait Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Minimized -Wait
} }
@ -970,6 +1041,9 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$Output = $TextBox9.Text $Output = $TextBox9.Text
$src = $TextBox2.Text + "\Sources\" $src = $TextBox2.Text + "\Sources\"
fnc_updateBuildNumber $TextBox2.Text ($src + "epoch_config") $incrementServerBuild
$incrementServerBuild = 0
if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse } if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse }
Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse
Copy-Item($src + "epoch_code") -Destination $tmp -Recurse Copy-Item($src + "epoch_code") -Destination $tmp -Recurse
@ -978,6 +1052,9 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$argz = @($tmp, ( '"' + $Output + '"' ), "-clear", "-prefix=\", "-project=P:\", "-include=$includes") $argz = @($tmp, ( '"' + $Output + '"' ), "-clear", "-prefix=\", "-project=P:\", "-include=$includes")
$Label4.Text = "Building MPMission PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait"
$Label4.Refresh()
Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Minimized -Wait Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Minimized -Wait
} }
} }
@ -1041,12 +1118,20 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
fnc_reloadVersions fnc_reloadVersions
$signName = ($TextBox12.Text + $TextBox13.Text) $signName = ($TextBoxBISignPrefix.Text + $TextBox13.Text)
$signFileName = ($signName + ".biprivatekey") $signFileName = ($signName + ".biprivatekey")
$signfile = Join-Path $TextBox11.Text $signFileName $signfile = Join-Path $TextBox11.Text $signFileName
$signFlag = "" $signFlag = ""
if (Test-Path $signfile) { $signFlag = "-sign= '$signfile'" } if (Test-Path $signfile) {
$Label13.Text = $signFlag; $Label13.Text = $signfile
$signFlag = ('-sign="' + $signfile + '"')
}
else
{
$Label13.Text = "Path Not Found!"
}
#endregion #endregion
@ -1114,8 +1199,9 @@ Main # This call must remain below all other event functions
# #
# Script Information # Script Information
# #
# Title: Epoch PBO Packing Tool # Title: Epoch PBO Packing Tool - EpochMod.com
# Author: Raimonds Virtoss - Raymix @ Epoch UI code # Author: Raimonds Virtoss - Raymix @ Epoch UI code
# Contributors: Aaron Clark - [VB]AWOL
# Originally created: 4/24/2016 - 17:56:19 # Originally created: 4/24/2016 - 17:56:19
# Description: Form based (GUI) Tool to Pack or binarize Epoch PBOs. Scans your github repos and automatically creates a list of relevant folders for packaging # Description: Form based (GUI) Tool to Pack or binarize Epoch PBOs. Scans your github repos and automatically creates a list of relevant folders for packaging
# Usage: .EXE file will be provided when script is done, for now simply right click it and run with powershell. # Usage: .EXE file will be provided when script is done, for now simply right click it and run with powershell.

View File

@ -1 +1 @@
456 465