Giter VIP home page Giter VIP logo

x2wotccommunityhighlander's Introduction

X2WOTCCommunityHighlander

Welcome to the X2 WOTC Community Highlander Github project. This is where the work happens.

What version are we at?

We maintain two versions of the Highlander, published on the Steam Workshop:

  • Stable version that matches the latest GitHub release and has been tested a fair amount.
  • Beta version that is updated more frequently with changes from the master branch.

When using the Beta version, the Highlander's version in the lower right corner of the game's main menu will tell you which commit the beta version is based on.

What IS the X2WOTCCommunityHighlander?

Highlander replaces the game's main script package - XComGame. This allows the Highlander to alter portions of the game's code without using any ModClassOverrides to incorporate bugfixes and various ways for other mods to interact with the game's code without needing to use MCOs themselves, which would be bad for compatibility.

In other words, the purpose of the Highlander is to fix bugs and to improve compatibility between other mods.

As implied by the name, there can be only one Highlander. Therefore, it's important for the Highlander to address as many modding use-cases as possible, and incorporate bugfixes that would otherwise require Class Overrides to implement.

The original X2CommunityHighlander is an extension of the Long War 2 Highlander, which was built by the hard-working Pavonis Interactive team.

The X2WOTCCommunityHighlander provides a Highlander for the XCOM 2 War of the Chosen expansion.

How does it work?

As a mod user, you can simply use Highlander as any other mod.

As a modmaker and a potential contributor to the Highlander, learning the following could be beneficial. XComGame replacements can be loaded successfully into XCOM 2 only in one of two ways:

  1. As a cooked package (a .upk file). This is how the unmodified vanilla game works, and this is the way normally used by the Highlander.
  2. With the -noseekfreeloading switch, which is designed for debugging purposes.

You can learn more details from Abe Clancy's excellent post on the Nexus Forums.

Building Against Highlander

When is it necessary?

Building against Highlander is necessary when your mod intends to call a specific function or use a class that exists only in the Highlander, such as CHEventListenerTemplate or XComGameState_Unit::HasAbilityFromAnySource().

If the game attempts to execute code that uses these classes/functions, and the Highlander mod is not active, the game will hard crash, so Highlander will become a hard requirement for your mod.

If you build your mod against the Highlander, but don't use any of its features, your mod will not have Highlander as a hard requirement, so there are no downsides to building your mod against the Highlander in this regard.

Building against Highlander is NOT necessary if your mod:

Highlander will still be required for your mod to work properly, but you don't need to build your mod against it.

How to build your mod against the Highlander?

You need to replace the source code in the XCOM 2 SDK with the source code of the Highlander. Here's how:

  1. Subscribe to Highlander, if you haven't already.

  2. Close the Modbuddy, if it's open.

  3. Locate the SDK folder that contains the source code:

..\steamapps\common\XCOM 2 War of the Chosen SDK\Development\

  1. Delete the Src folder. Yes, really.

  2. Make a backup of the SrcOrig folder.

  3. Locate the Highlander source code folder:

..\steamapps\workshop\content\268500\1134256495\Src\

  1. Copy the contents of Highlander's Src folder into the SrcOrig in the SDK source code folder, overriding duplicate files.

From here: ..\steamapps\workshop\content\268500\1134256495\Src\

To here: ..\steamapps\common\XCOM 2 War of the Chosen SDK\Development\SrcOrig\

  1. The result should look like this.

Done. Now your mods can take full advantage of Highlander's features.

Highlander Development

Highlander is a community project and everybody is welcome to contribute. Feel free to file a Pull Request for any of the open Issues and wait for a maintainer to review and merge it. You can also file new Issues.

Discussion channel

For the most part, discussion happens in the #highlander Discord channel of the XCOM 2 modmaking Discord server. It is our platform of choice for lengthy discussions that don't fit GitHub issues.

Code style

The code style is what is generally in use for the XCOM 2 codebase:

  • Tabs (width: 4 spaces)
  • Braces always on a new line
  • Liberal use of space between blocks
  • Braces even for one-line if/else bodies

The following code should illustrate all of this:

static function CompleteStrategyFromTacticalTransfer()
{
	local XComOnlineEventMgr EventManager;
	local array<X2DownloadableContentInfo> DLCInfos;
	local int i;

	UpdateSkyranger();
	CleanupProxyVips();
	ProcessMissionResults();
	SquadTacticalToStrategyTransfer();

	EventManager = `ONLINEEVENTMGR;
	DLCInfos = EventManager.GetDLCInfos(false);
	for (i = 0; i < DLCInfos.Length; ++i)
	{
		DLCInfos[i].OnPostMission();
	}
}

Documenting your Contributions

Generally, Highlander changes will be weaved into vanilla code in ways that require us to keep close track of what code changes what vanilla behaviour, and for what purpose. To do this, we comment code precisely to match with issues created on Github at:

https://github.com/X2CommunityCore/X2WOTCCommunityHighlander/issues

Every change has a tracking issue, where the problem is described along with a use case for the Highlander change. This applies to bugs, enhancements, and new features.

Any code you write should be documented to include the issue it addresses, either as a single line comment, or as a start and end block. Don't forget to mark any variables added for that issue, as well.

We should be able to find every line of code related to an issue by searching for "Issue #928" (or whatever) in the codebase. In addition, any commits related to that issue should also have the issue number marked in the same way.

Additionally, every feature should be documented with inline documentation that will be published via GitHub Pages (at https://x2communitycore.github.io/X2WOTCCommunityHighlander/). That online documentation also has instructions for how to write your documentation and run the documentation tool.

Building the Highlander

  1. Make sure you have the full content SDK installed (full_content branch in Properties->Betas->full_content). This requires about 90 GB of disk space.
  2. The custom version of the X2ModBuildCommon built into Highlander's mod project requires Git, so make sure you have Git installed. You can download the Git installer from the official website. Note that Git embedded into some of the Git GUI apps like Source Tree is not enough, it must be a separate Git installation.

Once you have satisfied these requirements, you should be able to build the Highlander like any other mod.

Cooking a Final Release (Automated method)

Build the mod using Default/Final release (ModBuddy) or cooked/final release (VSCode) profiles

Cooking a Final Release (Manual method)

One-time preparation

The following instructions are functionally the same as those of a vanilla Highlander mod. All the below references to the root Steam directory are made as %STEAMLIBRARY%. You should replace them with your actual Steam directory folder, such as: "D:/SteamLibrary", or whatever.

A few files need to be copied into the SDK for you to successfully cook the Highlander. Check the folder %STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\XComGame\CookedPCConsole and copy the following files to %STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\XComGame\Published\CookedPCConsole:

GuidCache.upk
GlobalPersistentCookerData.upk
PersistentCookerShaderData.bin
*.tfc

Additionally, you need to install the complete SDK (full_content branch in Properties->Betas->full_content). This requires about 90 GB of disk space.

Cooking

Start by building the mod through ModBuddy, as you normally would. Then, enter the command line and run the following commands:

"%STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\Binaries\Win64\XComGame.exe" make -final_release -full
"%STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\Binaries\Win64\XComGame.exe" CookPackages -platform=pcconsole -final_release -quickanddirty -modcook -sha -multilanguagecook=INT+FRA+ITA+DEU+RUS+POL+KOR+ESN -singlethread

If a message like "Scripts are outdated. Would you like to rebuild now?" pops up, click "No".

The commands above create cooked files for your XComGame, Engine, and Core package replacements in %STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\XComGame\Published\CookedPCConsole:

XComGame.upk
XComGame.upk.uncompressed_size
Engine.upk
Engine.upk.uncompressed_size
Core.upk
Core.upk.uncompressed_size

Copy those files into a folder called CookedPCConsole inside the mod's output folder. You will need to delete Script\XComGame.u, Script\Engine.u and Script\Core.u, now that we've put the cooked script file in it's place.

Once you've done all that, the mod should now run in vanilla XCOM. Note that all logging statements will be stripped from the Cooked version, so don't expect to see any of your script logs.

Using NoSeekFreeLoading

Using the -NoSeekFreeLoading launch argument is required if you intend to use Unreal Debugger to interact with classes in the XComGame script package.

In order to be able to actually run the game with NoSeekFreeLoading without crashing, you must use it alongside an uncooked Highlander, and you must also provide the game with the uncooked Content files, which you can get from the full content SDK.

  1. Install full_content version of the SDK.

  2. Ensure symlinks from the main WOTC folder point to the same folders within the SDK. Delete the following folders/links if they exist:

%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\XComGame\Content
%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\XComGame\Script
%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\XComGame\__Trashcan
%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\Engine\Content
%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\Engine\EditorResources

...and then open a command prompt as an administrator and run the following commands:

mklink /J "%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\XComGame\Content" "%STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\XComGame\Content"
mklink /J "%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\XComGame\Script" "%STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\XComGame\Script"
mklink /J "%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\XComGame\__Trashcan" "%STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\XComGame\__Trashcan"
mklink /J "%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\Engine\Content" "%STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\Engine\Content"
mklink /J "%STEAMLIBRARY%\steamapps\common\XCOM 2\XCom2-WarOfTheChosen\Engine\EditorResources" "%STEAMLIBRARY%\steamapps\common\XCOM 2 War of the Chosen SDK\Engine\EditorResources"
  1. Build the Highlander using the "Debug" profile.

  2. You can now use the -NoSeekFreeLoading launch argument to start the game with the uncooked Highlander. This can be done by running XCOM with the following command (in the command prompt):

"%STEAMLIBRARY%\steamapps\common\XCOM 2\Binaries\Win64\Launcher\ModLauncherWPF.exe" -allowconsole -log -autodebug -noseekfreeloading -noStartUpMovies

If all goes well, the XCOM Launcher will run. Enable X2WOTCCommunityHighlander and start the game.

You can also use the same launch arguments in the Alternative Mod Launcher.

Recruiting Maintainers

We are currently recruiting maintainers.

The Community Highlander mod is the backbone of the XCOM 2 modding community, providing essential functionality that powers many of the most popular mods, but it cannot evolve without active maintainers, which means new mods are unable to get the functionality they need into the Highlander.

So we are looking to recruit as many maintainers as possible.

Required qualifications

  • Experience making XCOM 2 mods and coding in Unreal Script.
  • Being familiar with Git or at least willingness to learn using it.
  • Perfectionism and attention to detail.
  • Knowledge of different XCOM 2 systems, such as visualization, state code, effects, and history, is welcome, but not a hard requirement.

Responsibilities

  • Reviewing Pull Requests and suggesting changes to ensure compliance with Highlander's requirements and guidelines.
  • Updating the workshop version of Highlander when enough Pull Requests are approved.

Compensation

  • A sense of pride and accomplishment associated with doing useful things for hundreds of thousands of people.
  • First row seat to contributing your own changes to the Highlander.

x2wotccommunityhighlander's People

Contributors

abatewongc avatar blackdog86 avatar boundir avatar bountygiver avatar brood avatar cannonfodder1 avatar copyrite avatar daakru avatar favid avatar fearthebunnies avatar gingeravalanche avatar grobobobo avatar honeytheyellowbear123 avatar hudsonsavage avatar iridar avatar jmartinez989 avatar kongmd-steam avatar malucomarinero avatar mrniceuk avatar musashi1584 avatar onidotmoe avatar pledbrook avatar ps2guides avatar realitymachina avatar reddoby avatar remcoros avatar robojumper avatar shiremct avatar tedster59 avatar xymanek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

x2wotccommunityhighlander's Issues

Port CanAddItemToInventory hook from base game highlander + add UI support for it

This was a useful function added in X2DownloadableContentInfo to allow mods to define their own rules for certain items, as to let them be equipped by certain types of units if the standard rules couldn't cover the intended usage.

That said, a weakness of it was that there was no way to tell the user why they couldn't equip an item, and this could cause misidentifications of a bug.

This could be resolved by expanding on GetDisabledReason() in UIArmory_Loadout to include another DLC hook, something like HaveDisabledReasonForItem(), where a mod could send back a string if it's disabling the current item being checked from being equipped for that unit.

Ensure that soldiers doesn't contain the abilities that can be added by training center

Currently, the X2SoldierClassTemplateManager.GetCrossClassAbilities(optional X2SoldierClassTemplate ExcludeClass) doesn't check against abilities that the soldier class itself has.

This can happen for example when bAllowAWCAbilities is set to true for sparks, this allows both sparks and grenadiers the possibility to get "Shredder" as a trainable perk.

Max Tactical Autosaves

@maluco I'd like to request a very, very easy unprotecting/configurability of a variable.

class XComAutosaveMgr extends Actor dependson(XComOnlineEventMgr);

const MAX_TACTICAL_AUTOSAVES = 3;

There's really no reason to limit the game to 3 saves (they are so small), and since sometimes saves get corrupted it would be nice to be able to rollback to a previous one that works during a tactical mission.

Thank you.

Fix SoundCue NarrativeMoments

The game ends SoundCue narrative moments after three seconds because it assumes they fail to play.

Relevant code in UINarrativeMgr

m_arrConversations[0].AudioComponent.OnAudioFailedToPlay = OnAudioFailedToPlay;
// ...
function OnAudioFailedToPlay(AudioComponent AC)
{
    UpdateConversationDialogueBox();
    SetTimer(FailedAudioDuration, false, nameof(EndCurrentConversation));
} 

However, OnAudioFailedToPlay is commented like this:

/** assign this delegate to get a notification when this AudioComponent knows has failed to play a wise event */
delegate OnAudioFailedToPlay(AudioComponent AC);

It always fires on SoundCues that do not have an AkEventOverride. This breaks Mod-added narratives!

XComGameState_Item weapon upgrade UI does not support damage weaponupgrades

GetWeaponStatsForUI() does not check for damage modifying weapon upgrades

GetUpgradeModifiersForUI(X2WeaponUpgradeTemplate UpgradeTemplate) uses UpgradeTemplate.BonusDamage.Damage > 0 to solely identify MissDamage, rather than damage and UpgradeTemplate.BonusDamage.Tag=="Miss" so that an upgrade improving normal damage can get a UI stat markup.

Have the Assassin's forced strength be added before other traits

The specific issue is specifically in XComGameState_AdventChosen's AssignStartingTraits(), as it will forcefully assign Shadowstep to the Assassin if the narrative's enabled, after initial weaknesses have been chosen randomly.

This means that an Assassin can roll with traits that shouldn't appear on a Chosen with shadowstep. This should be able to be fixed via alteration of when the game checks if it should give the narrative trait to the chosen getting its starting traits.

Community Highlander not working correctly

Hello, I have seen this problem in the steam website, and in this forum as issue #69. The issue is that, I put the folder onto the xcomegame/mods folder at war of the chosen directory,
I see the mod when I open it in ModLauncherWPF, and I enable it for War of the Chosen, but when I open the game, the version string does not appear at the lower right corner of the screen in the main menu, meaning its nominally loaded but not recognized in game. I have tried reinstalling the game, uninstalling all mods,using an older version of the highlander, and trying to only use the highlander, but even then it does not work ,(the version does not show up on the lower right corner, and all mods I try with it as a requirement miss textures).

I need help to solve this issue.
Best regards.

Register Strategy X2EventListeners when loading into strategy directly

Fix an issue in the base game where Strategy X2EventListenerTemplates only register when going from tactical to strategy, not when loading into strategy in any other form.

Changes are needed in XGStrategy.state'LoadingGame', maybe also XGStrategy.state'StartingDebugCheatGame' and XGStrategy.state'StartingFromTutorial'.

Let enemy units show proper names if available.

While not that important, it would be nice to have any assigned names to enemies properly show up on them.

The specific function for this is GetName() in XComGameState_Unit, an edit so it would allow enemies to show a proper name if strFirstname or strLastName aren't empty should be sufficient.

Fix Ammo Slot item moving into Utility Item slot when soldier does not fill up all utility items slot.

Currently, when populating the utility items in UIArmory_Loadout, it gets a list of all items in the eInvSlot_Utility of the unit OR any items in other slot that has the default slot set to eInvSlot_Utility, but exclude only items equipped in eInvSlot_GrenadePocket. This can lead to items equipped in the ammo slot to be displayed as equipped in utility slot when not all utility item slots are used, or lead to utility items getting pushed out of the list if the ammo item has a lower index than the utility items and all utility items slots are used.

To fix, make class'UIUtilities_Strategy'.static.GetEquippedUtilityItems properly exclude any items that are equipped in the eInvSlot_AmmoPocket

List of almost every WotC-relevant Fix Mod

Thought this might be useful

(NEW LIST BELOW)

Also Ruler Nerf Nerf 1123973745 might be worth including since it touches on an unintended exploit. Fusion Ripjack Applies Stun 1128495039 is also worth considering since by default, the beam ripjack is a downgrade from the magnetic ripjack.

Ability Interaction Fixes and Damage Flyover Fix conflict with each other because they both fix different flyover texts.

Crashing on Mission Start

I've got quite a few mods however using the Highlander and Fulton Extraction Mods seem to be crashing it every time I start a mission. if this has already been resolved please show me.

Allow standard idle animations for suppressing units that do not have a specific suppression idle set up

Basically a follow-up to #45. That one affects weapons (which allows Assault Rifles and similar weapons to work with suppression), but using that for enemies (such as the viper) doesn't look good:
https://www.youtube.com/watch?v=HK2Lebzwgrc

This is because of this code in XComIdleAnimationStateMachine:

AnimParams.AnimName = 'FF_FireSuppressIdle';
AnimParams.Looping = true;
if( Unit.m_bSuppressing )
{
	UnitPawnNative.GetAnimTreeController().PlayFullBodyDynamicAnim(AnimParams); // idle until we shoot again
	Sleep(((Rand(100) / 100.0f)*2.0f) + 1.5f); // only shoot every 1.5-3.5 seconds when supressing (an addition 0.5 after target peeks)
	goto('Firing');
}

Very few weapons grant FF_FireSuppressIdle, even Assault Rifles only do because Firaxis included them for some reason.

An easy fix is to just check if the unit can play this animation, and if not, use NO_IdleGunUp instead (which is used for blending from to in vanilla). This looks much better:
https://www.youtube.com/watch?v=x3Ie3gjFXio

In case this animation can't be played as well, just freeze the unit for the time it's waiting.

Should we report base game issue ?

Hello,

If I understand correctly this mod provides an easier way to mod the base game AND will provide unofficial bugfix ?

If the bugfix part is correct should we report base game bug here ?

Weapon attachment screen (basegame - cosmetic)

I don't know if you noticed, but in base game the weapons used to move when you were in the attachment menu, this doesn't work anymore.

Every weapon seems to be affected by that (Spark also, but since there were not allowed to use attachment I suppose that Firaxis didn't code any movement for them.

To be more specific https://youtu.be/ISTbsrqpzgg?t=168 (this is just a random video on YouTube with attachment) so you can see what i mean when "weapon don't move"

Initiative-Interrupting Reinforcements gives them an extra turn

"Summoning Sickness" is a flag on a AIGroup that prevents them from being granted a turn. It is set when the Group scampers, and reset when the associated player's turn begins.

There is an issue in BeginInitiativeTurn that resets it whenever the player's turn begins or is resumed.

if( CachedUnitActionPlayerRef.ObjectID == CachedUnitActionInitiativeRef.ObjectID )
{
	ResetHitCountersOnPlayerTurnBegin();
	
	// ...

	if( !bResumeFromInterruptedInitiative && !bBeginInterruptedInitiative )
	{
		// Trigger the PlayerTurnBegun event
		EventManager = `XEVENTMGR;

			// build a gamestate to mark this beginning of this players turn
			Context = class'XComGameStateContext_TacticalGameRule'.static.BuildContextFromGameRule(eGameRule_PlayerTurnBegin);
		Context.PlayerRef = CachedUnitActionPlayerRef;

A fix is to move ResetHitCountersOnPlayerTurnBegin(); into the if block. This also prevents it from resetting Hit/Miss streaks when the initiative interruption is done.

Streamline code for number of utility item slots and add DLC Hook.

In the vanilla Highlander, there was a function GetNumUtilitySlots() (see X2CommunityCore/X2CommunityHighlander#114 ). It was called wherever some code would change / reset the number, and expected an override number. This made a lot of code more ugly than it already is.

In WotC, it gets worse. Consider this code that handles unequipping a piece of armor:

case eInvSlot_Armor:
	if(!IsMPCharacter() && X2ArmorTemplate(Item.GetMyTemplate()).bAddsUtilitySlot)
	{
		if (!HasExtraUtilitySlotFromAbility())      //  don't lower the bonus if one is given via an ability
		{
			SetBaseMaxStat(eStat_UtilityItems, GetMyTemplate().GetCharacterBaseStat(eStat_UtilityItems));
			SetCurrentStat(eStat_UtilityItems, GetMyTemplate().GetCharacterBaseStat(eStat_UtilityItems));
		}
	}
	break;

This is bad. All code that handles the utility item stat needs to be aware of any other systems that touch the slot number.

I would use a slightly different approach: A function called RealizeNumUtilitySlots() that can be called whenever anything happens that would modify utility slot numbers, and an additional DLC hook that allows mods to modify / override this number. This function would always run all the checks: Character Base Stat, Bonus Armor Slot, Tactical Rigging, DLC Hooks, and then set the character stat. Sensible places to do this are equipping / unequipping items, buying abilities.

This function should then be the only code that sets this stat (except TQL / dev tools, cheats and MP).

Community Highlander working but not really

Hi, I'm having issues with some (=most) of the textures for LW secondary weapons that the highlander makes possible for other mods to use not showing up at all. I'm using "A Better Barracks" that uses the LW secondaries and had all the pre requisite mods installed already (highlander and missing resources) but for w/e reason the only LW secondary weapon that had a model was the vibroblade T2. The T1 looked like the standard T1 sword, and the T3 blade was also not showing up. They work from a gameplay standpoint, the perks attached to them work, the fire and provide +aim and stuns and everything, I just cant see them doing it lol. I tried refreshing the .ini files and that didn't help.

I tried uninstalling all mods and doing an .ini refresh, then installed only missing resources, highlander and LW secondary weapons to see if it was any incompatibility with some of my other mods, but that didn't worked.

I also tried contacting the mod creators for "A Better Barracks" and "LW secondary weapons", and it seems the issue lies with Highlander. Apparently I was supposed to see a number version of highlander on the corner of the main menu, but I don't. I tried reinstalling highlander countless times and nothing.

Add event trigger in XComGameStateContext_WillRoll

Add a simple event trigger in XComGameStateContext_WillRoll.ContextBuildGameState(). This allows mods to make simple changes to the resulting game state, add visualization (via PostBuildVisualization), ...

Create a mod friendly way to manipulate loot tables

Although loot tables are already deprivatized there is no common way to add/remove loot.
There are some caveats involved,e.g. loot chances must be recalculated per rollgroup when a loot table is edited.
A simple helper class with static methods would go a long way in providing a unified interface for mods to interact with loot tables without the hassle of ini entry manipulating.

For pre start state manipulation of loot tables use the static methods in OnPostTemplatesCreated like this
class'X2LootTableManager'.static.AddEntryStatic(LootTableName, LootTableEntry);

At runtime you can use the singleton instance like

LootManager = class'X2LootTableManager'.static.GetLootTableManager();
LootManager.AddEntry(LootTableName, LootTableEntry);
LootManager.InitLootTables();

this will also reinitialise the loot tables.

For bulk add to loot tables you can move the chance recalculation to the end:

LootManager.AddEntry(TableName, EntryToAdd, false);
LootManager.AddEntry(TableName, EntryToAdd, false);
LootManager.AddEntry(TableName, EntryToAdd, false);
LootManager.RecalculateLootTableChance(TableName);

This way your chance ratio is preserved.

UIStrategyMap.uc does not show custom faction HQ icons

The specific offender is the function UpdateMissions(), as the if check for faction HQs assumes that any haven with a faction HQ attached it will be one of the vanilla three factions to init, as so:

               FactionHQ = XComGameState_Haven(ScanSite);
                if(FactionHQ != none)
                {
                    numHQ++;
                    switch (FactionHQ.GetResistanceFaction().GetChampionClassName())
                    {
                    case 'Skirmisher':
                        MissionItemUI.MissionIcons[1].SetScanSite(ScanSite);
                        break;
                    case 'Reaper':
                        MissionItemUI.MissionIcons[0].SetScanSite(ScanSite);
                        break;
                    case 'Templar':
                        MissionItemUI.MissionIcons[2].SetScanSite(ScanSite);
                        break;
                    }
                    
                }

This should be relatively easy to fix by altering this function to account for the possibility of mod-created factions, both for the actual initialization of the icon and for the NumHQ check so it doesn't think the center three icons are filled when they are not.

Prevent certain classes from rolling AWC abillities

I have two classes which do not have AWC abilities. The Samurai and the SpecOps class.

The samurai wouldnt even benefit from 90% of the AWC abilities because his primary weapon is the sword.

Either way i want these classes to behave like normal classes and don't want them to be Hero classes or get AWC abilities. I just just want to allow them to participate in the Combat Intelligence / Ability Points System.

This can be achieved by a config array of class names that prevent certain classes from rolling awc abilities in XComGameState_Unit.RollForTrainingCenterAbilities() as @robojumper suggested.

This way you could also give Sparks access to the Combat Intelligence / Ability Points System without having them AWC abilities as an example.

Cooked Highlander crashes to desktop when used on MacOS

It is reported that the highlander does not work on MacOS. To test, we've cooked up a highlander that ONLY adds a version template and a version check of 9.9.9. If this lightest touch is not functional, it is likely an issue that requires a fix upstream from Firaxis/Feral to allow for cooking highlanders for all platforms, not just windows.

If you wish to help test this on MacOS, do the following:

  1. Download the Blank Highlander linked below.

X2WOTCCommunityHighlanderBlankTest.zip

  1. Unhide the Library folder in your home directory.
  2. Unsubscribe from the Community Highlander and delete the folder: ~/Library/Application Support/Steam/steamapps/workshop/content/268500/1134256495 to remove all traces of the highlander.
  3. Extract the Blank community highlander to ~/Library/Application Support/Steam/steamapps/common/XCOM 2/XCom2-WarOfTheChosen/XComGame/Mods

When you run XCOM 2 it should show the X2WOTCCommunityHighlander WITHOUT the steam icon next to it. Try to run with only the highlander, and report whether the game loads or not.

If it works properly, you should see a version number of 9.9.9 on the bottom right of the main menu screen.

Improved Handling of Soldier Ranks over 7

Ever since Long War 2 the modding community standard for custom classes has shifted to 8 ranks with 3 abilities per rank. While more than 2 abilities per rank are fairly easily implemented more than 7 ranks is not.

Ideally 7 rank soldiers and soldiers with higher amount of ranks should peacefully coexist. But the moment you implement an experience table rank entry for 8 or higher things go wonky. And the solutions tend to live in XComGameState_Unit.

I'm not aware enough of the codebase as a whole go give comprehensive suggestions for what to do here but I've got some starting points.

First and most obvious:

2:57 PM]  robojumper: Right, `GET_MAX_RANK is global for everyone
[2:58 PM] robojumper: X2SoldierClassTemplate has a function GetMaxConfiguredRank()
[2:58 PM] robojumper: We should probably replace calls to `GET_MAX_RANK with those
[2:59 PM] robojumper: Care to open an issue in the HL?

Second:

When calling a XComGameState_Unit.GetRankAbilities(int Rank) for an unavailable rank it returns the squaddy rank Abilities. I suggest it instead return EmptyRankAbilities.

High use of BaseGameClass XComPathingPawn

Peek From Concealment and Gotcha Again require a really hacky patch to be compatible with one another that also requires an ini edit if they're not loading in the right order.

http://steamcommunity.com/sharedfiles/filedetails/?id=1136981000

Furthermore, Perfect Information, another popular mod, conflicts with this fix as well as Gotcha Again.

Would be cool if Highlander could help sort out this compatibility clusterfuck, specifically with XComPathingPawn.

XComGameStateContext_WillRoll.uc - prevent excessive will loss on multi-part missions

This hasn't been solved for base WOTC yet, but since the Highlander is replacing the will roll script file anyway, I figure it would be easier to implement a fix here.

This is the code directly involved in the will roll on mission start:

if(RollInfo.MaxWillPercentageLostPerMission > 0)
		{
			// get the unit's will at the start of the mission
			History = `XCOMHISTORY;
			StartOfMissionUnit = XComGameState_Unit(History.GetGameStateForObjectID(InSourceUnit.ObjectID,, History.FindStartStateIndex()));
			MaximumWillLossPerMission = RollInfo.MaxWillPercentageLostPerMission * InSourceUnit.GetMaxStat(eStat_Will);
			MinimumAllowedWill = max(MinimumAllowedWill, StartOfMissionUnit.GetCurrentStat(eStat_Will) - MaximumWillLossPerMission);
		}

Here's a list of secondary and tertiary mission part names:

if(MissionTemplate == 'LostAndAbandonedC')
'LastGiftB'
'LastGiftC'
'ChosenShowdown_Assassin'
'ChosenShowdown_Warlock'
'ChosenShowdown_Hunter'
'AssaultFortressLeadup' (not sure if this is the first part)`
'DestroyAvatarProject'

I think changing if(RollInfo.MaxWillPercentageLostPerMission > 0) to if(RollInfo.MaxWillPercentageLostPerMission > 0 && MissionTemplate != 'LostAndAbandonedC' || etc...) might work, but that wouldn't easily expandable if modders implemented multi-part missions of their own.

Make CharacterPoolManager use the Forced Country in CreateCharacter

Edit: The characterPoolManager is passed in a parameter for ForcedCountry that is never used in the creation of a solider in the CreateCharacter function.

In addition, I'm looking to work with the CharacterPoolManager, however right now this is a class that cannot be overridden. It was done in the vanilla highlander so I assume that it is possible here. This functionality would be a lot of help if added to the Highlander.

I am willing to work on this if someone breaks down on a high level what is required for the task
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.