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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pulling lever to trigger door unlock & monster
HeadyBoy Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jul 2012
Reputation: 0
#1
Pulling lever to trigger door unlock & monster

I need to make a lever unlock a door and spawn an enemy that will have a patrol route before going off and disappearing, any ideas on the script?

Voice Actor - Male, British Accent, Mid-teens, Adaptable
Custom Stories - "The Heist: Amnesia" (In production)
07-20-2012, 01:09 AM
Find Reply
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#2
RE: Pulling lever to trigger door unlock & monster

void OnStart()
{
SetEntityConnectionStateChangeCallback("ENTER_LEVER_NAME", "ENTER_FUNCTION_NAME");
}

void ENTER_FUNCTION_NAME(string &in asEntity, int alState)
{
if(alState == 1 || alState == -1) //Pull lever up or down to open the door
{
    SetSwingDoorLocked("ENTER_DOOR_NAME", false, false);  //unlocks the door
    SetEntityActive("ENTER_MONSTERNAME", true);
    AddEnemyPatrolNode("ENTER_MONSTERNAME", "ENTER_PATHNODE_NAME", 0.1f, ""); //Copy this to add more pathnodes
}
else
{
//Nothing, what happens if the lever is in the middle
}
}
There you go Wink
He will disappear after finishing the pathnodes and reaching a specific distance.

[Image: 18694.png]
(This post was last modified: 07-20-2012, 02:13 AM by Ongka.)
07-20-2012, 02:12 AM
Find Reply
HeadyBoy Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jul 2012
Reputation: 0
#3
RE: Pulling lever to trigger door unlock & monster

Works perfectly. Thank you Big Grin

Voice Actor - Male, British Accent, Mid-teens, Adaptable
Custom Stories - "The Heist: Amnesia" (In production)
07-20-2012, 03:17 AM
Find Reply
HeadyBoy Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jul 2012
Reputation: 0
#4
RE: Pulling lever to trigger door unlock & monster

(07-20-2012, 03:17 AM)HeadyBoy Wrote: Works perfectly. Thank you Big Grin
Just been fiddling around.. and now it does not work, have I done something wrong here?


____________________________________________________________________

void OnStart()
{
SetEntityConnectionStateChangeCallback("lever_nice01_1", "leversuitor_1");
}

void leversuitor_1(string &in asEntity, int alState)
{
if(alState == 1 || alState == -1)
{
SetSwingDoorLocked("mansiondoor_1", false, false);
SetEntityActive("suitorman_1", true);
AddEnemyPatrolNode("suitorman_1", "PathNodeArea_1", 0.1f, "");
AddEnemyPatrolNode("suitorman_1", "PathNodeArea_2", 0.1f, "");
AddEnemyPatrolNode("suitorman_1", "PathNodeArea_3", 0.1f, "");
AddEnemyPatrolNode("suitorman_1", "PathNodeArea_4", 0.1f, "");
AddEnemyPatrolNode("suitorman_1", "PathNodeArea_5", 0.1f, "");
AddEnemyPatrolNode("suitorman_1", "PathNodeArea_6", 0.1f, "");
AddEnemyPatrolNode("suitorman_1", "PathNodeArea_7", 0.1f, "");
}
else
{

}
}


anybody have any ideas on what I have knocked out of place? because the lever doesnt trigger anything now

Edit: This is driving me mental.

Voice Actor - Male, British Accent, Mid-teens, Adaptable
Custom Stories - "The Heist: Amnesia" (In production)
(This post was last modified: 07-20-2012, 09:33 PM by HeadyBoy.)
07-20-2012, 07:41 PM
Find Reply




Users browsing this thread: 1 Guest(s)