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
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#1
Extra HUD

Is it possible to create new HUD elements, either by using script or messing around CFG files? I mean, is it possible to stream an image into the playscreen in Amnesia?

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
11-02-2011, 11:46 PM
Find Reply
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Extra HUD

Yes, but probably not quite the way you think.

Create a misc file for your FC. (yourfcname_misc) Make sure you change your resources file to point to this new misc folder.

Open the main_sanity_events.cfg file. Copy a SoundStream entry. Modify everything to the way you want it. You can choose the image to show, but make sure you change the color of it so it doesn't come out red or something.

Change the fade out time to a very large number. Obscenely, unnecessarily large. 1000000000 will do just fine. This will make the image stay there for longer than the player ever could play.

Change this new event's set to "MYHUD" or something. Disable the "Default" set via script, and enable the "MYHUD" set. Trigger it by StartRandomInsanityEvent();. 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.

(This post was last modified: 11-03-2011, 12:04 AM by palistov.)
11-03-2011, 12:03 AM
Find Reply
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#3
RE: Extra HUD

Changing HUD images is possible like I did in White Night, but creating new elements... That depends what you want to do. I think you can pull it by using elements from Amnesia. For example:
- Health bar uses player health;
- Sanity bar uses player sanity;
- Oil bar uses lantern oil;
- Tinderbox bar uses player's tinderboxes.

So, by manipulating them you can use specific bar for your specific purposes. Other than that, I don't think it's possible.

11-03-2011, 12:11 AM
Website Find Reply
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#4
RE: Extra HUD

I just got the idea that I've played a custom story or Amnesia itself where there was some kind of health bar from some monster or something.

But it's probably that there is no such thing. HPL2 never makes it easy.

I may check that insanity thing. Tanshaydar's way can only be used for when inv is open if I'm right.



One other question. Is it possible to attach an entity to the player himself with an offset?

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
(This post was last modified: 11-03-2011, 12:22 AM by nemesis567.)
11-03-2011, 12:19 AM
Find Reply
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#5
RE: Extra HUD

(11-03-2011, 12:19 AM)nemesis567 Wrote: Is it possible to attach an entity to the player himself with an offset?
Not as far as I know. Apjjm has done some work with attaching entities with his Katamari project. Give him a PM maybe he can shed some light on the topic.

11-03-2011, 12:28 AM
Find Reply
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#6
RE: Extra HUD

I think the CS in which I saw the health bar or something like that was from Apjjm, maybe Abduction...

Anyhow, I may just PM him. If that was possible and I could make the entity as a child of the player, I could make some extra HUD without much trouble.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
11-03-2011, 12:38 AM
Find Reply
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#7
RE: Extra HUD

(11-03-2011, 12:38 AM)nemesis567 Wrote: I think the CS in which I saw the health bar or something like that was from Apjjm, maybe Abduction...

Anyhow, I may just PM him. If that was possible and I could make the entity as a child of the player, I could make some extra HUD without much trouble.

I had the same idea; however, that was editing on Cryaotic's part for Abduction, and it was Anxt that made Abduction.

Tutorials: From Noob to Pro
11-03-2011, 01:01 AM
Website Find Reply
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#8
RE: Extra HUD

Oh. So that was it... Anyway, I think I can find my way from here. Thanks for your help.


Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
11-03-2011, 01:32 AM
Find Reply
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 Reply
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#10
RE: Extra HUD

Local var? Don't you mean global? Or maybe static local because otherwise I don't think it'd be much of an help...

I haven't found a solution for a problem that does not exist. I'm just informing myself of the engine's capabilities so that in the future I may use them. So, any ideas for making this kind of thing are still very much welcome. No good can come out of something you don't know.

Again, thanks for the help.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
(This post was last modified: 11-03-2011, 03:35 PM by nemesis567.)
11-03-2011, 03:32 PM
Find Reply




Users browsing this thread: 1 Guest(s)