Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

third times the charm #6

Merged
merged 1,455 commits into from
Nov 26, 2021

Conversation

stutpip123
Copy link
Owner

What type of PR is this.

  1. Bug
  2. Change
  3. Enhancement

What have you changed and why?

Information:

Please specify which Issue this PR Resolves.

closes #XXXX

Please verify the following and ensure all checks are completed.

  1. Have you loaded the mission in LAN host?
  2. Have you loaded the mission on a dedicated server?

Is further testing or are further changes required?

  1. No
  2. Yes (Please provide further detail below.)

How can the changes be tested?

Steps:


Notes:

Bob-Murphy and others added 30 commits May 16, 2021 01:36
civ templates list to be populated by @Lazejun
THE END OF *some* AUTODETECTION
set max amount to 40 as some cities like Hue have up to 2,000 inhabitants which leads to 200 units spawning
…se translation for vn-development branch (#1939)

## What type of PR is this.
3. [x] Enhancement

### What have you changed and why?
Information:
To be honest, previous Simplified Chinese translation is a really really ugly work.
Although it made the mission finally readable for some Chinese-only people, there are almost misunderstandings and incorrectness everywhere.
This time. I've **totally refactored all the Simplified Chinese translation, making it finally readable and as accurate as I can do**.
Thanks for player xiduola in my clan, he helped translate the UI part.
However, I still see **many strings are not added to stringtable so we cannot provide multilingual support**. I hope developers can help with that.

### Please specify which Issue this PR Resolves.
closes #XXXX

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [x] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No

### How can the changes be tested?
Steps: Change the game into Simplified Chinese, restart the game, and start the mission.

********************************************************
Notes:

* Completely refactor previous Simplified Chinese translation

* Replace some Chinese punctuation with English ones
Fix HandleDamage event returning scriptHandlers when CAS plane is struck by bullets

## What type of PR is this.
1. [x] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
Added a single nil line to the end of the HandleDamage EH to make sure the EH always returns Nothing, which is necessary for damage to be applied normally per https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage

### Please specify which Issue this PR Resolves.
closes #1938 

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 
1. Spawn an empty ZSU-39 and get in
2. Make ZSU-39 and units inside invincible (e.g. with Zeus)
3. Spawn a CAS support onto the player's position
4. When the CAS arrives, strike it with the ZSU-39's autocannon
5. Check the CAS plane's health with Zeus

Current behavior: CAS plane is undamaged by autocannon
Fixed behavior: CAS plane takes damage 
********************************************************
Notes:

* Update fn_SUP_CASRoutine.sqf

Fix HandleDamage event returning scriptHandlers when CAS plane is struck by bullets

* adjust indentation

Co-authored-by: Bob-Murphy <[email protected]>
## What type of PR is this.
1. [x] Bug
2. [ ] Change
3. [x] Enhancement

### What have you changed and why?
Information:
Applied the TFAR Fix for ACRE with slight changes to work with ACRE.
Added ACRE Items to Gadgets so they could apear in Loot.
Using the Category Radios might cause Errors in the Future as ACRE does not use the Radioslot, so linkitem will not work with it.

### Please specify which Issue this PR Resolves.
closes #1949

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 
Equip ACRE Radios in the Arsenal,
Open and close the Arsenal, they should not stack differently.
********************************************************
Notes:

* Fix ACRE Items stacking differently in Arsenal

* Add ACRE Items to Gadgets.
## What type of PR is this.
1. [ ] Bug
2. [ ] Change
3. [X] Enhancement

### What have you changed and why?
Implemented type-dependent classes for rebel AIs. This makes the unit type icons in the command bar work correctly (medics and engineers now have the appropriate symbol), plus the overlay names no longer all say "riflemen". Petros is now "officer", for example.

Each element of customUnitTypes now has an additional parameter for the unit class to be used for that unit type. These are varied for rebel units only, as we don't much care about the UI for enemy troops. 

Also fixed some misnamed loadout -> definition variables, and fixed the incorrect loadout count debug text. Definitions already had an extra parameter of unit traits, so the format apparently changed at some point.

Based on vn-development so that we can get the merge conflicts in early.

I haven't checked the code for civ creation but they seem to work for whatever reason. Enemies should be fine.

### Please specify which Issue this PR Resolves.
mentioned in #1914

### Please verify the following and ensure all checks are completed.
1. [X] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Enable command bar and the server difficulty option that gives you information about your troops on mouseover. Recruit all the different rebels and look at them. Also check out Petros. He likes it.
jaj22 and others added 28 commits October 2, 2021 10:04
### What type of PR is this.
1. [ ] Bug
2. [X] Change
3. [ ] Enhancement

### What have you changed and why?
The four small attacks against easy targets option and wave count calculation were not working as intended. I've removed the former and simplified the latter to temporarily fix the behaviour. Example cases that now work reasonably:

- Small attacks not spawning due to HC maxUnits limits so the attack does nothing.
- Only one small attack spawning and being less effective than a wavedCA for a higher timer cost.
- Depending on the size and grouping of the singleAttack, captured target will often have a very small garrison afterwards and so be very easy to recapture.
- With 1-3 easy targets, the code would always prefer a non-easy target, often leading to useless attacks on cities.
- Long distance targets having very large wave counts, even if very early game.
- Short distance targets having minimal wave counts, even if heavily defended.

It's not ideal, but I don't think there's any practical downside.

### Please specify which Issue this PR Resolves.
closes #2142

### Please verify the following and ensure all checks are completed.
1. [X] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Difficult because attacks targets are deterministic but target side is random, and there's no function separation. In general, set up various situations with markerChange and garrison functions and then run `[attackerSide] spawn A3A_fnc_rebelAttack`. Using reb vs gov to constrain the target side may be useful.

Not really any new code here though, just removal of paths.

Notes:
* Quick fixes for degenerate behaviour in rebelAttack

* Increase city weight for invader attacks
## What type of PR is this.
1. [ ] Bug
2. [X] Change
3. [ ] Enhancement

### What have you changed and why?
Approximately halved the maximum capture response delay. See #2146.

Also removed the case where if you captured a marker outside mission radius, the response would be delayed until the marker despawned. Not sure what the purpose of this was, but it feels weird and exploitable.

Not happy with the response + delay mechanic in general as it feels very artificial with the intentional flag flips, but it'll have to do for the moment.

### Please specify which Issue this PR Resolves.
closes #2146

### Please verify the following and ensure all checks are completed.
1. [ ] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)
### What type of PR is this.
1. [X] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
Airborne troops, for example overflying in transport helis, counted towards flag recapture checks. This caused some very weird marker flips. This PR prevents airborne troops from counting towards the capture check.

wavedCA probably has a similar issue but it's harder to fix.

### Please specify which Issue this PR Resolves.
closes #2145

### Please verify the following and ensure all checks are completed.
1. [X] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)
### What type of PR is this.
1. [X] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
#1818 introduced a bug (_player -> player switch) where the commander could become permanently undercover by remote controlling a high command squad.

I've just blocked it for the moment by preventing use of remote control while undercover, as that seemed to fit better with other design decisions. If we want to bring back undercover RC then goUndercover will need changes to support that.

### Please specify which Issue this PR Resolves.
closes #2133

### Please verify the following and ensure all checks are completed.
1. [X] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)
### What type of PR is this.
1. [X] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
Both constructed and single-vehicle AA trucks were being underpriced on purchase due to not calculating truck + static AA costs as the other code did. This PR fixes this for both cases with a horrible hack.    

**Edit:** Additional vehicle price bugs fixed:
- Fixed doubled check price for AA and AT vehicles (missing isInfantry check).
- Fixed AT car check price adding SDKTruck price.
- Fixed ancient bug where zu-23 rebel AA trucks were not refunded on dismissal.
- Fixed bug where vanilla AA trucks were double-refunded.
- Fixed misleading error message when you didn't have enough money to purchase a transport vehicle.
- Fixed wrong price shown for transport vehicle.
- Fixed squad mortars and MGs not being charged for.

### Please specify which Issue this PR Resolves.
closes #2150
closes #2152

### Please verify the following and ensure all checks are completed.
1. [X] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)

Notes:
* Horrible fix for AA truck prices

* Fix multiple rebel squad-vehicle price checking bugs

* Fix more HC squad price bugs

* Don't try to refund weird attached objects on HC dismissal
## What type of PR is this.
1. [x] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
Information: added the client id to the remoteExec to stop incorrectly issuing feedback to the wrong players.
    

### Please specify which Issue this PR Resolves.
closes #2155

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

********************************************************
Notes:
## What type of PR is this.
1. [X] Bug
2. [X] Change
3. [ ] Enhancement

### What have you changed and why?
- Fix bug where drop object action (for dropping lamps) wasn't added to player after respawn.
- Fix bug where actions were left on a dead player object.
- Fix bug where LTC actions could be added when disabled by params.

Also accidentally added the setOvercast functionality that solidifies the rain-removal tent option. Can't be bothered to unfuck git and separate it. Note that the overcast state changes very slowly, but it should prevent the rain from coming back.

### Please specify which Issue this PR Resolves.
closes #2154
closes #1992

### Please verify the following and ensure all checks are completed.
1. [X] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)

Notes:
- Fix lamp drop action after respawn
- Added the setOvercast functionality that solidifies the rain-removal tent option
## What type of PR is this.
1. [ ] Bug
2. [x] Change
3. [ ] Enhancement

### What have you changed and why?
Information:
Don't Merge before the VN Update.

Changed Rebell Defaults for DiveGear and FlyGear to use arrays instead of being a True/False,
Added DiveBP due to VN using a Backpack as Rebreather,
changed CreateAiAirplane and CreateAiOutpost to use whats set in the Templates/Rebell Defaults.
Remove the IFA check for Seaports as that can be solved within the Templates.
Removed DiveGear and FlyGear in ItemSort.
Removed the Vars for them in InitVarServer,
Added Back the VN Surrender boxes as the Maximumload issue has been resolved,
Added the new Civ Vehicles added by the Update,
Added the New MGs for MACV,
Added TOW M151A1 for MACV,
changed the Static AT for Rebell and PAVN to an Unguided AT Launcher,
Added Logistic nodes for new Weapons and Civ Vehicles.
Added Type 56.
Blacklisted Quadmount for M54 and Z-157 (clipping).

### Please specify which Issue this PR Resolves.
closes nothing it just updates the VN Templates and other stuff needed for it.

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 
FlyGear/DiveGear:
Teleport to a Seaport/Airbase and check the Inventory of the Box, it should have FlightSuits/DiveGear.

Check fitment on new Vehicles/Weapons
********************************************************
Notes:
One of the New Small Trucks always spawns with Vases in the Back, these can be removed via Garage, it has 3 Logistic nodes so it can load a few things, but the Vases are annoying.

* Add VN Dive Gear, change Static Weapon, change Truck

* remove obsolete vars

* Update fn_equipmentSort.sqf

* Add New Vehicles/Remove Hints

* Add new Vehicles and Weapons to Nodes

* Update VN_MACV.sqf

* Update VN_PAVN.sqf

* adjusted tow height

* blacklist quadmount from M54 & Z-157 truck - frontplate clipping

* adds the type 56

* diveGear overhaul

Whilst the diveBP can be worn, it does not have the connector to the mouth. You drown when wearing only the backpack/tank.
The seal vest on the other hand does block the vest as well as the backpack slot and does include the mouth-piece as well as the tank.

* deletes redundant diveBP from fn_createAIOutposts.sqf

* deletes redundant diveBP from RebelDefaults.sqf

* removes vn-diving-vest from allCivilianVests

Co-authored-by: Bob-Murphy <[email protected]>
### What type of PR is this.
1. [ ] Bug
2. [X] Change
3. [ ] Enhancement

### What have you changed and why?
Added client event handler to remove undercover status when an ACE explosive is set up (note that this is on trigger setup, not placement).

### Please specify which Issue this PR Resolves.
Bob didn't want to publicize the issue.

### Please verify the following and ensure all checks are completed.
1. [X] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)

Notes:
Remove undercover on setup of ACE explosives
## What type of PR is this.
1. [X] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
Information:
Fixed NATO gunships shooting occupants units
Fixed early exit case not deleting
Readjusted target offset to hit targets better


### Please specify which Issue this PR Resolves.
closes none

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 
Spawn in a random location and call following code
```
[0, 0,"airport_1", getPos player, "GUNSHIP0"] spawn A3A_fnc_SUP_gunshipRoutineNATO;
server setVariable ["GUNSHIP0_targets", [[[player, 3], 1]]];
```
********************************************************

Notes:
* Fix Nato gunship shooting friendlies

* Fixed a runtime bug, fixed log, added log when gunship returns

* Ended bob complains about logic (added proper log lines)
* 2.5.3 preliminary changelog for 2.5.3
## What type of PR is this.
* Bug
* Change
3. [x] Enhancement

### What have you changed and why?
    Formats a scalar as the specified length hexadecimal string.
    These lengths are divided into multiple functions for 4, 8, 12, 16, 20, 24 bits.
    This is needed for UUID generation and output. May help other areas.

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
* Yes (Please provide further detail below.)

### How can the changes be tested?
```sqf
[
    A3A_base16LookupTable   # 0x0        isEqualTo "0",
    A3A_base16e2LookupTable # 0xb4       isEqualTo "b4",
    0xaaf       call A3A_fnc_uint12ToHex isEqualTo "aaf",
    0xdead      call A3A_fnc_uint16ToHex isEqualTo "dead",
    0xca1eb     call A3A_fnc_uint20ToHex isEqualTo "ca1eb",
    0xffffff    call A3A_fnc_uint24ToHex isEqualTo "ffffff"
] isEqualTo [true,true,true,true,true,true];
```
Notes:
* 🔡 Unsigned integer 4,8,12,16,20,24 to hexidecimal

* 〰 Spelling Fixes.

* 📄Fixed doc example to show random's exclusiveness

* ⛔16e3 lookup table removed. Files moved to utility

* 🌅 Added initPreJIP function.

* ⏪ uintToHexGenTables added to initPreJIP.

* 🔍 4 and 8 uintToHex replaced by lookup examples.

* #️⃣ Fixed include for initPreJIP.

* 🔥 Fixed broken math from 4096 lookuptable removal
## What type of PR is this.
1. [ ] Bug
2. [ ] Change
3. [x] Enhancement

### What have you changed and why?
Information: recent comments and experience has shown a lack of complete compatible magazine info, as well as the complexity of getting this information.

as how compatible magazines can be included in a weapon or vehicle config this requires a bit of brute force.
therefore the default behavior is to do a full config search, but as this can be some what slow (example numbers bellow) i also added a the option to perform a shallow search.

This checks both magazines and magazineWells

**Test output**
```json
{
    "arifle_MX_GL_F_shallow": {
        "class": "arifle_MX_GL_F",
        "time-ms": 0.0464,
        "Shallow": true,
        "Output": [
            "30Rnd_65x39_caseless_mag",
            "30Rnd_65x39_caseless_khaki_mag",
            "30Rnd_65x39_caseless_black_mag",
            "30Rnd_65x39_caseless_mag_Tracer",
            "30Rnd_65x39_caseless_khaki_mag_Tracer",
            "30Rnd_65x39_caseless_black_mag_Tracer",
            "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim",
            "ACE_30Rnd_65x47_Scenar_mag",
            "ACE_30Rnd_65_Creedmor_mag",
            "100Rnd_65x39_caseless_mag",
            "100Rnd_65x39_caseless_khaki_mag",
            "100Rnd_65x39_caseless_black_mag",
            "100Rnd_65x39_caseless_mag_tracer",
            "100Rnd_65x39_caseless_khaki_mag_tracer",
            "100Rnd_65x39_caseless_black_mag_tracer",
            "ACE_100Rnd_65x39_caseless_mag_Tracer_Dim",
            "100Rnd_65x39_caseless_mag_Tracer",
            "100Rnd_65x39_caseless_khaki_mag_Tracer",
            "100Rnd_65x39_caseless_black_mag_Tracer"
        ]
    },
    "arifle_MX_GL_F": {
        "class": "arifle_MX_GL_F",
        "time-ms": 1.25,
        "Shallow": false,
        "Output": [
            "30Rnd_65x39_caseless_mag",
            "1Rnd_HE_Grenade_shell",
            "UGL_FlareWhite_F",
            "UGL_FlareGreen_F",
            "UGL_FlareRed_F",
            "UGL_FlareYellow_F",
            "UGL_FlareCIR_F",
            "1Rnd_Smoke_Grenade_shell",
            "1Rnd_SmokeRed_Grenade_shell",
            "1Rnd_SmokeGreen_Grenade_shell",
            "1Rnd_SmokeYellow_Grenade_shell",
            "1Rnd_SmokePurple_Grenade_shell",
            "1Rnd_SmokeBlue_Grenade_shell",
            "1Rnd_SmokeOrange_Grenade_shell",
            "3Rnd_HE_Grenade_shell",
            "3Rnd_UGL_FlareWhite_F",
            "3Rnd_UGL_FlareGreen_F",
            "3Rnd_UGL_FlareRed_F",
            "3Rnd_UGL_FlareYellow_F",
            "3Rnd_UGL_FlareCIR_F",
            "3Rnd_Smoke_Grenade_shell",
            "3Rnd_SmokeRed_Grenade_shell",
            "3Rnd_SmokeGreen_Grenade_shell",
            "3Rnd_SmokeYellow_Grenade_shell",
            "3Rnd_SmokePurple_Grenade_shell",
            "3Rnd_SmokeBlue_Grenade_shell",
            "3Rnd_SmokeOrange_Grenade_shell",
            "ACE_HuntIR_M203",
            "30Rnd_65x39_caseless_khaki_mag",
            "30Rnd_65x39_caseless_black_mag",
            "30Rnd_65x39_caseless_mag_Tracer",
            "30Rnd_65x39_caseless_khaki_mag_Tracer",
            "30Rnd_65x39_caseless_black_mag_Tracer",
            "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim",
            "ACE_30Rnd_65x47_Scenar_mag",
            "ACE_30Rnd_65_Creedmor_mag",
            "100Rnd_65x39_caseless_mag",
            "100Rnd_65x39_caseless_khaki_mag",
            "100Rnd_65x39_caseless_black_mag",
            "100Rnd_65x39_caseless_mag_tracer",
            "100Rnd_65x39_caseless_khaki_mag_tracer",
            "100Rnd_65x39_caseless_black_mag_tracer",
            "ACE_100Rnd_65x39_caseless_mag_Tracer_Dim",
            "100Rnd_65x39_caseless_mag_Tracer",
            "100Rnd_65x39_caseless_khaki_mag_Tracer",
            "100Rnd_65x39_caseless_black_mag_Tracer",
            "rhs_mag_M441_HE",
            "rhs_mag_M433_HEDP",
            "rhs_mag_M397_HET",
            "rhs_mag_m576",
            "rhs_mag_M4009",
            "rhs_mag_M583A1_white",
            "rhs_mag_M585_white",
            "rhs_mag_M661_green",
            "rhs_mag_M662_red",
            "rhs_mag_M585_white_cluster",
            "rhs_mag_M663_green_cluster",
            "rhs_mag_M664_red_cluster",
            "rhs_mag_M713_red",
            "rhs_mag_M714_white",
            "rhs_mag_M715_green",
            "rhs_mag_M716_yellow",
            "rhs_mag_M781_Practice",
            "ACE_40mm_flare_white",
            "ACE_40mm_flare_red",
            "ACE_40mm_flare_green",
            "ACE_40mm_flare_ir"
        ]
    },
    "B_MBT_01_base_F_shallow" : {
        "class": "B_MBT_01_base_F",
        "time-ms": 0.011,
        "Shallow": true,
        "Output": []
    },
    "B_MBT_01_base_F": {
        "class": "B_MBT_01_base_F",
        "time-ms": 4.82,
        "Shallow": true,
        "Output": [
            "24Rnd_120mm_APFSDS_shells_Tracer_Red",
            "12Rnd_120mm_HE_shells_Tracer_Red",
            "12Rnd_120mm_HEAT_MP_T_Red",
            "200Rnd_762x51_Belt_Red",
            "SmokeLauncherMag"
        ]
    }
}
```

### Please specify which Issue this PR Resolves.
closes #XXXX

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 

********************************************************
Notes: i plan on having this be used for compatible magazine checking for the arsenal and maybe other things as well

* added a full magazine parcer

* added new allMagazines to functions cfg

* improved performance, maintained deep parse results
## What type of PR is this.
1. [ ] Bug
2. [ ] Change
3. [x] Enhancement

### What have you changed and why?
Information:
    Using aceModCompact I added an array of the items used in KAT med, allowing for the player to add KAT med items and use them. Added a check for to see if the KAT med is enabled. 



### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 

********************************************************
Notes:
* added initial support for kat med

* changed detection class name to more kat specific
## What type of PR is this.
1. [ ] Bug
2. [x] Change
3. [x] Enhancement

### What have you changed and why?
Information:
    Changed the random selection process to no longer existing. I got rid of it. The player will now know what they are constructing instead of finding out that they can only build tree logs barricades. I changed the initial build from 60 seconds to 45, and Added a check for a toolkit in the player inventory. The check decreases the time required to build structures. 

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 

********************************************************
Notes:
* removed random selection for construction

* turned off simulations for builds that are loaded

* Added A3A prefix to global
## What type of PR is this.
1. [ ] Bug
2. [x] Change
3. [ ] Enhancement

### What have you changed and why?
Information:
    The old pr freaked out and would recognise the new commits to the branch, see #1998 
    
```
Information: The move to the new template system in the code base.

Removed old template system files
renamed newTemplates to just templates
added macros for "ease" of use with the new system
move compilation of groups and assets lists to the templates processing.
moved faction data to hashmap from namespace
re did the arty entry in templates to be like the other vehicles entries, added a magazines entry thats a hashmap matching vehicle to magazines
added template validation to loadFaction, verifying loadouts and datatype of entries in the template (not all entries have verification yet, and bad templates havent been tested yet, validation fail only screams in the log)
removed list of assets and groups from initVarServer to two new functions in the faction loading process.
Added 2 Weapons to 3CB Faction Logistics, Added 1 Vehicle, Added Trucks to Coveredblacklist.
Added Line to add Static Weapons to StaticsToSave
prob a lot more.
```

### Please specify which Issue this PR Resolves.
closes #XXXX

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 

********************************************************
Notes:
* Fixed wrong var in chooseSupport
Fixed `hasAce` missing the new prefix in new garage

* disabled ambient noise when in garage (see #1988)

* added requested settings disable option for ammo fuel and repair services in garage

* Add 2 Missing Trucks to Coveredvehicles list

Co-Authored-By: HakonRydland <[email protected]>

* added locked by and looking at tooltip

* added customisation preservation

* fix locked name for the tooltip not updating on server

* fix null object check not going before cat index is gotten

* unified vehicle id naming in log lines

* improved commander unlock log to include owner name

* decided to leave the compat in

* ⚙ refactor forEach loops on hashmaps to use the _y magic variable

* 🔴⛓added disconnect handler for player crashes while in the garage or placing

* removed log line since placement is done outside of garage, and the block condition was changed to reflect that

this runs for every player disconnect

* fixed null selection error

* Factions now select template from the params

* 🤖💻 auto picking added

* 🧾 added  logging when autopicking

* 🧾 added invalid faction selected error log

* corrected us marines being marked as factions dependant

* updated header

* added fallback category index

* 🩹 corrected misslabeling in param OccupantsFactionEnum

* partial move to new template (WIP)

* move to new template in the code base

* fixed occ and inv faction not getting broadcast
fixed typo in rebel groups
removed the two testing helis in helisLight (USAF template)

* corrected casing in compileGroups

* added missing template validation

* removed case for petros in unitTraits
(this was wrong anyways as i forgot to retrive the actuall unit data, i just got the name)

* aperantly some keys in faction was side???

* fixed missing selectRandom for mortar spawns on createAIOutposts/Airplane

* roadblocks use low tier units when low tier roadblock

* Add Static Weapons to staticsToSave

* Update 3CBFactions_Logistics_Nodes.sqf

Add RBS70,
Add High M240,
Add new Pickup Truck

* Match variable names, consistency.

* ⚙🛠 Initial review change request by @jaj22
- compatibilityLoadFaction: Fixed casing, removed faction broadcast
- compileGroups: added rifleman to AT & AA AI groups, fixed casing
- LoadAddon: removed faction broadcast
- initVarServer: added faction bradcast here so to not spam bradcasting durring template loading, broadcast is now also publicVariabled to be more reliable (have higer priority for JIP)
doubt this is actually needed but dosnt hurt.

* removed the doubled rebel "singular units" altered codebase to reflect this
Notde: im unsure if something may have been missed while making this change, but all uses of rebel groups afaik specifically is with the `FactionGet(reb,"groups")` macro. so i **should** have caught all the cases.

* fixed a few mistakes from the doubled rebel units removal

* fixed rebel rifleman being treated as array in initVarServer

* fixed array being passed to vehAvailable

* changed grunt to rifleman, was SL on inv before (mistake?)

* fixed incorrect pricing for garrison add

* fixed unit type being passed as unit types to garrisonUpdate

* fixed reinfPlayer treating class type as array

* fixed incorrect path in include

* fixed more incorrect include paths

* fixed all police vehicle not being set as vehiclesPolice
but Police instead

* fixed bug in initVehClassToCrew where incorrect pool was given a crew type
was rebel vehicles, supposed to be AI militia vehicles

* added template asset validation error logging

* fixed pring when no invalid entries

* fixed minefieldAT && APERS being checked as magazines

* fixed bad check on intel entries

* whoopsi

* updated new log line indicator

* log bad mag type and bullet count in validateWeaponMagazine

* Match cases on TKA West

* Include Arid Marines Template

* moved new templates to right foldr, not in selector yet

* fixed errors in validation proccess

* fixed print function and incorrect config change in magazines validation

* "not_supported" is not supported anymore 😉

* added missing handling of asset lacking

* fix milBuildings lacking missing asset safety

* empty preference return empty string as if nothing was prefered

* old system wasnt designed for this, reverted some changes to resolve this for now...
a rework would be welcome in this area

* fixed incorrect check for no uavs

* Update Templates, Selector and Params

Update to new Format of this PR

* Fix bad Class

* Update Mines to new Format

* update check small UAV

* added empty pool protection to attack HQ

* fixed old unit from group composition selection

* error handling improvements

* fixed missing semicolon

* removed dupe code block

* Rangefinder casing consistency

* Switched variables to camelCases

* corrected wrong hashmap use in createOutpostsFIA
fixed casing and old syntax

* simplified getting surrender create type

* added missing selectRandom
removed horrible formating

* spawnLight addapted to hashmap change

* removed unnececary doubled groupData

* resolved bad verification on initialRebelEquipment

* Added case correction to loadStat -> garrison
- added loadout name casing lookup table to loadStat garrison case
- added debug lines for bad entries
- tabs -> spaces

* correct toolkit casing (including variable names cause im lazy

* corrected ace medical casing

* fixed loadout validation (fuck magwells)

* corrected wrong param passed to verifyLoadoutsData

* Fix Casing

* correct bad class casing in config
empty class defaults to valid

* added auxPointerSlot

* Update 3CB_AI_AAF.sqf

* "getVariable" -> "get"

* re added missing rebel group data

* corrected faulty retrival of assemleTo
corrected doubled returned cost
(2 backpacks refounded for the combined price each)

* corrected reverted typo

* fixed incorrect garrison definition

* fixed variouse syntax errors

* manual revert of loadStat to unstable (bad merger)
and reaplied needed changes for moveToNewTemplates
tabs -> spaces

* Review changes 11.10.2021
- added a "staticMortars" to A3A_faction_all
- switched rifleman to marksman for militia snipers
- corrected wrong indentation in createSDKgarrisonTemp
- corrected error log argument count
- fixed order of operation problem in reinforcementsAI
- simplified/corrected auto pass vehicle check in vehAvailable
- corrected naming convention violation in wavedCA
- added police squad composition to groups data
- corrected getting unarmed loadout name from faction data to groupe data
- corrected equipRebel array checks to string checks for unit type
- added missing transport helis to saveLoop asset preservation
- corrected incorrect plane pool being used in ASF routine
- simplified target type check for apc with A3A_faction_all in CAS routine
- removed doubled transport helis in QRF replacement pool

* Requested changes @jaj22, Review 12.oct 2021

-VehiclesNormal and VehiclesAir replaced, entry removed from faction data

- Fixed various casing issues

- Removed old civ vehicle data for auto_civ

- Removed redundant log char limit work around in template validation

- fixed type error and wrong entry check in goUndercover

* case correcting

* added missing variable for faction/group data

* fixed bad macro call in aivehinit

* fixed bad use of _faction instead of macro OccAndInv

* Move everything from faction groups hashmap down to faction.
Units get "unit" prefix, groups get "group".

Also many bugfixes:
- Numerous errors with high command squad recruit.
- Ammo truck and destroy vehicle mission not working.
- Patrol dog sniper team detection errors in multiple files.
- Others that I forgot.

* Fix initGarrisons for template refactor

* Fix player recruiting for template refactor

* Fix bomb specialist and MG team recruitment for template rework

* Fix patrolReinf bug from group->faction refactor

* Fixes to various vehicle type groupings:
- staticMortars added to all.
- Fixed multiple bugs and name order issues with heli grouping names.
- Sorted out unlimited pool usage for patrolReinf/QRF/singleAttack.
- Fixed old bug where tanks may ignore the first hit.

* Fix civ unit type merge bug in invaderPunish

* Fix typo in getVehiclePoolForAttacks

* Fix support availability checks and CAS routine bug

* Change groups*Squad to groups*Squads to reduce plural ambiguity

* Case Correction

* Update to new format

* Replace pre-2.4 garrison troops with random new ones, add nil safety

Co-authored-by: Lazejun <[email protected]>
Co-authored-by: John Jordan <[email protected]>
Adds Ace Drink Items by Default, as they can be used to Cool your Barrel.

Food Items are given at the start if the Parameter is enabled.
## What type of PR is this.
* Bug
* Change
3. [x] Enhancement

### What have you changed and why?
* Added a short ID generator.
* It is based on client ID and a local counter.
* This removes the need to create an initialiser for every ID counter needed.
* It is not persistent, that need will be solved by UUIDs.
* Although it's waiting on the merge of dependencies, it can still be reviewed.
* The shortID_init method will be added to the new preJIP init file.

### Please verify the following and ensure all checks are completed.
* [ ] Have you loaded the mission in LAN host?
* [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
* [x] No
* Yes

### How can the changes be tested?
1. Run unit & integration Tests.
```sqf
private _tests = [["Init: counter1Modulo.", !isNil {A3A_shortID_counter1Modulo}],["Init: counter2Modulo.", !isNil {A3A_shortID_counter2Modulo}],["Init: counter1.", !isNil {A3A_shortID_counter1}],["Init: counter2.", !isNil {A3A_shortID_counter2}],["Init: clientID.", !isNil {A3A_shortID_clientID}],["Create: Return Amount.", count (call A3A_fnc_shortID_create) == 2],["Create: Return Types.", (call A3A_fnc_shortID_create) isEqualTypeAll 0],["Create: Return Different each time.", (call A3A_fnc_shortID_create) isNotEqualTo (call A3A_fnc_shortID_create)],["Format: Mapping.", [0xaaf000,0xf1a001] call A3A_fnc_shortID_format isEqualTo "aaf000-f1a001"]];private _failedTests = [];private _passedTests = [];{if (isNil {_x#1}) then {_failedTests pushBack (_x#0);continue;};([_failedTests, _passedTests] select (_x#1)) pushBack (_x#0);} forEach _tests;private _results ="## Test Results" + endL +(if (count _failedTests > 0) then {"### Failed" + endL +"* " + (_failedTests joinString (endL + "* ")) + endL}else{""}) +(if (count _passedTests > 0) then {"### Passed" + endL +"* " + (_passedTests joinString (endL + "* ")) + endL}else{""}) + endL +"---" + endL;copyToClipboard _results;text ("Test Results Copied to Clipboard!                                                                                                                                                   " + endL + _results);
```

* 🆔 Added ShortID.

* ⏮ Intergrated PreJIP.
## What type of PR is this.
1. [ ] Bug
2. [ ] Change
3. [x] Enhancement

### What have you changed and why?
Information:
Adds Ace Drink Items by Default, as they can be used to Cool your Barrel.

Food Items are given at the start if the Parameter is enabled, food is only useful if Ace Field Rations is enabled.

### Please specify which Issue this PR Resolves.
closes nothing

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 
Start the Mission with and without the Parameter on, Water should always be given, Food only with the Parameter on.
********************************************************
Notes:
Add Ace Food and Drink Items + Parameter
#2185)

…n instead of faction specific

## What type of PR is this.
1. [x] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
Information: used both occ and inv vehicle pools for some of the vehicle selection in ai airport creation
    

### Please specify which Issue this PR Resolves.
closes #XXXX

### Please verify the following and ensure all checks are completed.

1. [ ] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [ ] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: 

********************************************************
Notes:
* fix incorrectly using mixed pool of occ and inv for AI arport creation instead of faction specific

* removed unneccesary OccAndInv macro in createAIAirplane
Fixed script errors in 3CB and #Example templates

## What type of PR is this.
1. [x] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
Information: Fixed scripting errors in templates:
- Templates/Templates/#Examples/Example_Logistics_Nodes.sqf:25 missing delimiter , in array literal
- Templates/Templates/3CB/3CB_AI_BAF_Arid.sqf:47 missing closing ] in array literal
- Templates/Templates/3CB/3CB_AI_BAF_Temperate.sqf:47 missing closing ] in array literal

### Please specify which Issue this PR Resolves.
n/a

### Please verify the following and ensure all checks are completed.

1. [ ] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
2. [ ] Yes (Please provide further detail below.)

### How can the changes be tested?
Steps: n/a

********************************************************
Notes:
## What type of PR is this.
* Bug
* Change
* Enhancement
* [x] Library Additions

### What have you changed and why?
* Added Garbage Collection Component of KeyCache.

### But What is KeyCache???
* KeyCache's goal is to reduce data sent over a network.
* It can achieve this by replacing commonly used identifiers with a shortID.
* However, this technology can be used to create translation tables for any data.
* Translations can go stale and expire, this is preferable for a DNS-like implementation where the server holds all translations, and the client only needs to use a translation for a short period.
* KeyCache is intended to be used as middleware before and after remoteExecution. Therefore, it cannot be directly called from another machine. Only the server can directly update translations on clients.
* The parent code must handle the propagation of translations.
* The most critical part of expiring translations is the garbage collector. Therefore, this PR will add that component.

### Tell us about this Garbage Collector
* This garbage collector finds stale translations and deletes them.
* A concurrent generational garbage collector was implemented. 
* Generational GCs are based on life's tough truth that most objects die young. See <https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals#generations> for a description.
* All new items are added to generation 0. If it not stale on this pass, it is promoted to generation 1.
* Generation 1 checks items at a slower pace. If items survive this pass, they are promoted to generation 2.
* Generation 2 checks items at an even slower pace. Items are not promoted past this point.



### Please verify the following and ensure all checks are completed.

* [x] Have you loaded the mission in LAN host?
* Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [x] No
* Yes

### What do I need to review?
* You don't need to review the fields under `/Tests/`
* All functions that have content need a review
* CfgRemoteExec can use a review as well.

### How can the changes be tested?
Steps: 
```sqf
/*
Run in order.
Make sure that the previous test finishes before starting next.
If the previous test failed, it's likely that the following will too.
*/

// Recommended
call compileScript ["functions\Utility\KeyCache\Tests\unitTest_garbageCollector_basicPromotion.sqf"];
call compileScript ["functions\Utility\KeyCache\Tests\unitTest_garbageCollector_timedPromotion.sqf"];
call compileScript ["functions\Utility\KeyCache\Tests\unitTest_garbageCollector_basicDeletion.sqf"];
// Will take ≈10 minutes. Game will still run at 60fps.
call compileScript ["functions\Utility\KeyCache\Tests\unitTest_garbageCollector_shortFpsStressTest.sqf"];
```


* 🛃 Blocked all keyCache functions from remoteExec.

* ♻ Cache-Based Generational Garbage Collectors.

* 🧪 GC Unit Tests and Stress Tests.

* 🪓 Split Unit Tests into 5 files.

* ⚙ keyCache varaibles accessed through config macro

* 📃 Added header to init.

* Disabled keyCache unitTestMode
## What type of PR is this.
1. [ ] Bug
2. [x] Change
3. [x] Enhancement

### What have you changed and why?
Information:
Removed all relevant hardcoded map info, like antenna and population values. Placed them in there own file that is call from the old file. Removed hardcoded outpost garrisons locations, placed them in the same file. And removed search in arrays for arid, temperate, tropic, and etc.... maps. Made them a string that is compared.
    

### Please specify which Issue this PR Resolves.
closes #1555

### Please verify the following and ensure all checks are completed.

1. [x] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [ ] No
2. [x] Yes (Please provide further detail below.)

### How can the changes be tested?
There are probably edges cases that I missed. 

********************************************************
Notes:
* moved pr

* changed worldsize

* Reorder Map specific cases for 3CB Factions

https://github.com/official-antistasi-community/A3-Antistasi/blob/5c5a53dc9d84a45fdfe4309e8e20d5c7066b95b7/A3-Antistasi/Templates/selector.sqf#L147-L179

This was lost in Move to Templates

Co-authored-by: Lazejun <[email protected]>
@stutpip123 stutpip123 changed the title github is bad third times the charm Nov 26, 2021
@stutpip123 stutpip123 merged commit 3dd0831 into stutpip123:unsung3 Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.