Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I have a few recommendations for improving the compatibility of your mod. For example, you can use OnPostTemplatesCreated to edit the GenerateRewardFn delegate for the 'Reward_Soldier', 'Reward_Rookie', and 'Reward_CouncilSoldier' templates instead of overriding X2StrategyElement_DefaultRewards. However, since Long War Toolbox overwrites the same delegate, it would also be useful to look into whether it's possible to use the LWTuple system and the events sent by Long War Toolbox instead when Long War Toolbox is being used alongside this mod. Let me know if you want anything I said clarified!
1. Remove the override for X2StrategyElement_DefaultRewards.
2. Add a new X2DownloadableContentInfo class that overrides OnPostTemplatesCreated
3. Makes 3 calls something like:
StratMgr.FindStrategyElementTemplate('Reward_Soldier'').GenerateRewardFn = <my function>
StratMgr.FindStrategyElementTemplate('Reward_Rookie'').GenerateRewardFn = <my function>
StratMgr.FindStrategyElementTemplate('Reward_CouncilSoldier').GenerateRewardFn = <my function>
Several questions:
- to point to my method like that, will my method need to be static? Or will it even take a pointer to a function outside of that class?
- Not familiar with Long War Toolbox, what's a LWTuple?
- If I make it compatible with this Long War mod, will that make it dependent on LongWar's mod being installed first?
- What exactly is a 'Reward_Rookie' and 'Reward_CouncilSoldier'?
- Just curious, are you part of the Long War development team?
2. From the Long War Toolbox description on Nexus:
"Toolbox makes use of a generic LW_Tuple data structure for passing data back and forth using the X2EventManager. If your mod wants to RegisterForEvent for one of these EventIDs, you'll want to include the LW_Tuple package :
1) Copy the LWTuple.uc class file into your mod, in a separate folder under /Src/LW_Tuple/Classes/
2) Add config line "+ModEditPackages=LW_Tuple" (to match the new folder in Src) to XComEngine.ini, section [UnrealEd.EditorEngine]
3) Use the LWTuple class in your code"
I haven't gotten around to learning how to use this myself, so I likely won't be of much more help here.
3. I do know that it will not be dependent on Long War Toolbox loading first (nor will it be dependent on Long War Toolbox at all).
4. 'Reward_Rookie' and the others are the names of X2RewardTemplate instances generated by XCOM 2 every time it loads a game. The important thing for you is that each of them contains a delegate for the function used to generate a soldier reward, which by default points to the function your mod currently overrides.
5. I wish!
[Engine.ScriptPackages]
+NonNativePackages=ResistanceWeaponUpgrades
[Engine.Engine]
-ModClassOverrides=(BaseGameClass="X2StrategyElement_DefaultRewards", ModClass="X2StrategyElement_DefaultRewards_RWU")
Did you at one point have the class overridden, and this is to clean it up out of the INI files?
Also curious if this could be used to blow away other peoples overrides so that your mod will work? ( kind of a dirty thing to do, but hey :) )