X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 68 forks source link

Implement framework for custom multi targeting styles #763

Closed Iridar closed 3 years ago

Iridar commented 4 years ago

Currently it's not possible to "easily" make a custom X2AbilityMultiTargetStyle , since the XComGameState_Ability::GatherAbilityTargets is native, even though luckily the UnrealScript implementation of its code was included by Firaxis.

That code is calling AbilityTemplate.AbilityMultiTargetStyle.GetMultiTargetOptions, which is also native.

Correct me if I'm wrong, but I think the problem here is that since both functions are native, the native code will talk directly to other piece of native code, bypassing any UnrealScript override functions that you were to put into your X2AbilityMultiTargetStyle subclass.

So in essence, you can make a custom Multi Target Style all you want, but its code will never get called by the game.

robojumper had this to say on this issue:

My recommendation would be to create a separate subclass of XCGS_Ability, scan for non-native target styles in X2AbilityTemplate and instantiate the subclass when needed

This is something I'd be glad to do if I had a better than vague idea of what this means.

Iridar commented 4 years ago

Related to Pull Request #762