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
Question About Activating a monster when you walk in a Area
meneadeszz Offline
Junior Member

Posts: 20
Threads: 9
Joined: Apr 2012
Reputation: 0
#1
Question About Activating a monster when you walk in a Area

Ok hellow .

Im trying to make a monster activate when you walk in area..
I got a brute setup in a cabinet.
this is the little scipt it made

void OnStart()
{

SetEnemyDisabled("brute1", true);

//when the player enters the area the brute gets activated
AddEntityCollideCallback("Player", "brute1activate", "brute1activate", true, 1);
}


void brute1activate(string &in asParent, string &in asChild, int alState)
{ i dont know what the false and true mean the wiki doesnt explain
SetNPCAwake("brute1", false, true);
}


what im a missing.?
i would alos want to add a timer so when you enter the area 1 second later the brute activates

04-18-2012, 07:00 PM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#2
RE: Question About Activating a monster when you walk in a Area

Just replace your SetNPCAwake with SetEnemyDisabled("brute1", false);

I would change your 3rd parameter, I don't think its a good idea to have the same names floating around. Even though one is a Area and one is the Script function to call.
(This post was last modified: 04-18-2012, 07:15 PM by Rapture.)
04-18-2012, 07:13 PM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#3
RE: Question About Activating a monster when you walk in a Area

Most common way is to set the enemy in the Level Editor and set it to inactive. Then activate it with the following script:

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

void brute1activate(string &in asParentstring &in asChildint alState
{
SetEntityActive("brute1"true); //true means active, false means inactive


SetNPCAwake is used for characters like Agrippa and Alexander.

(This post was last modified: 04-19-2012, 12:30 AM by Damascus.)
04-19-2012, 12:30 AM
Find
meneadeszz Offline
Junior Member

Posts: 20
Threads: 9
Joined: Apr 2012
Reputation: 0
#4
RE: Question About Activating a monster when you walk in a Area

(04-19-2012, 12:30 AM)Damascus Wrote: Most common way is to set the enemy in the Level Editor and set it to inactive. Then activate it with the following script:

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

void brute1activate(string &in asParentstring &in asChildint alState
{
SetEntityActive("brute1"true); //true means active, false means inactive


SetNPCAwake is used for characters like Agrippa and Alexander.
Thanks for your helping it worked


04-19-2012, 02:47 PM
Find




Users browsing this thread: 1 Guest(s)