Jump to content

Overriding XCOMGameState class with private variable and Native(AI)


RedDobe

Recommended Posts

Hey all. I am new here so bare with me. :happy: I have a new mod that I created called "Yellow Alert Gameplay". It's already published in the workshop, and I am getting really good feedback. But you know how us modders are, we want to constantly improve the mod. To the point.... I found a bug in the code written by the Xcom 2 team. They were trying to fix a problem with alerts repeatedly being recorded that were caused by Seeing other alerted allies when yellow alerts are enabled. But they missed a line of code. This would be a simple fix by extending the class but of course the function that I need to change uses a private variable array <AlertData>.

 

The class that I am trying to extend is XComGameState_AIUnitData. The function within that class that I need to modify is AddAlertData(). This class contains a reference to config(AI) and Native(AI). I tried replacing the entire class by extending its parent class, but the reference to Native(AI) causes it to crash.

 

Literally, all I need to do is modify two lines of code in this function. How do I go about doing so?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...