Giter Site home page Giter Site logo

rtmodificationtemplate's People

Contributors

owlcatopensource avatar vmchar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rtmodificationtemplate's Issues

UberLogger extension

Can we get a string[] details field for LogInfo entries (and Logger.Log overloads that would use it). Certainly I'm not the only one whose debug logs are extremely verbose. I don't know how DebugScope deals with it on developers side since it's cut away from the release version, but I would love to have details of the message to be printed down in that part of UberConsole interface reserved for exception StackTrace. Just re-use the same code for Callstack printing in the UberLoggerAppWindow.DrawLogDetails() when there's no actuall callstack. (изменено)

So, UberLoggerAppWindow.DrawLogDetails() currently has this piece of code:{{ if (logInfo?.Callstack != null) { for (int i = 0; i < logInfo.Callstack.Count; i ) { string formattedMethodName = logInfo.Callstack[i].GetFormattedMethodName(); if (!string.IsNullOrEmpty(formattedMethodName)) { //here goes drawing code } } }}}I would like logInfo to have another field details so that we could{{ else if (logInfo?.details?.Count > 0) { for (int i = 0; i < details?.Count; i ) { string detail= details[i]; if (!string.IsNullOrEmpty(detail)) { //here goes drawing code } } }}}It's probably too late for WotR, but may come in handy in RT. Just a sugggestion though

UnitCommandsRunner.MoveSelectedUnitsToPointRT is a massive method and hard to mod for movement speed. Please factor it... Pretty please with sugar on top ^_^

Please look at the code for the following method in UnitCommandsRunner

        public static unsafe void MoveSelectedUnitsToPointRT(
                Vector3 worldPosition,
                Vector3 direction,
                bool preview = false,
                float formationSpaceFactor = 1f,
                List<BaseUnitEntity> selectedUnits = null,
                Action<BaseUnitEntity, MoveCommandSettings> commandRunner = null
            ) {

and try to factor out the different pieces that construct the different movement commands so a modder can patch the behavior without having to copy and paste 134+ lines of code

ErrorWithReport method extension for LogChannels

ErrorWithReport method extension for LogChannels (declared in LogChannelEx) is trying to{{QAModeExceptionReporter.Instance.MaybeShowError(text, null, ctx);}}The release version of the game does not initialize this Instance and therefore causes a null pointer exception when trying to log down the actual error, preventing any useful information from being reported. There's a similar problem with ReportInternal method extension (declared in ElementLogicException) which makes use of Element.AssetGuidShort and fails, because modders generally do not provide names to their elements (we probably should, but a null check is still desirable). We could fix it for ourselves, but for the most part we need logs from end users who'd still have this problem

EventHandler re-init

here's a code problem which me and other modders reported through the community manager on the mod-dev channel (before I got access to this channel) when beta started, and looks like this problem hasn't reached you: Generic type Kingmaker.RuleSystem.Rulebook.EventHandler is a singleton which re-uses the same instance (as to not allocate memory too often I assume?). It is cleaned after each use and re-ensured for next one. Ensure method forgets to copy Modding Template delegates m_BeforeEvent and m_AfterEvent from the event into the handler - the instance constructor does it, so it works for the first event of each type T and that's it. According to Vek it was working fine until around last September when Clean method was changed (or introduced?) and this nifty thing still is not fixed. Another problem I would enjoy to be looked upon is Shared localized strings. Kingmaker.Localization.LocalizedString class has field Shared of the SharedStringAsset type which is a subtype of Unity ScriptableObject. Please put a [DefaultValueHandling.Ignore] attribute on it. Every LocalizedString created through the Template ends up with this field even if it's null. And when the game is loading, it causes massive spam of Unity warning with stack traces. Homebrew Archetypes mod alone is enough to make logs unreadable, if Rogue Trader will have more people using the Template, this will become a chaos

Please give modders a working way to output to the in game combat log. We can do our own localization

In Wrath ToyBox likes to output messages like these
image

I used code like this cs var message = new CombatLogMessage("ToyBox".blue() + " - " + text, Color.black, PrefixIcon.RightArrow); var messageLog = LogThreadService.Instance.m_Logs[LogChannelType.Common].FirstOrDefault(x => x is MessageLogThread); var tacticalCombatLog = LogThreadService.Instance.m_Logs[LogChannelType.TacticalCombat].FirstOrDefault(x => x is MessageLogThread); messageLog?.AddMessage(message); tacticalCombatLog?.AddMessage(message);

Similar code on Rogue throws an exception

image

System.FormatException: Input string was not in a correct format.
   at System.Text.StringBuilder.FormatError() (in :0)
   at System.Text.StringBuilder.AppendFormatHelper(System.IFormatProvider,System.String,System.ParamsArray) (in :0)
   at System.String.FormatHelper(System.IFormatProvider,System.String,System.ParamsArray) (in :0)
   at System.String.Format(System.String,System.Object[]) (in :0)
   at Kingmaker.UI.Models.Log.GameLogCntxt.GameLogContext.LogErrorGet(System.String) (in Assets\Code\UI\Models\Log\GameLogContext\GameLogContext.cs:190)
   at Kingmaker.UI.Models.Log.GameLogCntxt.GameLogContext.CheckScopeGet() (in Assets\Code\UI\Models\Log\GameLogContext\GameLogContext.cs:140)
   at Kingmaker.UI.Models.Log.GameLogCntxt.GameLogContext.GetIcon() (in Assets\Code\UI\Models\Log\GameLogContext\GameLogContext.cs:157)
   at ToyBox.Main+<>c.<Load>b__17_0(System.String) (in C:\Users\PC\source\repos\ToyBox\ToyBox\classes\MainUI\Main.cs:110)
   at ModKit.UI+KeyBindings.OnUpdate() (in C:\Users\PC\source\repos\ToyBox\ModKit\UI\KeyBindings\KeyBindings.cs:113)
   at ToyBox.Main.OnUpdate(UnityModManagerNet.UnityModManager+ModEntry,System.Single) (in C:\Users\PC\source\repos\ToyBox\ToyBox\classes\MainUI\Main.cs:334)
 --- End of Exception Stack Trace ---
   at UnityModManagerNet.UnityModManager+ModEntry+ModLogger.LogException(System.String,System.Exception) (in Assets\Code\OwlCatUnityModManagerSource\Log.cs:61)
   at UnityModManagerNet.UnityModManager+UI.UnityModManagerNet.UnityModManager+UI.Update_Patch2(UnityModManagerNet.UnityModManager+UI) (in :0)```

Please either fix this or better yet give us a simple string based API to output to the command log.  ToyBox has localization so we will take care of localizing the text ourselves.

Blueprint cache ignores .jbp patches

The following problem remains in WotR, so I assume it's not yet fixed in RT either. According to the template page, Blueprints must have file extension *.jbp <...> if you specify AssetId of an existing blueprint (built-in or from another modification) then the existing blueprint will be replaced . But there's a problem with this approach. During the Init, cache adds new entries with m_LoadedBlueprints.Add and if the dictionary already contains an entry (because a mod added another blueprint with existing AssetID) it naturally throws ArgumentException. This is probably intended behaviour, but the exception is not handled and last time we checked it totally borks the loading routine. I propose to wrap this code line into a try-catch and check whether the entry is added by an enabled mod. Try-catch blocks are not particularly heavy on performance afaik and shouldn't affect the loading time.

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.