Frictional Games Forum (read-only)

Full Version: problem with monsters and sanity
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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
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.
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