Jump to content

2016-05-12 Patch SDK Changes


davidlallen

Recommended Posts

Let's consolidate everything we learn about the changes we have to make in this thread. I have pointed from /r/xcom2mods and a few other places to here. I'll keep a summary in this post, and the next post.

 

May 13 9 am (California): the dev team has given a short list of the changes here:

 

https://www.reddit.com/r/xcom2mods/comments/4j6gn7/patch_changes_for_modders/

 

If possible, let's keep the discussion on this nexus thread, which is easier to read and search.

 

Some key points:

 

* For weapon/item templates, bIsInfiniteItem is now false by default. This results in weapons/items added to the inventory which are supposed to be infinite, but instead now only one weapon is added. The ExampleWeapon mod doesn't set this, so many mods which started with that mod need to add the line "Template.bIsInfinite = true".

 

* Support has been added for class-specific armor. The game does not set any default value, so many custom classes are now unable to equip any armor. In your XComGameData_Character.ini file, in the section for your class, add the line "+AllowArmors=soldier". (You will see this recommendation both with, and without the +.)

Edited by davidlallen
Link to comment
Share on other sites

  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

I feel one simple good advice is for Modders to not try upgrading their stuff (while the update feed is happening) without a clear & stable installation structure. When a patch with such extensive changes is "processing" & "verifying" the whole game (at least once, as recommended by Firaxis, btw), there's a very high risk of corrupted "Cache resources".

 

And thus, please follow these minimal steps;

 

1) Once download is fully completed, Exit Steam

2) Log again.. you might receive a popup stating that XCom2 is being processed.

3) Before playing.. empty (as in - deactivation of the "Boxes") your entire list of active MODS (even the referenced Locals in XCom2) from whatever Launcher you use

4) Start a fresh gameplay

5) Play at least one entire "Gate Crasher" mission and visit the Geoscape

5a) I'd suggest to keep the freshly made Saves for future reference

6) Exit everything once more!!

 

Done... ready & solid.

 

:D

Edited by Zyxpsilon
Link to comment
Share on other sites

So a common thing that may affect any mod that adds new abilities ...

 

In X2Effect_Persistent.GetAttackingDamageModifier, the prototype has changed from :

function int GetAttackingDamageModifier(XComGameState_Effect EffectState, XComGameState_Unit Attacker, Damageable TargetDamageable, XComGameState_Ability AbilityState, const out EffectAppliedData AppliedData, const int CurrentDamage) { return 0; }

to

function int GetAttackingDamageModifier(XComGameState_Effect EffectState, XComGameState_Unit Attacker, Damageable TargetDamageable, XComGameState_Ability AbilityState, const out EffectAppliedData AppliedData, const int CurrentDamage, optional XComGameState NewGameState) { return 0; }

This will result in compile-time errors when building the mod against the new SDK. For mods that haven't been updated, I think this results in a CTD since there is a call in X2Effect_ApplyWeaponDamage where the NewGameState parameter is passed, and mods built under previous SDK won't be able to handle them.

 

---------------------------------------

 

In terms of new functionality, some of the nicest is a series of new additions to X2DownloadableContentInfo. This includes :

 

  • OnLoadedSavedGameToStrategy
    • This method is run when the player loads a saved game directly into Strategy while this DLC is installed
  • OnPreMission
    • Called just before the player launches into a tactical mission while this DLC / Mod is installed
  • OnPostMission
    • Called when the player completes a mission while this DLC / Mod is installed
  • OnExitPostMissionSequence
    • Called after the player exits the post-mission sequence while this DLC / Mod is installed
  • OnPostTemplatesCreated
    • Called after the Templates have been created (but before they are validated) while this DLC / Mod is active

 

---------------------------------

 

One of the other nice changes in X2DownloadableContentInfo is that exec functions can now be created. For those not up-to-date on this : https://udn.epicgames.com/Three/ExecFunctions.html . This basically allows a modder to create her own console commands. Handy for testing out that big mod! :smile:

 

 

Link to comment
Share on other sites

From the patch notes:

 

"Game state classes can now be overridden"

 

Yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay!

 

Edit: Also, we can now override 'static' functions. Double yay!

Edited by xylthixlm
Link to comment
Share on other sites

From the patch notes:

 

"Game state classes can now be overridden"

 

Yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay!

we already knew that, but the question is how they're overridden.

because if it's done in the same way as other overrides, where any time old code would create the old game state instead of the override state, then it might not be that useful.

Link to comment
Share on other sites

Wow... XC2 = 1.7GB & SDK = 2.1GB worth of new files.

 

That latest Launch-Trailer really is perfecto video stuff, AFAIC. The Vipers cavern entrance with Bradford looking in has this wild cinematic feel.

I think i'm gonna enjoy these three new gameplay conditions as they are more in-line with the Guerilla Warfare basic concept(s) of the original. Anarchy was a fun aesthetic set of cool addons but Hunters crosses the path of tough'er TBS mechanics while stacking the odds above the Tactical Layer like a coat of burning acid flow!

 

Should be crazily fun to play with..

Edited by Zyxpsilon
Link to comment
Share on other sites

 

From the patch notes:

 

"Game state classes can now be overridden"

 

Yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay!

we already knew that, but the question is how they're overridden.

because if it's done in the same way as other overrides, where any time old code would create the old game state instead of the override state, then it might not be that useful.

 

 

If they've allowed overriding 'static' methods, that means they've messed with method dispatch. I'm going to guess that they handle overrides of game state classes the same way: the actual state objects are the old class, but method calls get magically routed to the override method.

Link to comment
Share on other sites

I'd really love to know how overriding static functions works. My one finished mod (the sword damage varying by tech level) relies on overriding the ability template for Bladestorm. Currently, I'm doing something I know I shouldn't be, which is just overriding it anyway, because it works through some trick of load order - my override loads after the default function, I think. If that's changed then I'm going to need to fix my mod or risk either non-function or crashes to desktop.

 

I ended up not really comprehending gamestates back in the day, so overriding gamestates doesn't excite me AS much, but I know it's very important for proper mod support. That's good to hear.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...