e1.6.0-v1.2.7 Modding Changes

Users who are viewing this thread

v1.1.0 Changes​

Greetings!

Patch v1.1.0 came to Beta last week. Here are the modding-related changes that came with it (apologies for posting with delay).
  • Improved scene checker code (editor side) in order to detect various spawn path placement problems.
  • The map camera implementation was separated from the map screen code for easier modding.
    • In response to the community request by Jansen via the modding discord.
  • A new attribute is_moving was added to the monster usage system. It allows specifying different actions in moving or stationary situations.
  • Enabled the ability to give banner tableaus to armor pieces. This change adds native support for armor pieces to have banner textures. It works the same way as shields, banner bearer items etc.
  • Fixed a bug that caused issues with asset importing if there were two modules with the same id.
  • Fixed SpCultures default xml to throw warnings when it has no cultures defined.
  • Animation clips can now be searched by their flags in the resource viewer.
  • Increased the ModifiedDamage compression info limits from 500 to 2000 and clamped the out of limit damage numbers to the min/max values.
  • AddGameMenu and GetGameMenu are now public.
  • Game menu options can work with related objects.
  • Fixed a crash that happens if the main hero talks with a hero that does not have any proper conversation lines. Now he/she says a default conversation line if proper dialog lines were not added.
We continue to work on other modding-related features/issues:
Thank you again for all your feedback and suggestions. If you have any questions or would like to make further requests, please discuss them below (or HERE).
Keep on with the great job!
@Dejan Any chance you have a look at my request?
@Dejan
Would it be possible to remove the "IsBanditFaction" check condition in the FactionManager class?
All the methods allowing to manage the relation between the factions have this check condition which result in the following:
It is impossible to set the hero faction neutral with any bandit faction.
C#:
        // Token: 0x06000AA1 RID: 2721 RVA: 0x00037308 File Offset: 0x00035508
        public static void DeclareAlliance(IFaction faction1, IFaction faction2)
        {
            if (faction1 != faction2 && !faction1.IsBanditFaction && !faction2.IsBanditFaction)
            {
                FactionManager.SetStance(faction1, faction2, StanceType.Neutral);
            }
        }

        // Token: 0x06000AA2 RID: 2722 RVA: 0x00037327 File Offset: 0x00035527
        public static void DeclareWar(IFaction faction1, IFaction faction2, bool isAtConstantWar = false)
        {
            if (faction1 != faction2 && !faction1.IsBanditFaction && !faction2.IsBanditFaction)
            {
                FactionManager.SetStance(faction1, faction2, StanceType.War).IsAtConstantWar = isAtConstantWar;
            }
        }

        // Token: 0x06000AA3 RID: 2723 RVA: 0x0003734B File Offset: 0x0003554B
        public static void SetNeutral(IFaction faction1, IFaction faction2)
        {
            if (faction1 != faction2 && !faction1.IsBanditFaction && !faction2.IsBanditFaction)
            {
                FactionManager.Instance.GetStanceLinkInternal(faction1, faction2).StanceType = StanceType.Neutral;
            }
        }

I understand it is a default stance you want to keep for the native game.
But in my case I would like to allow the player clan to at least become "neutral" with the bandits.
Maybe you could add a method that could be called by modders?
C#:
        public static void SetNeutralForModders(IFaction faction1, IFaction faction2)
        {
            if (faction1 != faction2)
            {
                FactionManager.Instance.GetStanceLinkInternal(faction1, faction2).StanceType = StanceType.Neutral;
            }
        }
 

v1.2.0 Changes​

Greetings!

Patch Beta v1.2.0 came out today and it's quite chunky! Here are the modding-related changes that came with it.

Editor
  • Fixed a crash that occurred when using the "Auto Generate Nav Mesh" functionality.
  • Fixed a crash that occurred when opening the Cloth editor via the console without first entering Editor mode.
  • Fixed a crash that occurred after closing the flora editor.
  • Modified the warning message that explains soft borders need to be present on the scene or flora may not appear correctly.
    • In response to the community request by @NPC99
  • Path points can now be snapped to the water level.
  • Fixed a bug that prevented the Max Height change option from working when using it for a single action with the Elevation or the Paint tool.

Combat
  • Added two new callbacks that allow modders to manually assign targets for AI agents. Agent.SetTargetAgent() allows modders to set a target agent but if they do not disable automatic target selection, our low-level AI will try to pick a new and different target agent when possible. To avoid that, Agent.SetAutomaticTargetSelection() can be used to disable automatic target selection, giving full control over the target selection process to the modders.
  • Added agent references to the AttackInformation struct to allow modders to use agent information in their damage calculations.

Campaign
  • Pathfinding can now be used with excluded face IDs. This enables you to allow or restrict the usage of a specific nav mesh face under set conditions. For example, AI agents on foot can be allowed to enter a specific area while restricting access to mounted AI agents. This also works on the world map, allowing you to restrict access of parties to certain areas based on set conditions.
  • Batte types are now part of their map event within the map event system.
  • Moved some of the MapEventHelper functions in Helpers to the MapEvent class. They’re now directly connected to their map event.
  • Separated PartyVisuals from PartyBase.cs. Deleted the IPartyVisual interface. All party visuals are now stored in PartyVisualManager.cs which is part of the Sandbox.View project.
  • Moved the Prosperity value from Settlement.cs to Town.cs.
  • Moved the skill level requirement for epic perk calculations to the CharacterDevelopmentModel, allowing modders to override them.
    • In response to the community request by gallickgunner on the Modding Discord.
  • Changed the way companion skills are defined (sandboxcore_skill_sets.xml), making them more easily moddable.
  • Removed the neutral faction. This used to be a catch-all faction to avoid crashes and bugs in some circumstances. The code has been refactored to work without such a design.
  • Fixed a bug that caused a custom race to not be applied on save/load for heroes generated with a template from a different race. For example, if a hero named Richard is created using a hero template with an Elf race, Richard will still be an Elf after save/load.

Multiplayer
  • Dedicated Servers
    • Fixed various crashes that occurred due to warmup behavior.
    • Merged the Custom Server Helper module into the base game. Players do not have to manually enable it to download maps from Dedicated Servers anymore.
      • In response to a popular community request.
    • Dedicated servers are now targeting .NET 6 instead of .NET Core 3.1.
    • Added a new console command "set_server_bandwidth_limit_in_mbps" and launch option "serverbandwidthlimitmbps" for limiting dedicated server bandwidth usage.
    • The "AutoTeamBalanceThreshold" option now accepts numbers instead of enum indices. This means that you can now set the auto team balance threshold from 0 to 30 players.
    • Added a new "DisableInactivityKick" option which if set to “true” disables automatic player kicks.
    • Added a new command line argument "use_parent_console” which forces the dedicated server to use the console it is launched from.
    • The welcome message is no longer displayed as a separate popup but is printed into the chat instead.
      • In response to the community request by @Gotha
  • Fixed a crash that occurred due to missing classes and perks of a modded faction.
  • Improved moddability of the AgentStatCalculateModel. GetWeaponDamageMultiplier and GetEffectiveSkill methods now accept the relevant agent as a parameter.
  • Added CalculateStrikeMagnitudeForMissile to the StrikeMagnitudeModel, making Missile damage moddable. Removed CalculateSpeedBonusMultiplierForMissile and integrated it into the default implementation of CalculateStrikeMagnitudeForMissile.
  • Moved some MP code into the Multiplayer module (modders might need to reference these new DLLs).
  • Fixed a bug with the RoundUp calculation of the Captain mode troop counts.
  • Fixed a bug that caused newly added faction banners not to show up on the Multiplayer screens.
  • Fixed a bug that prevented the scoreboard from resetting after a TDM warmup.

Audio
  • Added a new category called "music" to the module_sounds.xml. This allows modders to add music across all aspects of the game more easily.

Other
  • Fixed a bug that caused some textures added by new modules to be rendered incorrectly.


We continue to work on other modding-related features/issues:

Thank you again for all your feedback and suggestions. If you have any questions or would like to make further requests, please discuss them below (or HERE).
 
Recently i`ve run into issues modding the UI, specifically the banner icons and their UI in the in-game Banner Editor, as well as putting additional colors to the palette.
Unchecking any mod of that sort at launcher, the UI still remains in the Banner Editor, but as empty squares, while all the extra colors remain and the game crashes if you choose them while not playing with the mod checked.
The only solution to the icons UI is to delete the mod completely, while there is no solution for the still visible additional colors that crash the game if you chose them.
Part of the issue was already reported HERE, for the colors alone, the empty UI is not a big deal and everyone can just delete any mod, but it would be nice if a simple unchecking at launch would do the trick.
 
Last edited:
Hey all, please note that we've run into some issues and will likely be making the Modding Toolkit for v1.2.0 available next week.
 

v1.2.1-v1.2.7 Changes​

Greetings!

v1.2.x version series has been released to Live today. The hotfixes made during the Beta involved many modding-related changes so here's an overview of them:

v1.2.7​

  • Removed the readonly parameter from the Multiplayer Compression Info classes.

Beta v1.2.5 (23/11/23)​

  • Fixed a crash that occurred on the resource browser.
  • World Map Moddability
    • Removed the hardcoded texture (main_map_snow_flowmap) previously required for Dynamic Campaign (weather) Effects (located in the Terrain Property Browser) on the world map. It is now selected from the editor as a regular texture. Modders now no longer have to use the asset override mechanism (by having the same flowmap texture name as the native flowmap texture) to add a snow layer to the world map - instead, it's recommended that you use your own texture with a different name and select it in your custom world map scene.
    • Fixed a bug that prevented modded campaign maps from using high-resolution heightmaps. A low-resolution main_map_physics_heightmap texture is not required for campaign heightmaps and custom worldmaps can now be used without the Aurelian’s MapFix mod if saved as Main_map (as opposed to modded_main_map).
    • Fixed a bug that prevented world map floras from appearing. Previously, you had to enter and exit a mission scene to force the flora to appear.
    • Added modding support for the world map dynamic atmosphere.
    • Added modding support for color grade grid for the world map.
    • Added modding support for the battle scene index grid for the world map.
    • Added visualization sliders to the editor for easier tweaking of the world map snow map.
    • Added a console option to reduce framerate when the editor is not focused.
    • Improved layer editing and visualization in the Editor.
    • Overall bug fixes.
    • In response to reports from various modders (@Cozur, @hunharibo, @Lemmy1916, @Le_Profyteur and others). Massive thanks to @NPC99 for his continuous detailed feedback on world map modding.
  • Assertions will now be shown in the Editor Console once inside the "Editor Mode".
    • In response to the community request by Poheniks and FoozleMcDoozle
  • Added bulk shader compilation for mods. It's accessible via the “Compile Shaders” checkbox while publishing the module using the “Publish Module” functionality in the editor. It allows you to compile & ship the unique material shaders in your modules. This prevents long initial mod loading times.
  • Added the ability to define and use your own decals.
  • Fixed a bug that prevented texture move operations.
  • Added the ability to set tickrate for dedicated custom servers using the "/tickrate" command line argument or the "set_server_tickrate" console command.
    • In response to the community request by @Gotha

Beta v1.2.4 (28/09/23)​

  • Fixed a crash that occurred in the Cloth Editor if the cloth simulation wasn’t enabled in the config.
  • Fixed a crash that occurred if a mod changed the maximum number of workshops that a player could buy through the DefaultWorkshopModel.
    • In response to the community report by ing32
  • Removed the ConsiderMapEventsAndSiegesInternal function and created the PartyDiplomaticHandlerCampaignBehavior class. The effects of diplomatic changes can now be controlled via the latter class.
  • Fixed several issues related to the moddability of reloading ranged weapons.
  • Allowed the defining of class divisions with no perks.

Beta v1.2.3 (04/08/23)​


Beta v1.2.2 (21/07/23)​

  • Fixed a crash that occurred when entering a town of a modded custom culture.


We continue to work on other modding-related features/issues:

Thank you again for all your feedback and suggestions. If you have any questions or would like to make further requests, please discuss them below (or HERE).
 
Thank you for the continued effort to make our lives easier, Dejan (and the rest of the team of course). I know we're not the easiest to please, but these changes contain several major steps in the right direction, that already help us out in massive ways.
 
Thank you for the continued effort to make our lives easier, Dejan (and the rest of the team of course). I know we're not the easiest to please, but these changes contain several major steps in the right direction, that already help us out in massive ways.
+1000
 
@Dejan
Would it be possible to remove the "IsBanditFaction" check condition in the FactionManager class?
All the methods allowing to manage the relation between the factions have this check condition which result in the following:
It is impossible to set the hero faction neutral with any bandit faction.
C#:
        // Token: 0x06000AA1 RID: 2721 RVA: 0x00037308 File Offset: 0x00035508
        public static void DeclareAlliance(IFaction faction1, IFaction faction2)
        {
            if (faction1 != faction2 && !faction1.IsBanditFaction && !faction2.IsBanditFaction)
            {
                FactionManager.SetStance(faction1, faction2, StanceType.Neutral);
            }
        }

        // Token: 0x06000AA2 RID: 2722 RVA: 0x00037327 File Offset: 0x00035527
        public static void DeclareWar(IFaction faction1, IFaction faction2, bool isAtConstantWar = false)
        {
            if (faction1 != faction2 && !faction1.IsBanditFaction && !faction2.IsBanditFaction)
            {
                FactionManager.SetStance(faction1, faction2, StanceType.War).IsAtConstantWar = isAtConstantWar;
            }
        }

        // Token: 0x06000AA3 RID: 2723 RVA: 0x0003734B File Offset: 0x0003554B
        public static void SetNeutral(IFaction faction1, IFaction faction2)
        {
            if (faction1 != faction2 && !faction1.IsBanditFaction && !faction2.IsBanditFaction)
            {
                FactionManager.Instance.GetStanceLinkInternal(faction1, faction2).StanceType = StanceType.Neutral;
            }
        }

I understand it is a default stance you want to keep for the native game.
But in my case I would like to allow the player clan to at least become "neutral" with the bandits.
Maybe you could add a method that could be called by modders?
C#:
        public static void SetNeutralForModders(IFaction faction1, IFaction faction2)
        {
            if (faction1 != faction2)
            {
                FactionManager.Instance.GetStanceLinkInternal(faction1, faction2).StanceType = StanceType.Neutral;
            }
        }

I know this is borderline necro :grin: but recently I had come across a similar use case and it is possible to do what you want.

You can get the StanceLink object between 2 factions, by calling the GetStanceLink and setting the IsAtWar property directly.

As an example of what worked for me:

Code:
foreach (var chaosClan in chaosClans)
{
    if (chaosClan.IsAtWarWith(chaosBanditFaction))
    {
        var stance = chaosClan.GetStanceWith(chaosBanditFaction);
        stance.IsAtConstantWar = false;
        stance.IsAtWar = false;
    }
}
 
Back
Top Bottom