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
Spawn Monster upon entering Area
Hailfiretank Offline
Junior Member

Posts: 33
Threads: 12
Joined: Jun 2012
Reputation: 0
#1
Spawn Monster upon entering Area

Me again...

Basically, I want to spawn a monster when the player enters a certain area.
eg. Upon entering area Monster_Spawn, I want a brute (named 'Brute') to spawn.

What is the script to do this?

Thanks!
03-05-2013, 01:59 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Spawn Monster upon entering Area

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

void MyFunc(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("Brute"true);


"Veni, vidi, vici."
"I came, I saw, I conquered."
03-05-2013, 02:28 PM
Find
Nice Offline
Posting Freak

Posts: 3,812
Threads: 37
Joined: Jan 2012
Reputation: 153
#3
RE: Spawn Monster upon entering Area

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

^ when player enters area


SetEntityActive(string& asName, bool abActive);

^ to spawn the monster.. for example
SetEntityActive("Brute", true);


Sorry but we cannot change your avatar as the new avatar you specified is too big. The maximum dimensions are 80x80 (width x height)
(This post was last modified: 03-05-2013, 02:29 PM by Nice.)
03-05-2013, 02:29 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
RE: Spawn Monster upon entering Area

(03-05-2013, 02:29 PM)DogFood Wrote: void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

^ when player enters area


SetEntityActive(string& asName, bool abActive);

^ to spawn the monster.. for example
SetEntityActive("Brute", true);

Ninja'd you, DogFood. I was here first.

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-05-2013, 02:31 PM
Find
Hailfiretank Offline
Junior Member

Posts: 33
Threads: 12
Joined: Jun 2012
Reputation: 0
#5
RE: Spawn Monster upon entering Area

Thanks so much guys! Big Grin Big Grin

Edit: What's the script for despawning a monster? Tongue
(This post was last modified: 03-05-2013, 10:11 PM by Hailfiretank.)
03-05-2013, 09:19 PM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#6
RE: Spawn Monster upon entering Area

serious question?

SetEntityActive("Brute", false);

http://wiki.frictionalgames.com/hpl2/amn..._functions
(This post was last modified: 03-05-2013, 10:23 PM by darksky.)
03-05-2013, 10:23 PM
Find




Users browsing this thread: 1 Guest(s)