Jump to content

[UI modding] Weirdest bug


wghost81

Recommended Posts

As some of you might know, I had a problem with Strip Primary Weapons mod: UI was freezing upon returning from a mission. Looks like I fixed it, but I still can't understand what was it.

 

Current mod script (relevant part):

 

 

class UIScreenListener_UISquadSelect_StripPrimaryWeapons extends UIScreenListener
    DependsOn(XComGameState_Unit);

event OnInit(UIScreen Screen)
{
    UISquadSelect(Screen).SetTimer(2.5f, false, nameof(AddStripWeaponsHelp), self);
}

simulated function AddStripWeaponsHelp()
{
    local UIScreenStack ScreenStack;
    local UISquadSelect SquadSelect;
    local XComHQPresentationLayer HQPres;

    ScreenStack = `SCREENSTACK;
    SquadSelect = UISquadSelect(ScreenStack.GetScreen(class'UISquadSelect'));

    if(SquadSelect == none || SquadSelect.bLaunched)
    {
        return;
    }

    HQPres = `HQPRES;

    if(HQPres != none)
    {
        if(ScreenStack.IsTopScreen(SquadSelect) && HQPres.m_kAvengerHUD.navHelp.m_arrButtonClickDelegates.Find(OnStripWeapons) == -1)
        {
            HQPres.m_kAvengerHUD.NavHelp.AddCenterHelp("MAKE WEAPONS AVAILABLE", "", OnStripWeapons, false, "Remove upgraded primary weapons from all soldiers NOT selected for current mission duty");
        }
        SquadSelect.SetTimer(1.0f, false, nameof(AddStripWeaponsHelp), self);
    }
}

simulated function OnStripWeapons()
{
    // ...
}

defaultProperties
{
    ScreenClass = UISquadSelect
}

 

Old code (relevant part):

 

 

class UIScreenListener_UISquadSelect_StripPrimaryWeapons extends UIScreenListener
    DependsOn(XComGameState_Unit);

var UISquadSelect ParentScreen;
var UINavigationHelp NavHelp;

event OnInit(UIScreen Screen)
{
    ParentScreen = UISquadSelect(Screen);
    NavHelp = `HQPRES.m_kAvengerHUD.NavHelp;
    ParentScreen.SetTimer(1.0f, true, nameof(AddStripWeaponsCenterHelp), self);
}

event OnReceiveFocus(UIScreen Screen)
{
    ParentScreen.ClearTimer(nameof(AddStripWeaponsCenterHelp), self);
    ParentScreen.SetTimer(1.0f, true, nameof(AddStripWeaponsCenterHelp), self);
}

event OnLoseFocus(UIScreen Screen)
{
    ParentScreen.ClearTimer(nameof(AddStripWeaponsCenterHelp), self);
}

event OnRemoved(UIScreen Screen)
{
    ParentScreen.ClearTimer(nameof(AddStripWeaponsCenterHelp), self);
}

simulated function AddStripWeaponsCenterHelp()
{
    if(ParentScreen.bLaunched)
    {
        ParentScreen.ClearTimer(nameof(AddStripWeaponsCenterHelp), self);
        return;
    }
    if( navHelp.m_arrButtonClickDelegates.Find(OnStripWeapons) == -1 )
    {
        `HQPRES.m_kAvengerHUD.NavHelp.AddCenterHelp("MAKE WEAPONS AVAILABLE", "", OnStripWeapons, false, "Remove upgraded primary weapons from all soldiers NOT selected for current mission duty");
    }
}

simulated function OnStripWeapons()
{
    // ...
}

defaultProperties
{
    ScreenClass = UISquadSelect
}

 

Error log:

 

 

[1521.70] Log: ###### OnlineEventMgr waited 0.00 seconds for saves to complete
[1521.78] Log: SkeletalMeshActor_2 is attached to XComHumanPawn_549 which is in another level. Using actor's location as collision center.
[1521.78] Log: SkeletalMeshActor_6 is attached to XComHumanPawn_553 which is in another level. Using actor's location as collision center.
[1521.79] Log: Bringing up level for play took: 0.017433
[1521.79] ScriptWarning: Accessed None 'PlayerReplicationInfo'
XComHeadquartersGame Avenger_Root.TheWorld:PersistentLevel.XComHeadquartersGame_4
Function Engine.GameInfo:PostSeamlessTravel:0198
[1521.79] ScriptWarning: Accessed None 'PlayerReplicationInfo'
XComHeadquartersController Avenger_Root.TheWorld:PersistentLevel.XComHeadquartersController_4
Function Engine.PlayerController:SeamlessTravelFrom:001F
[1521.79] ScriptWarning: Accessed None 'PlayerReplicationInfo'
XComHeadquartersController Avenger_Root.TheWorld:PersistentLevel.XComHeadquartersController_4
Function Engine.PlayerController:SeamlessTravelFrom:0053
[1521.79] ScriptWarning: Accessed None 'PlayerReplicationInfo'
XComHeadquartersController Avenger_Root.TheWorld:PersistentLevel.XComHeadquartersController_4
Function Engine.PlayerController:SeamlessTravelFrom:00B1
[1521.82] ScriptWarning: Accessed None 'PlayerReplicationInfo'
XComTacticalController Avenger_Root.TheWorld:PersistentLevel.XComTacticalController_5
Function Engine.PlayerController:Dead.EndState:0046
[1521.85] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1521.85] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1521.85] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1521.85] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1521.85] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1521.85] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1521.85] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateEvents:00C8
[1521.85] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateEvents:00DD
[1521.89] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:UpdateMouseLocation:0027
[1521.89] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:UpdateMouseLocation:0098
[1521.89] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:ShowMouseCursor:004F
[1521.89] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:ShowMouseCursor:00A7
[1521.89] ScriptWarning: Accessed None
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:ShowMouseCursor:00BB
[1521.89] ScriptWarning: Accessed None
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:ShowMouseCursor:00D0
[1521.89] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:UpdateMouseLocation:0027
[1521.89] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:UpdateMouseLocation:0098
[1521.89] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1521.89] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1521.89] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1521.89] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1521.89] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1521.89] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1521.91] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1521.91] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1521.91] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1521.91] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1521.91] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1521.91] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1521.93] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1521.93] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1521.93] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1521.93] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1521.93] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1521.93] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1521.95] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1521.95] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1521.95] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1521.95] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1521.95] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1521.95] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1521.96] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1521.96] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1521.96] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1521.96] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1521.96] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1521.96] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1521.98] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:UpdateMouseLocation:0027
[1521.98] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:UpdateMouseLocation:0098
[1521.98] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1521.98] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1521.98] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1521.98] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1521.98] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1521.98] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1522.00] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1522.00] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1522.00] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1522.00] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1522.00] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1522.00] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1522.01] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1522.01] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1522.01] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1522.01] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1522.01] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1522.01] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1522.03] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1522.03] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1522.03] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1522.03] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1522.03] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1522.03] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1522.05] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1522.05] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1522.05] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1522.05] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1522.05] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1522.05] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1522.07] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:UpdateMouseLocation:0027
[1522.07] ScriptWarning: Accessed None 'Movie'
UIMouseCursor Avenger_Root.TheWorld:PersistentLevel.UIMouseCursor_5
Function XComGame.UIMouseCursor:UpdateMouseLocation:0098
[1522.07] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1522.07] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1522.07] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1522.07] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3
[1522.07] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00B1
[1522.07] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:Tick:00C6
[1522.09] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:005F
[1522.09] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:0074
[1522.09] ScriptWarning: Accessed None 'm_kGameCore'
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01BE
[1522.09] ScriptWarning: Accessed None
XGMissionControlUI Avenger_Root.TheWorld:PersistentLevel.XGMissionControlUI_3
Function XComGame.XGMissionControlUI:UpdateClock:01D3

 

... and 30k more of the same line. How it's even related to different UI listener, which wasn't even executed?

 

Anyway, I tried everything and in the end removing class member variables and sticking to locals seemed to help. I'm puzzled here. Really. I had log outputs literally everywhere and I'm sure my code wasn't even executed.

Link to comment
Share on other sites

While I wasn't running into freezes or logspam, I was getting lots of lighting glitches with my replay mod that ultimately went away when I stopped storing a reference to the UIScreen instance in my UIScreenListener class.

 

I had suspected the reference was causing the object to not be GC'd at the right time, but setting the reference to none in the OnLoseFocus event wasn't enough.

Link to comment
Share on other sites

Euh -- doesn't that extra button "conflict" with the Auto-Load Squad. Cuz, on my setup, that's the fourth from the left too.

 

Weird also that as seen from multiple (possible beta code version) videos, the squad would already be there when entering that screen.

Link to comment
Share on other sites

Oh... that explains why the Squad loadout process starts empty too then. But you're right also about the available width -- code should be checked for compatibility reasons.

 

I hope you won't mind if i ask some more "simple" questions related to UI principles;

 

1) There's a tiny "Globe with Arrows" on the Geoscape bottom-left that allows to toggle the Resistance network Region sprites overlay in two ways; worldwide or just the contacts. By default, this process is "With Contacts"... can it be inverted as to use Worldwide?

 

2) The Fortress (Giant red Ethereal monument) location is defined as (X=0.01, Y=0.5 ... Middle of the Pacific ocean) straight into the DefaultGameData.INI file. I've already tried to move it in a different spot but it just doesn't relocate as intended. There must be another code process that puts it on the Geoscape, right? Can't find it, yet. Eventually i'd like to alter this stuff to automatically dump it in the nearest oceanic spot from the Starting region(16) or Continent(5) which are random for each games.

 

Thanks in advance for any help you can spare.

Edited by Zyxpsilon
Link to comment
Share on other sites

Yes, this was exactly the error I had, and it took me forever to figure it out.

 

In my case it manifested with a screen listener on UITacticalHUD, and would show up when attempting to load a tactical save from within a tactical mission. This is because the UIScreenListener child class instances aren't destroyed and recreated on a save, so anything they reference can't be garbage collected.

 

The safest thing to do is to not hold references to the triggering UIScreen in a class variable in the UIScreenListener. This is what I ended up doing in the listener for UITacticalHUD.

 

For the other strategy layer classes, I added code to clear the reference when the relevant UIScreen is removed:

 

event OnRemoved(UIScreen Screen)
{
    //clear reference to UIScreen so it can be garbage collected
    ParentScreen = none;
}

 

Sometimes it may seem necessary to hold a reference to the UIScreen in order to implement button callbacks, and it's definitely the most straightforward. However, it was discovered that UISquadSelect doesn't call OnRemove when entering the final mission, so I had to use the following workaround to access the UISquadSelect:

 

SquadSelect = UISquadSelect(`SCREENSTACK.GetScreen(class'UISquadSelect'));

 

Of course, this assumes that there is only one instance of UISquadSelect on the stack, which is the sort of thing that causes problems when garbage collection fails :)

Link to comment
Share on other sites

Shame on me, because you did warn me about this. :) But somehow I totally forgot it and ended up going through all the pain myself. :)

 

In most cases locals do well, I just tried to optimize the code a bit, but ended up adding even more checks after that failure. :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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