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
Spawning an enemy
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Spawning an enemy

It's pretty straightforward if it is a Collide Callback with a ScriptArea. I've named the ScriptArea SpawnCorridorMonster for this example.

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""SpawnCorridorMonster""MonsterSpawn"true1);
}

void MonsterSpawn(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1"true);


You can also call ShowEnemyPlayerPosition after you set it active to make the enemy immediately chase after the player.

A list of all the basic functions Amnesia can recognize are here: https://wiki.frictionalgames.com/hpl2/am..._functions

You can also check Frictional Games' levels to see how they did it. There are countless examples where they use CollideCallbacks to spawn enemies, especially in the Sewer level.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 02-25-2017, 11:33 AM by Romulator.)
02-25-2017, 09:56 AM
Find


Messages In This Thread
Spawning an enemy - by XeOnTricks - 02-25-2017, 08:19 AM
RE: Spawning an enemy - by Romulator - 02-25-2017, 09:56 AM
RE: Spawning an enemy - by FlawlessHappiness - 02-25-2017, 02:51 PM



Users browsing this thread: 1 Guest(s)