Frictional Games Forum (read-only)

Full Version: Help with Amnesia Level Editor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
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.
First question is too lower/raise Daniel's Sanity.
To lower, use this.
PHP Code:
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:
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:
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:
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.
Adjusting Sanity
Spoiler below!

To raise Daniel's Sanity, we would use this:
PHP Code:
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:
AddPlayerSanity(30.0f); 
To lower Daniel's Sanity, you can use this:
PHP Code:
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:
GiveSanityDamage(10.0ftrue); 

Set Lamp amount at 0Place this in the OnStart() area of your code:
PHP Code:
void SetPlayerLampOil(0.0f); 
The sound one is complicated. Someone like JustAnotherPlayer will help there Smile
(04-26-2013, 02:22 PM)ROMul8r Wrote: [ -> ]Adjusting Sanity
Spoiler below!

To raise Daniel's Sanity, we would use this:
PHP Code:
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:
AddPlayerSanity(30.0f); 
To lower Daniel's Sanity, you can use this:
PHP Code:
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:
GiveSanityDamage(10.0ftrue); 

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

[Image: 37298178.jpg]
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)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.
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.
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.
Thanks, that shall really help me out.
It gives me this error on the Sanity line:
[Image: DjGDX38.png]

And this is what I have done.
[Image: xgKHy6Y.png]
Pages: 1 2 3 4