Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 5 Vote(s) - 4.2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia: The Second Dimension [READY FOR LAUNCH]
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#60
RE: Amnesia: The Second Dimension [SERIOUSLY?!?!]

(02-22-2015, 06:29 PM)Mudbill Wrote: I guess it's also worth noting that timers keep running even if the map no longer is loaded. So with that I'm fairly certain they are still saved even if they have expired. RemoveTimer instantly expires it.

Have you tried using the ClearSavedMaps(); and DestroyDataCache(); functions? Do you think maybe they could "release" these values?

Here are the functions that run when you walk into an "ExitArea":

void OnExitShutDown(string &in asTimer)
{
    PlayerActorShutDown();
    NpcShutDown();
    RemoveTimer("LevelLoopTimer");
    RemoveTimer("CutsceneTimer");
    AddTimer("ExitTimer", 1.5f, "OnExitChangeMap");
}

void OnExitChangeMap(string &in asTimer)
{
    if(GetGlobalVarInt("ScoreboardDisabled") == 1)
    {
        ClearSavedMaps();
        Print("SECOND DIMENSION: Scoreboard skipped, start credits " + GetGlobalVarString("NextLevel") + "\n");
        StartCredits("", false, "LevelEnd", "LevelEnd_" + GetGlobalVarInt("LevelNum"), -1);
    }
    else
    {
        SetupLoadScreen("", "", 0, "");
        Print("SECOND DIMENSION: loading scoreboard\n");
        ChangeMap("SecondDimenion/maps/scoreboard.map", "PlayerStart_Start", "", "");
    }
}

// ...

void PlayerActorShutDown()
{
    Print("SECOND DIMENSION: PlayerActorShutDown()\n");
    RemoveTimer("PlayerActorTimer");
    RemoveTimer("GasHeadWobbleTimer");
    RemoveTimer("PlayerInteractTimer");
    RemoveTimer("PlayerInteractHitTimer");
    SetPlayerActive(false);
    SetEntityActive("PlayerActor_Left", false);
    SetEntityActive("PlayerActor_Right", false);
}

// ...

void NpcShutDown()
{
    Print("SECOND DIMENSION: NpcShutDown()\n");
    RemoveTimer("NpcActionTimer");
    RemoveTimer("NpcModelTimer");
    NpcQueueClear();
    int iNpc;
    for(iNpc = 0; iNpc < NpcsInitialised; iNpc++)
    {
        NpcState[iNpc] = 0;
        if(GetEntityExists(NpcName[iNpc] + "_Front"))
        {
            SetEntityActive(NpcName[iNpc] + "_Front", false);
        }
        if(GetEntityExists(NpcName[iNpc] + "_Back"))
        {
            SetEntityActive(NpcName[iNpc] + "_Back", false);
        }
        if(GetEntityExists(NpcName[iNpc] + "_Left"))
        {
            SetEntityActive(NpcName[iNpc] + "_Left", false);
        }
        if(GetEntityExists(NpcName[iNpc] + "_Right"))
        {
            SetEntityActive(NpcName[iNpc] + "_Right", false);
        }
    }
    NpcsInitialised = 0;
    NpcScriptOverride = true;
}


So, all the looping timers, and other timers besides, are removed. It seems that RemoveTimer() expires the timer but it something doesn't free up, possibly just a unique index, and contributes to the 65,535 limit.

I didn't try DestroyDataCache(), as I think that's just for assets cached with CreateDataCache().

02-22-2015, 07:36 PM
Find


Messages In This Thread
RE: Amnesia: The Second Dimension - by Romulator - 09-07-2014, 03:01 AM
RE: Amnesia: The Second Dimension - by Mudbill - 09-07-2014, 03:13 AM
RE: Amnesia: The Second Dimension - by MrBehemoth - 09-07-2014, 12:42 PM
RE: Amnesia: The Second Dimension - by Streetboat - 09-07-2014, 05:56 AM
RE: Amnesia: The Second Dimension - by Slanderous - 09-07-2014, 11:36 AM
RE: Amnesia: The Second Dimension - by Rapture - 09-07-2014, 08:29 PM
RE: Amnesia: The Second Dimension - by MrBehemoth - 09-07-2014, 08:47 PM
RE: Amnesia: The Second Dimension - by Neelke - 09-07-2014, 08:42 PM
RE: Amnesia: The Second Dimension - by AGP - 09-07-2014, 09:11 PM
RE: Amnesia: The Second Dimension - by MrBehemoth - 09-08-2014, 06:18 PM
RE: Amnesia: The Second Dimension - by MrBehemoth - 09-27-2014, 01:10 AM
RE: Amnesia: The Second Dimension - by Viper85626 - 09-27-2014, 01:38 AM
RE: Amnesia: The Second Dimension - by MrBehemoth - 11-01-2014, 04:21 PM
RE: Amnesia: The Second Dimension [SERIOUSLY?!?!] - by MrBehemoth - 02-22-2015, 07:36 PM



Users browsing this thread: 6 Guest(s)