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
Help with Amnesia Level Editor
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#1
Help with Amnesia Level Editor

Dunno if this goes here, if not someone please move it.

I started using the Level Editor not too long ago and I discovered how to do some things with it, though, what I want to know is if there's a command to low and raise Daniel's Insanity.

I searched for a command or something on Google and YouTube many times but haven't found even a clue.

I also want to know if there's a way to drain all the Oil of the Lamp, because once I press Tab I see the bar fully charged even though I just started.

And third and probably don't last, I'm trying to play after entering on a Script Area a music, but at the same time a sound. I wrote both commands on my level.hps file, but the sound doesn't. Does someone know what can I do to make the sound and the music play at the same time? The insanity code I'm looking for is for this scene too.

If someone can help me, please do it, I'm currently trying to make a custom story.
04-26-2013, 02:05 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Help with Amnesia Level Editor

First question is too lower/raise Daniel's Sanity.
To lower, use this.
PHP Code: (Select All)
GiveSanityDamage(float afAmountbool abUseEffect); 
afAmount - The amount of sanity you want to lower. Max is 100. Make sure to put .f behind every float, like this "2.5f"
abUseEffect - Determines whether you want a screen effect or not. True means "Screen Effect" while False means nothing.
///-------------------------///
To raise, use this.
PHP Code: (Select All)
AddPlayerSanity(float afSanity); 
afSanity - The amount of sanity you want to raise. Same as above but this one raises it, not lowering it.



Second question is to drain oil from the lantern.
To drain, use this.
PHP Code: (Select All)
SetPlayerLampOil(float afOil); 
afOil - The amount of oil you want. Max is 100.



Third question (and maybe NOT the last) is to play a sound and a music at the same time when colliding with a script area.
To do that, use this.
PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""ScriptAreaName""SoundMusicPlay"true1);
}

void SoundMusicPlay(string &in asParentstring &in asChildint alState)
{
PlayMusic(MUSICNAME.oggtrue111false);
PlaySoundAtEntity(""MUSICNAME.snt"Player"0.1ffalse); //An .snt is a properties of a music file.



Hope this helps.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 04-26-2013, 02:18 PM by PutraenusAlivius.)
04-26-2013, 02:17 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#3
RE: Help with Amnesia Level Editor

Adjusting Sanity
Spoiler below!

To raise Daniel's Sanity, we would use this:
PHP Code: (Select All)
AddPlayerSanity(float afSanity); 
And you would change "float afSanity" to a number between 0.0 - 100.0, followed by an "f". If I wanted to add 30 to Daniel's sanity, I would use this:
PHP Code: (Select All)
AddPlayerSanity(30.0f); 
To lower Daniel's Sanity, you can use this:
PHP Code: (Select All)
GiveSanityDamage(float afAmountbool abUseEffect); 
And it works the same way as above. The effect, set as true so the player knows that the sanity has decreased.
PHP Code: (Select All)
GiveSanityDamage(10.0ftrue); 

Set Lamp amount at 0Place this in the OnStart() area of your code:
PHP Code: (Select All)
void SetPlayerLampOil(0.0f); 
The sound one is complicated. Someone like JustAnotherPlayer will help there Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 04-26-2013, 02:23 PM by Romulator.)
04-26-2013, 02:22 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
RE: Help with Amnesia Level Editor

(04-26-2013, 02:22 PM)ROMul8r Wrote: Adjusting Sanity
Spoiler below!

To raise Daniel's Sanity, we would use this:
PHP Code: (Select All)
AddPlayerSanity(float afSanity); 
And you would change "float afSanity" to a number between 0.0 - 100.0, followed by an "f". If I wanted to add 30 to Daniel's sanity, I would use this:
PHP Code: (Select All)
AddPlayerSanity(30.0f); 
To lower Daniel's Sanity, you can use this:
PHP Code: (Select All)
GiveSanityDamage(float afAmountbool abUseEffect); 
And it works the same way as above. The effect, set as true so the player knows that the sanity has decreased.
PHP Code: (Select All)
GiveSanityDamage(10.0ftrue); 

Set Lamp amount at 0Place this in the OnStart() area of your code:
PHP Code: (Select All)
void SetPlayerLampOil(0.0f); 
The sound one is complicated. Someone like JustAnotherPlayer will help there Smile

[Image: 37298178.jpg]

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-26-2013, 02:24 PM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#5
RE: Help with Amnesia Level Editor

So technicaly the sound file must come after the music one? Because I did practicaly the same with it, but wrote the sound one before the music one.

Also, thanks for those codes, I would want this thread open if I come to have another question, and so people that needs help can see what to do too.
04-26-2013, 02:41 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Help with Amnesia Level Editor

(04-26-2013, 02:41 PM)Natsu Wrote: So technicaly the sound file must come after the music one? Because I did practicaly the same with it, but wrote the sound one before the music one.

Also, thanks for those codes, I would want this thread open if I come to have another question, and so people that needs help can see what to do too.

Sound file is PlaySoundAtEntity and Music is PlayMusic.

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-26-2013, 02:44 PM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#7
RE: Help with Amnesia Level Editor

No, I know that. But when I played last time with those commands the sound didn't play. That's the real problem. I'm currently out so I can't test those commands, I'll go home and coment if worked later.
04-26-2013, 02:49 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#8
RE: Help with Amnesia Level Editor

If you include your .hps file in [php] tags we can root out the problem.

Also, check out the Frictional Games Wiki for a full list of functions.

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
(This post was last modified: 04-26-2013, 03:11 PM by Tomato Cat.)
04-26-2013, 03:09 PM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#9
RE: Help with Amnesia Level Editor

Thanks, that shall really help me out.
04-27-2013, 02:31 AM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#10
RE: Help with Amnesia Level Editor

It gives me this error on the Sanity line:
[Image: DjGDX38.png]

And this is what I have done.
[Image: xgKHy6Y.png]
04-27-2013, 05:07 AM
Find




Users browsing this thread: 1 Guest(s)