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
How to make encounters?
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#2
RE: How to make encounters?

(09-15-2010, 12:40 AM)sacroid Wrote: Hi there guys! I am working on a "test map" and is looking very very well! But what I need to know, is how to make enemy encounters? Example:
I enter a new room, but just when I enter, a grunt will spawn near me and he will attack me. I've seen the Active button, wich makes the entity not spawn until something it triggers it. I was looking for some Areas, but there is no such thing for "Activating/Spawning" certain monster! Do I need Scripting knowledge? If this is true, can someone help me? I am very interested on making Amnesia Stories Tongue

Thanks!

That would indeed require scripting.

Create an area of the type Script where you want the "trigger".
Call it eg. MyRoomArea.

Place an enemy, eg. a servant_grunt.

Create a file in the same folder as your map. Call it the same as your map, but give it the extension .hps.

eg. if your map is called 00_test.map, then you call the file 00_test.hps

Then open it and add the following content:

void OnStart()
{
    //Add a callback for when the player collides with the area you created and called MyRoomArea
    AddEntityCollideCallback("Player", "MyRoomArea", "CollideMyRoomArea", true, 0);
}

void OnEnter()
{
}

//This function is called when the player collides with the area called MyRoomArea
void CollideMyRoomArea(string &in asParent, string &in asChild, int alState)
{
    //Make the entity called "servant_grunt_1" active.
    //Change the servant_grunt_1 to whatever your enemy is called.
    SetEntityActive("servant_grunt_1", true);
}

Save, and load the map.

Also, read through the script, and check the commentaries, to make sure it's all named correct.

[Image: 16455.png]
09-15-2010, 02:53 AM
Find


Messages In This Thread
How to make encounters? - by sacroid - 09-15-2010, 12:40 AM
RE: How to make encounters? - by MulleDK19 - 09-15-2010, 02:53 AM
RE: How to make encounters? - by sacroid - 09-15-2010, 06:26 AM
RE: How to make encounters? - by theDARKW0LF - 09-15-2010, 08:08 AM
RE: How to make encounters? - by sacroid - 09-15-2010, 08:16 AM
RE: How to make encounters? - by jens - 09-15-2010, 08:21 AM
RE: How to make encounters? - by sacroid - 09-15-2010, 08:25 AM
RE: How to make encounters? - by sacroid - 09-15-2010, 02:21 PM
RE: How to make encounters? - by jens - 09-15-2010, 02:31 PM
RE: How to make encounters? - by sacroid - 09-15-2010, 02:41 PM
RE: How to make encounters? - by Tony32 - 01-12-2011, 02:46 PM
RE: How to make encounters? - by sacroid - 09-15-2010, 04:24 PM
RE: How to make encounters? - by jens - 09-15-2010, 05:01 PM
RE: How to make encounters? - by sacroid - 09-15-2010, 05:11 PM
RE: How to make encounters? - by Ethril - 01-12-2011, 07:53 AM
RE: How to make encounters? - by Neatherblade - 01-12-2011, 08:54 PM



Users browsing this thread: 1 Guest(s)