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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Configuration Files Help Extra HUD
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#9
RE: Extra HUD

(11-03-2011, 12:03 AM)palistov Wrote: This is unreliable though. If the player exits to the menu and re-enters, the insanity event will disappear, and there's no way to trigger a function when the player loads up the game (it doesn't count as OnEnter; I've tested it). Using a repeating timer to trigger the event may be an option. You'll have to test it thoroughly.

Good luck.
You can create an "onLoad" event by using a timer and a local var.

void OnStart()
{
ldStep("LoadDetectionTimer");
}

void OnEnter()
{
   loaded = false;
}
bool loaded = true;
//Called once per timestep to check for level load
void ldStep(string &in asTimer) {
    if(loaded) OnSaveLoad();
    AddTimer(asTimer,1.0f / 60.0f,"ldStep");
    //Can add an OnStep(); event of your own too
  }

void OnSaveLoad() {
//Called when a save is loaded
}
I use a timer which checks for a load once per frame, you can probably get away with a timer with a much larger interval in practice. Note: this doesn't work for quickload (but does for the standard load). It seems you have found your solution now anyway, but perhaps this may help in your project later.

Edit: Forgot the OnEnter() event.
(This post was last modified: 11-10-2011, 02:01 AM by Apjjm.)
11-03-2011, 02:51 AM
Find


Messages In This Thread
Extra HUD - by nemesis567 - 11-02-2011, 11:46 PM
RE: Extra HUD - by palistov - 11-03-2011, 12:03 AM
RE: Extra HUD - by Apjjm - 11-03-2011, 02:51 AM
RE: Extra HUD - by Tanshaydar - 11-03-2011, 12:11 AM
RE: Extra HUD - by nemesis567 - 11-03-2011, 12:19 AM
RE: Extra HUD - by palistov - 11-03-2011, 12:28 AM
RE: Extra HUD - by nemesis567 - 11-03-2011, 12:38 AM
RE: Extra HUD - by Your Computer - 11-03-2011, 01:01 AM
RE: Extra HUD - by nemesis567 - 11-03-2011, 01:32 AM
RE: Extra HUD - by nemesis567 - 11-03-2011, 03:32 PM
RE: Extra HUD - by Apjjm - 11-03-2011, 09:31 PM
RE: Extra HUD - by nemesis567 - 11-03-2011, 10:39 PM



Users browsing this thread: 1 Guest(s)