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
Problem with scripting monsters
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#1
Problem with scripting monsters

Hello everyone:
I'm making a very simple map, "The chasing", with only one monster. The objective is that when the player collides with the script area, a monsters appears. It must be very simple, but i've made the script and it doesn't work.
Here is the script:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);

}

void OnEnter ()
{

}

void OnLeave

{

}
void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);

I don't know what's wrong, so i would like a lot a bit of help.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
07-01-2012, 10:31 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#2
RE: Problem with scripting monsters

OnLeave is missing (), and you should set the () at OnEnter right after it, just in case...

Think, before you speak Google, before you post
(This post was last modified: 07-01-2012, 10:41 PM by Cruzore.)
07-01-2012, 10:41 PM
Find
EXAWOLT Offline
Member

Posts: 113
Threads: 14
Joined: Apr 2012
Reputation: 3
#3
RE: Problem with scripting monsters

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
}

void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
}
i dont think you want the monster to appear when leaving the map?Wink

simply nuff said




07-01-2012, 10:44 PM
Find
Demondays1 Offline
Member

Posts: 57
Threads: 7
Joined: Jun 2012
Reputation: 0
#4
RE: Problem with scripting monsters

Copy and paste this:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
}

void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
}

void OnEnter ()
{

}

void OnLeave()

{

}

Intel HD Lag fix: tiny.cc/pyv1gw
(This post was last modified: 07-01-2012, 11:48 PM by Demondays1.)
07-01-2012, 11:48 PM
Find
LulleBulle Offline
Member

Posts: 101
Threads: 33
Joined: Feb 2012
Reputation: 0
#5
RE: Problem with scripting monsters

(07-01-2012, 10:44 PM)EXAWOLT Wrote: void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
}

void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
}
i dont think you want the monster to appear when leaving the map?Wink
That wasn't his error, he just had typos, he forgot the closing bracket in the monster function and also the () at OnLeave.
(This post was last modified: 07-02-2012, 06:04 PM by LulleBulle.)
07-02-2012, 06:03 PM
Find
EXAWOLT Offline
Member

Posts: 113
Threads: 14
Joined: Apr 2012
Reputation: 3
#6
RE: Problem with scripting monsters

doesn´t writing in OnLeave() means it happens when leaving map?

simply nuff said




07-02-2012, 06:53 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Problem with scripting monsters

I've tried the script:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
}

void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
}

void OnEnter ()
{

}

void OnLeave()

{

}

It doesn't work. I think it's ok, what could be wrong?

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
07-02-2012, 07:17 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#8
RE: Problem with scripting monsters

Just in case since I don't know if it is needed, but put the () right after OnEnter, not a space between. Just in case.

Think, before you speak Google, before you post
07-02-2012, 07:21 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#9
RE: Problem with scripting monsters

Are the MAP and HPS files named to match each other? Are you sure it is servant_grunt_2 that you're trying to activate?

Tutorials: From Noob to Pro
07-02-2012, 08:32 PM
Website Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#10
RE: Problem with scripting monsters

Thanks everyone, i solved the problem. The HPS and MAP files didn't have the same name. But thanks everyone, really, this forum is awesome.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
07-02-2012, 09:30 PM
Find




Users browsing this thread: 4 Guest(s)