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
Level Editor Help Getting servant to wait until it sees player.
MikkoK Offline
Junior Member

Posts: 6
Threads: 2
Joined: Dec 2011
Reputation: 0
#1
Getting servant to wait until it sees player.

I have placed a servant in a wardrobe but everytime it comes out of there himself, I want him to be there until player opens the door can anyone help with this?
12-19-2011, 03:31 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Getting servant to wait until it sees player.

You would have to either, resize the wardrobe, or script it to open once the player touches the door.

To script it first tick the "active" box on the monster entity. Then go to the .hps file and put this in the void OnStart part:

SetEntityPlayerInteractCallback("nameofwardrobe", "monsterspawn", true);

This makes it once the player interacts with the wardrobe, it will activate the monsterspawn function that we will make soon. The true is to remove this function after we touch the wardrobe.


void monsterspawn(string &in asEntity)
{
SetEntityActive("nameofmonster", true);
}

This spawns the monster.

The full script to spawn the monster should look like this:

void OnStart()
{
SetEntityPlayerInteractCallback("nameofwardrobe", "monsterspawn", true);
}

void monsterspawn(string &in asEntity)
{
SetEntityActive("nameofmonster", true);
}

(This post was last modified: 12-19-2011, 03:41 PM by flamez3.)
12-19-2011, 03:39 PM
Find
MikkoK Offline
Junior Member

Posts: 6
Threads: 2
Joined: Dec 2011
Reputation: 0
#3
RE: Getting servant to wait until it sees player.

(12-19-2011, 03:39 PM)flamez3 Wrote: You would have to either, resize the wardrobe, or script it to open once the player touches the door.

To script it first tick the "active" box on the monster entity. Then go to the .hps file and put this in the void OnStart part:

SetEntityPlayerInteractCallback("nameofwardrobe", "monsterspawn", true);

This makes it once the player interacts with the wardrobe, it will activate the monsterspawn function that we will make soon. The true is to remove this function after we touch the wardrobe.


void monsterspawn(string &in asEntity)
{
SetEntityActive("nameofmonster", true);
}

This spawns the monster.

The full script to spawn the monster should look like this:

void OnStart()
{
SetEntityPlayerInteractCallback("nameofwardrobe", "monsterspawn", true);
}

void monsterspawn(string &in asEntity)
{
SetEntityActive("nameofmonster", true);
}
Thanks, the script got it working, now to continue making the custom story Smile


12-19-2011, 03:50 PM
Find




Users browsing this thread: 1 Guest(s)