Frictional Games Forum (read-only)
problem with monsters and sanity - 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: problem with monsters and sanity (/thread-19244.html)



problem with monsters and sanity - darksky - 11-16-2012

hi
i have 2 problems with monsters in my custom story.
1. problem: i don't want the player to lose sanity when looking at monsters. in the wiki it says
Quote:void SetSanityDrainDisabled(bool abX);



Enables/Disables sanity drain from darkness, monsters, etc
however, it does not work for me. i tried different ways but nothing worked.
Code:
void OnStart()
{
    AddTimer("t1",1,"sanitydrain");
    SetSanityDrainDisabled(true);    
}

void sanitydrain(string &in asTimer){
    SetSanityDrainDisabled(true);
    AddDebugMessage("no sanity drain", false);
}


////////////////////////////
// Run when entering map
void OnEnter()
{
    SetSanityDrainDisabled(true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


2. problem: i want a monster to spawn with his back facing a wall. in the level editor everything looks fine
but ingame the monster is looking at the wall.

how can i solve these problems?


RE: problem with monsters and sanity - FlawlessHappiness - 11-16-2012

The problem with the monster is that the monster starts the game, in its default position.

What i think you can do is. copy the monster to your CS, open it in the Model Editor, rotate it, save it


RE: problem with monsters and sanity - Statyk - 11-16-2012

1) putting a blockbox between you and the monster stops sanity drain, if that works for you. the sanity drain is hard coded into the enemy type. I'm not sure if someone has come up with a solution yet. the SetSanityDrainDisabled function is only to have the player not lose sanity in darkness.

2) animations and monster type coding force the monster to face a certain direction no matter how you rotate him. if need be, add a pathnode for him to turn to right as he spawns and have him stay there awhile. that will make him turn. other than that, you would need to do clever mapping.


RE: problem with monsters and sanity - darksky - 11-16-2012

well, for number 2 I changed the map so that the monster will show up right.

using block boxes would be enough for me but... I tried block_box and block_box_nonchar but it did not work Sad