Frictional Games Forum (read-only)
Help with Amnesia Level Editor - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Help with Amnesia Level Editor (/thread-21285.html)

Pages: 1 2 3 4


Help with Amnesia Level Editor - Natsu - 04-26-2013

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.


RE: Help with Amnesia Level Editor - PutraenusAlivius - 04-26-2013

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.


RE: Help with Amnesia Level Editor - Romulator - 04-26-2013

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


RE: Help with Amnesia Level Editor - PutraenusAlivius - 04-26-2013

(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]


RE: Help with Amnesia Level Editor - Natsu - 04-26-2013

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.


RE: Help with Amnesia Level Editor - PutraenusAlivius - 04-26-2013

(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.


RE: Help with Amnesia Level Editor - Natsu - 04-26-2013

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.


RE: Help with Amnesia Level Editor - Tomato Cat - 04-26-2013

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.


RE: Help with Amnesia Level Editor - Natsu - 04-27-2013

Thanks, that shall really help me out.


RE: Help with Amnesia Level Editor - Natsu - 04-27-2013

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

And this is what I have done.
[Image: xgKHy6Y.png]