Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help How to make monster open door?
BigGangsta2King Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2012
Reputation: 0
#1
How to make monster open door?

Hi, so lately I was working on a custom story in Amnesia. I
did a simple level for now and it's been days since I am trying to make the
monster be able to like follow pathnode BUT OPEN DOORS WITHOUT SMASHING IT. Like
i tried the thing with the position but i wasn't able. So here my script and
PLEASE I REALY NEED HELP!

the part that dont work is after the "THIS IS NOT WORKING..." comment in the script...

PHP Code: (Select All)
////////////////////////////
// Run first time starting map
void OnStart()
{
    
/// This Is For TESTING THE LEVEL.
    
GiveItemFromFile("lantern""lantern.ent");
    for(
int i=0;i25;i++) GiveItemFromFile("tinderbox_"+i"tinderbox.ent");    

/////////EVENT FOR THE LEVEL
/////Scary Noises And sound PRESET
    
AddEntityCollideCallback("Player""ScriptArea_1""ScaryEvent_1"true1);
    
///Start Music
    
AddEntityCollideCallback("Player""Music_1""MusicEvent_1"true1);
    
    
////////// MONSTER BRUTE ACTION
    ///Monster Scream Event
    
AddEntityCollideCallback("Player""ScriptArea_2""ScaryEvent_2"true1);
    
///Monster Existance Event
    
AddEntityCollideCallback("Player""ScriptArea_3""BruteHunt_1"true1);
    
///Brute Opening Door 1 to 4
    
AddEntityCollideCallback("Brute_1""BruteArea_1""BruteOpenDoor_1"true1);
    
AddEntityCollideCallback("Brute_1""BruteArea_2""BruteOpenDoor_2"true1);
    
AddEntityCollideCallback("Brute_1""BruteArea_3""BruteOpenDoor_3"true1);
    
AddEntityCollideCallback("Brute_1""BruteArea_4""BruteOpenDoor_4"true1);
    
}

///Music No.1
void MusicEvent_1(string &in asParentstring &in asChildint alState)
    {
    
PlayMusic("23_amb02.ogg"true121true);
    }

///SCARY DOOR ACTION 'activated by locked door'
void    ScaryEvent_1(string &in asParentstring &in asChildint alState)
{
        
SetSwingDoorClosed("door_2"truetrue);
 
        
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
        
PlaySoundAtEntity("""react_scare""Player"0false);  PlaySoundAtEntity("""close_door.snt""door_2"0false);
        
GiveSanityDamage(5.0ftrue);
        
SetEntityActive("ScriptArea_2"true);
        
}

///Monster Scream
void ScaryEvent_2(string &in asParentstring &in asChildint alState)
        {
        
        
PlaySoundAtEntity("""BruteEnabled_1.snt""Player"0false);
        
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
        
PlaySoundAtEntity("""react_scare""Player"0false);  
        
PlaySoundAtEntity("""close_door.snt""door_2"0false); 
        
GiveSanityDamage(5.0ftrue);
        
SetEntityActive("ScriptArea_3"true);
        }

/// Brute Hunting
void BruteHunt_1(string &in asParentstring &in asChildint alState)
        {
        
SetEntityActive("Brute_1"true);
        
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_1"2"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_2"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_3"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_4"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_5"4"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_6"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_7"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_8"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_9"3"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_10"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_11"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_12"2"");        
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_13"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_14"5"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_15"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_16"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_17"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_18"2"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_19"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_20"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_21"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_22"0"");
        
AddEnemyPatrolNode("Brute_1""PathNodeArea_23"4"");        
    }
//////////// THIS IS NOT WORKING...
///Monster Door Opening Event BruteArea_1
void BruteOpenDoor_1(string &in asParentstring &in asChildint alState)
    {
    
SetMoveObjectState("door_2"1);
    }

///Monster Door Opening Event BruteArea_2
void BruteOpenDoor_2(string &in asParentstring &in asChildint alState)
    {
    
SetMoveObjectState("door_3"1);
    }
    
///Monster Door Opening Event BruteArea_3
void BruteOpenDoor_3(string &in asParentstring &in asChildint alState)
    {
    
SetMoveObjectState("door_5"1);
    }
    
///Monster Door Opening Event BruteArea_4
void BruteOpenDoor_4(string &in asParentstring &in asChildint alState)
    {
    
SetMoveObjectState("door_6"1);
    } 



So i would like to know if the is another thing to open the
door or if there is a better way? i don’t want the monster to break it up..
10-15-2012, 09:10 PM
Website Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: How to make monster open door?

It's just that you use a wrong function. Try this:

void BruteOpenDoor_4(string &in asParent, string &in asChild, int alState)
{
AddPropForce("Door", 0, 0, 0, "world"); ////The zeroes are values, experiment with them.
////OR
SetSwingDoorClosed("Door", false, true);
}

SetMoveObjectState is for movable objects (shelfs or secret doors)

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-15-2012, 09:22 PM
Find
BigGangsta2King Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2012
Reputation: 0
#3
RE: How to make monster open door?

Thanks! This has actually worked! and thanks you for the quick reply!
10-15-2012, 10:30 PM
Website Find




Users browsing this thread: 2 Guest(s)