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

@ -1,149 +1,123 @@
/*
Author: Aaron Clark - EpochMod.com
Author: Aaron Clark - EpochMod.com
Contributors:
Contributors:
Description:
Epoch Change wall state
Description:
Epoch Change wall state
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_code/compile/building/EPOCH_changeWallState.sqf
Github:
https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_code/compile/building/EPOCH_changeWallState.sqf
Example:
[_this,"NWall",1] call EPOCH_changeWallState;
Example:
[_this,"NWall",1] call EPOCH_changeWallState;
Parameter(s):
_this select 0: OBJECT - Base building object
_this select 1: STRING - Name of animation
_this select 1: SCALAR - state
0: true = add wall
1: false = remove wall
Parameter(s):
_this select 0: OBJECT - Base building object
_this select 1: STRING - Name of animation
_this select 1: SCALAR - state
0: true = add wall
1: false = remove wall
Returns:
NOTHING
Returns:
NOTHING
*/
private ["_recipeItem","_recipeQty","_hasRecipeItems","_msg","_recipeCount","_currentCount","_numRemoved","_items","_mags","_recipe","_craftItem","_craftQty","_config","_objClass"];
params [
["_object",objNull],
["_anim",""],
["_state",0]
private["_recipeItem", "_recipeQty", "_hasRecipeItems", "_msg", "_recipeCount", "_currentCount", "_numRemoved", "_items", "_mags", "_recipe", "_craftItem", "_craftQty", "_config", "_objClass"];
params[
["_object", objNull],
["_anim", ""],
["_state", 0]
];
if !(isNull _object) then {
_msg = "Missing Items";
// Get config
_config = 'CfgBaseBuilding' call EPOCH_returnConfig;
// upgradeBuildingPart
_objClass = typeOf _object;
// Add part
if (_state == 1) then {
_recipe = getArray(_config >> _objClass >> "upgradeBuildingPart");
_mags = magazines player;
_recipeCount = 0;
_numRemoved = 0;
_hasRecipeItems = true;
// Dry Run
{
_recipeItem = _x;
_recipeQty = 1;
if (_x isEqualType []) then {
_recipeItem = _x select 0;
_recipeQty = _x select 1;
};
_recipeCount = _recipeCount + _recipeQty;
_currentCount = { _x == _recipeItem } count _mags;
if (_currentCount < _recipeQty) exitWith {
_hasRecipeItems = false;
_msg = format["Need %2 %1 Have %3", _recipeItem call EPOCH_itemDisplayName,_recipeCount ,_currentCount];
};
}forEach _recipe;
// remove item
if (_hasRecipeItems) then {
{
_recipeItem = _x;
_recipeQty = 1;
if (_x isEqualType []) then {
_recipeItem = _x select 0;
_recipeQty = _x select 1;
};
if ([_recipeItem, "CfgWeapons"] call EPOCH_fnc_isAny) then {
_items = items player;
_currentCount = { _x == _recipeItem } count _items;
if (_currentCount >= _recipeQty) then {
for "_i" from 1 to _recipeQty do {
if (_recipeItem in _items) then {
player removeItem _recipeItem;
_numRemoved = _numRemoved + 1;
};
};
};
} else {
_mags = magazines player;
_currentCount = { _x == _recipeItem } count _mags;
if (_currentCount >= _recipeQty) then {
for "_i" from 1 to _recipeQty do {
if (_recipeItem in _mags) then {
player removeMagazine _recipeItem;
_numRemoved = _numRemoved + 1;
};
};
};
};
}forEach _recipe;
};
if (_numRemoved == _recipeCount) then {
_object animate [_anim, _state, true];
// push interacted object to queue to save later
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;
} else {
[format["<t size='1.6' color='#99ffffff'>%1</t>", _msg], 5] call Epoch_dynamicText;
};
} else {
// Remove part
_recipe = getArray(_config >> _objClass >> "removeBuildingPart");
_object animate [_anim, _state, true];
// push interacted object to save queue to save later
EPOCH_arr_interactedObjs pushBackUnique _object;
{
_craftItem = _x;
_craftQty = 1;
if (_x isEqualType []) then {
_craftItem = _x select 0;
_craftQty = _x select 1;
};
for "_i" from 1 to _craftQty do {
_craftItem call EPOCH_fnc_addItemOverflow;
};
}forEach _recipe;
[format["<t size='1.6' color='#99ffffff'>%1 part on %2</t>","Removed",_objClass call EPOCH_itemDisplayName], 5] call Epoch_dynamicText;
};
if !(isNull _object) then{
_msg = "Missing Items";
// Get config
_config = 'CfgBaseBuilding' call EPOCH_returnConfig;
// upgradeBuildingPart
_objClass = typeOf _object;
// Add part
if (_state == 1) then{
_recipe = getArray(_config >> _objClass >> "upgradeBuildingPart");
_mags = magazines player;
_recipeCount = 0;
_numRemoved = 0;
_hasRecipeItems = true;
// Dry Run
{
_recipeItem = _x;
_recipeQty = 1;
if (_x isEqualType[]) then{
_recipeItem = _x select 0;
_recipeQty = _x select 1;
};
_recipeCount = _recipeCount + _recipeQty;
_currentCount = { _x == _recipeItem } count _mags;
if (_currentCount < _recipeQty) exitWith{
_hasRecipeItems = false;
_msg = format["Need %2 %1 Have %3", _recipeItem call EPOCH_itemDisplayName, _recipeCount, _currentCount];
};
}forEach _recipe;
// remove item
if (_hasRecipeItems) then{
{
_recipeItem = _x;
_recipeQty = 1;
if (_x isEqualType[]) then{
_recipeItem = _x select 0;
_recipeQty = _x select 1;
};
if ([_recipeItem, "CfgWeapons"] call EPOCH_fnc_isAny) then{
_items = items player;
_currentCount = { _x == _recipeItem } count _items;
if (_currentCount >= _recipeQty) then{
for "_i" from 1 to _recipeQty do {
if (_recipeItem in _items) then{
player removeItem _recipeItem;
_numRemoved = _numRemoved + 1;
};
};
};
} else {
_mags = magazines player;
_currentCount = { _x == _recipeItem } count _mags;
if (_currentCount >= _recipeQty) then{
for "_i" from 1 to _recipeQty do {
if (_recipeItem in _mags) then{
player removeMagazine _recipeItem;
_numRemoved = _numRemoved + 1;
};
};
};
};
}forEach _recipe;
};
if (_numRemoved == _recipeCount) then{
_object animate[_anim, _state, true];
// push interacted object to queue to save later
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;
} else {
[format["<t size='1.6' color='#99ffffff'>%1</t>", _msg], 5] call Epoch_dynamicText;
};
} else {
// Remove part
_recipe = getArray(_config >> _objClass >> "removeBuildingPart");
_object animate[_anim, _state, true];
// push interacted object to save queue to save later
EPOCH_arr_interactedObjs pushBackUnique _object;
{
_craftItem = _x;
_craftQty = 1;
if (_x isEqualType[]) then{
_craftItem = _x select 0;
_craftQty = _x select 1;
};
for "_i" from 1 to _craftQty do {
_craftItem call EPOCH_fnc_addItemOverflow;
};
}forEach _recipe;
[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;
};
if (_isSnap && _distance < 5) then {
_pos2 = _snapPosition;
if (!surfaceIsWater _pos2) then {
_pos2 = ATLtoASL _pos2;
};
_pos2 = AGLToASL _snapPosition;
_vel2 = (velocity _nearestObject);
_direction = getDir _nearestObject;
if (_snapType == "perp") then {

View File

@ -27,23 +27,21 @@
Returns:
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"];
EPOCH_lastFiredLocation = getPosATL player;
switch true do {
case (_ammo isKindOf "B_EnergyPack"): {
if (!isNull cursorTarget) then {
_cursorTarget = cursorTarget;
_repaired = false;
if ((player distance _cursorTarget) <= 6) then {
_attachments = handgunItems player;
_heal = false;
if (_cursorTarget isKindOf "Man") then {
if ("Heal_EPOCH" in _attachments) then {
_heal = true;
};
if ("Defib_EPOCH" in _attachments) then {
if (!alive _cursorTarget) then {
[_cursorTarget,player,Epoch_personalToken] remoteExec ["EPOCH_server_revivePlayer",2];
@ -65,11 +63,8 @@ switch true do {
_currentHIT = _forEachIndex;
};
}forEach((getAllHitPointsDamage _cursorTarget) param[2,[]]);
if (_highestDMG > 0) then {
_newDMG = ((_highestDMG - 0.5) max 0);
if (local _cursorTarget) then {
[_cursorTarget,[_currentHIT,_newDMG]] call EPOCH_client_repairVehicle;
} else {
@ -84,13 +79,11 @@ switch true do {
};
};
};
case (_ammo isKindOf "B_Hatchet"): {
_gesture = selectRandom ["GestureSwing0", "GestureSwing1", "GestureSwing2"];
player playActionNow _gesture;
call EPOCH_chopWood;
};
case (_ammo isKindOf "B_Swing" || _ammo isKindOf "B_Stick") : {
player playActionNow "SledgeSwing";
call EPOCH_mineRocks;
@ -101,23 +94,26 @@ switch true do {
call EPOCH_fish;
};
};
case (_ammo isKindOf "ChainSaw_Bullet"): {
call EPOCH_chopWood;
};
default {
_droneChance = 2;
if !(EPOCH_nearestLocations isEqualTo[]) then{
_droneChance = _droneChance * 2;
_ammoConfig = (configFile >> "CfgAmmo" >> _ammo);
_nuisanceLevel = ceil(getNumber (_ammoConfig >> "audibleFire") * getNumber (_ammoConfig >> "caliber"));
// 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{
_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

@ -20,7 +20,7 @@ if (damage player != _damagePlayer) then {
_energyValue = EPOCH_chargeRate min _energyRegenMax;
_vehicle = vehicle player;
if (_vehicle != player && isEngineOn _vehicle) then {
_energyValue = _energyValue + 5;
_energyValue = _energyValue + 5;
};
if (currentVisionMode player == 1) then { //NV enabled
@ -45,7 +45,6 @@ if !(EPOCH_playerEnergy isEqualTo _prevEnergy) then {
_display3 = uiNamespace getVariable "EPOCH_EpochGameUI3";
_energyDiff = round(EPOCH_playerEnergy - _prevEnergy);
_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];
_prevEnergy = EPOCH_playerEnergy;
};
@ -67,7 +66,6 @@ if !(_attackers isEqualTo[]) then {
(_attackers select 0) call EPOCH_client_bitePlayer;
_panic = true;
} else {
// custom poision
_toxicObjs = player nearobjects["SmokeShellCustom", 6];
if!(_toxicObjs IsEqualTo[]) then {
(_toxicObjs select 0) call EPOCH_client_bitePlayer;
@ -95,3 +93,7 @@ EPOCH_playerThirst = (EPOCH_playerThirst - _HTlossRate) max 0;
call _lootBubble;
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 = [];
_nearByBobbers = player nearEntities[["Bobber_EPOCH"], 12];
{
if (local _x) then {
_nearByBobbersLocal pushBack _x
}
} forEach _nearByBobbers;
_nearByBobbersLocal = (player nearEntities[["Bobber_EPOCH"], 12]) select {local _x};
if !(_nearByBobbersLocal isEqualTo []) then {
if ((random 100) < 50) then {
_bobber = selectRandom _nearByBobbersLocal;

View File

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

View File

@ -51,7 +51,8 @@ class CfgEpochClient
{"SpawnArray",{},{}},
{"Karma",0,{50000,-50000}},
{"Alcohol",0,{100,0}},
{"Radiation",0,{100,0}}
{"Radiation",0,{100,0}},
{"Nuisance",0,{100,0}}
};
// 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"};

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_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 {
diag_log "Epoch: CUP Weapons detected";
@ -61,6 +62,9 @@ if (EPOCH_modCUPWeaponsEnabled) then {
if (EPOCH_modCUPVehiclesEnabled) then {
diag_log "Epoch: CUP Vehicles detected";
};
if (EPOCH_mod_Ryanzombies_Enabled) then {
diag_log "Epoch: Ryanzombies detected";
};
diag_log "Epoch: Init Variables";
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 />
# <extractdir>%TEMP%</extractdir>
# <files />
# <usedefaulticon>true</usedefaulticon>
# <usedefaulticon>false</usedefaulticon>
# <icon>F:\ARCHIVE\Downloads\logo_only_1024.ico</icon>
# <showinsystray>false</showinsystray>
# <tooltip>Epoch Mod PBO Packer</tooltip>
# <altcreds>false</altcreds>
# <efs>true</efs>
# <ntfs>true</ntfs>
# <local>false</local>
# <abortonfail>true</abortonfail>
# <product />
# <product>Epoch PBO Packing Tool</product>
# <internalname>Epoch PBO Packing Tool </internalname>
# <version>1.0.0.1</version>
# <versionstring />
# <comments />
# <company />
# <versionstring>1.0</versionstring>
# <description>Tool to aid in the packing of Epoch Mod source files</description>
# <comments>By Raimonds Virtoss and Aaron Clark</comments>
# <company>EpochMod.com</company>
# <includeinterpreter>false</includeinterpreter>
# <forcecomregistration>false</forcecomregistration>
# <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.Size = New-Object System.Drawing.Size(808, 18)
$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.add_Click({Label4Click($Label4)})
#~~< TabControl1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -158,11 +162,25 @@ $TabPage2.Size = New-Object System.Drawing.Size(800, 503)
$TabPage2.TabIndex = 1
$TabPage2.Text = "Settings"
$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 = 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.Location = New-Object System.Drawing.Point(270, 225)
$Label18.Size = New-Object System.Drawing.Size(179, 29)
$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(6, 223)
$Label18.Size = New-Object System.Drawing.Size(235, 29)
$Label18.TabIndex = 37
$Label18.Text = "Sign File Settings"
$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.Size = New-Object System.Drawing.Size(643, 14)
$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)})
#~~< 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 = New-Object System.Windows.Forms.Label
$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.TabIndex = 0
$TextBox1.Text = ""
$TabPage2.Controls.Add($Label19)
$TabPage2.Controls.Add($TextBox13)
$TabPage2.Controls.Add($Label18)
$TabPage2.Controls.Add($Label16)
$TabPage2.Controls.Add($Label15)
$TabPage2.Controls.Add($Label13)
$TabPage2.Controls.Add($Label17)
$TabPage2.Controls.Add($Button17)
$TabPage2.Controls.Add($Label14)
@ -385,27 +421,6 @@ $TabPage3.Size = New-Object System.Drawing.Size(800, 503)
$TabPage3.TabIndex = 2
$TabPage3.Text = "Developers"
$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 = New-Object System.Windows.Forms.Button
$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.Text = "Browse"
$Button4.UseVisualStyleBackColor = $true
$TabPage3.Controls.Add($TextBox13)
$TabPage3.Controls.Add($Label15)
$TabPage3.Controls.Add($Label13)
$TabPage3.Controls.Add($Button15)
$TabPage3.Controls.Add($Button12)
$TabPage3.Controls.Add($Label6)
@ -563,6 +575,8 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
#region Custom Code
# 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
$FolderBrowserDialog1.ShowNewFolderButton = $false
@ -694,11 +708,34 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$p6 = Join-Path $Textbox4.Text "\version.txt"
$p7 = Join-Path $Textbox4.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" }
$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" }
$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
@ -706,7 +743,6 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$p6 = Join-Path $Textbox4.Text "\version.txt"
$p7 = Join-Path $Textbox4.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))
{
@ -720,10 +756,6 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
{
$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)
@ -836,22 +868,41 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
function fnc_devEnableDisable
{
$cbstate = $CheckBox1.Checked
$TextBox4.Enabled = $cbstate
$TextBox6.Enabled = $cbstate
$TextBox7.Enabled = $cbstate
$TextBox8.Enabled = $cbstate
$TextBox13.Enabled = $cbstate
$TextBox13.Enabled = $cbstate
$TextBox11.Enabled = $cbstate
$TextBoxPboPrefix.Enabled = $cbstate
$TextBoxBISignPrefix.Enabled = $cbstate
$Button4.Enabled = $cbstate
$Button15.Enabled = $cbstate
$Button12.Enabled = $cbstate
$Button17.Enabled = $cbstate
$ComboBox1.Enabled = $cbstate
$ListView1.Items.Clear()
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
{
@ -903,19 +954,28 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
function fnc_CreatePBO
{
#
$signName = ($TextBox12.Text + $TextBox13.Text)
$signName = ($TextBoxBISignPrefix.Text + $TextBox13.Text)
$signFileName = ($signName + ".biprivatekey")
$signfile = Join-Path $TextBox11.Text $signFileName
# make privatekey if it does not exist
if (!(Test-Path $signfile)) {
if (!(Test-Path $signfile))
{
$createKeyExecutable = Join-Path $TextBox11.Text "DSCreateKey.exe"
$argz = @($signName)
Start-Process -FilePath $createKeyExecutable -WorkingDirectory $TextBox11.Text -ArgumentList $argz -WindowStyle Minimized -Wait
$Label4.Text = "Making Private Key... Please wait"
$Label4.Refresh()
}
fnc_outputmodcpp
# increase build numbers
$incrementClientBuild = 1
$incrementServerBuild = 1
$Bob = Join-Path $TextBox3.Text "\AddonBuilder.exe"
$includes = "P:\includes.txt"
@ -943,33 +1003,47 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
$Output = $TextBox10.Text
if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse }
Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse
fnc_updateBuildNumber $TextBox2.Text ($x.subitems[1].Text) $incrementServerBuild
$incrementServerBuild = 0
$argz = @($tmp, ( '"' + $Output + '"' ), "-packonly", "-clear", "-prefix=$name", "-project=$tmp", "-include=$includes")
$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
}
"Client"
{
$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"
if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse }
Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse
$signFlag = ""
if (Test-Path $signfile) { $signFlag = ('-sign="' + $signfile + '"') }
$argz = @($tmp, ( '"' + $Output + '"' ), "-clear", "-prefix=$name", "-project=$tmp", "-include=$includes", $signFlag)
$argz = @($tmp, ( '"' + $Output + '"' ), "-clear", "-prefix=$name", "-project=P:\", "-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
}
"Missions"
{
$Output = $TextBox9.Text
$src = $TextBox2.Text + "\Sources\"
fnc_updateBuildNumber $TextBox2.Text ($src + "epoch_config") $incrementServerBuild
$incrementServerBuild = 0
if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse }
Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse
Copy-Item($src + "epoch_code") -Destination $tmp -Recurse
@ -977,7 +1051,10 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
Copy-Item($src + "description.ext") -Destination $tmp
$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
}
}
@ -1041,12 +1118,20 @@ $Timer1 = New-Object System.Windows.Forms.Timer($components)
fnc_reloadVersions
$signName = ($TextBox12.Text + $TextBox13.Text)
$signName = ($TextBoxBISignPrefix.Text + $TextBox13.Text)
$signFileName = ($signName + ".biprivatekey")
$signfile = Join-Path $TextBox11.Text $signFileName
$signFlag = ""
if (Test-Path $signfile) { $signFlag = "-sign= '$signfile'" }
$Label13.Text = $signFlag;
if (Test-Path $signfile) {
$Label13.Text = $signfile
$signFlag = ('-sign="' + $signfile + '"')
}
else
{
$Label13.Text = "Path Not Found!"
}
#endregion
@ -1114,8 +1199,9 @@ Main # This call must remain below all other event functions
#
# Script Information
#
# Title: Epoch PBO Packing Tool
# Title: Epoch PBO Packing Tool - EpochMod.com
# Author: Raimonds Virtoss - Raymix @ Epoch UI code
# Contributors: Aaron Clark - [VB]AWOL
# 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
# 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