Frictional Games Forum (read-only)

Full Version: Monster Triggering problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
EDIT: Everything works now! thx for help!

-----------








There may be same kind of threads somewhere, so if there is im sry but this is DAMN annoying. Angry

So, i have tried many monster triggering techniques. Even watched tutorials on YouTube, following other custom story triggering technique. but some reason my monster wont appear! Am i doing something wrong or wth?

Problem --> The monster wont go active and nothing happens, like there wouldnt be script at all.

here is my scripting: (with playercollide script in level editor and monster isnt active)


void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition("servant_grunt_1");
}




could anyone help me how to get it working? I just cant get it work even with frictionalgames wiki. I have tried it.
I recommend renaming the grunt in the level editor(and remember to press enter always when youve changed the name of something!!)and in the script.Like Grunt1 or something like that.
(05-25-2012, 01:52 PM)Datguy5 Wrote: [ -> ]I recommend renaming the grunt in the level editor(and remember to press enter always when youve changed the name of something!!)and in the script.Like Grunt1 or something like that.
Um. Why, exactly? -.-

Your problem, OP, looks to be you didn't name "PlayerCollide" area correctly, because the script and syntax look correct.

Make sure the grunt is named "servant_grunt_1", area is named "PlayerCollide", and that's pretty much it.

If your map has a CACHE file, delete it.
(05-25-2012, 05:16 PM)Putmalk Wrote: [ -> ]
(05-25-2012, 01:52 PM)Datguy5 Wrote: [ -> ]I recommend renaming the grunt in the level editor(and remember to press enter always when youve changed the name of something!!)and in the script.Like Grunt1 or something like that.
Um. Why, exactly? -.-

Your problem, OP, looks to be you didn't name "PlayerCollide" area correctly, because the script and syntax look correct.

Make sure the grunt is named "servant_grunt_1", area is named "PlayerCollide", and that's pretty much it.

If your map has a CACHE file, delete it.
Alright, but actually i can only find the .map file from level editor. When i look at it in folder without Level Editor then there is only .hps file.

May that create the problem? Because i made sure those things was named correctly.
(05-25-2012, 05:23 PM)Niko Wrote: [ -> ]
(05-25-2012, 05:16 PM)Putmalk Wrote: [ -> ]
(05-25-2012, 01:52 PM)Datguy5 Wrote: [ -> ]I recommend renaming the grunt in the level editor(and remember to press enter always when youve changed the name of something!!)and in the script.Like Grunt1 or something like that.
Um. Why, exactly? -.-

Your problem, OP, looks to be you didn't name "PlayerCollide" area correctly, because the script and syntax look correct.

Make sure the grunt is named "servant_grunt_1", area is named "PlayerCollide", and that's pretty much it.

If your map has a CACHE file, delete it.
Alright, but actually i can only find the .map file from level editor. When i look at it in folder without Level Editor then there is only .hps file.

May that create the problem? Because i made sure those things was named correctly.
The .map and the .hps have to be in the same folder for it to work. That is your problem.
(05-25-2012, 05:50 PM)Putmalk Wrote: [ -> ]
(05-25-2012, 05:23 PM)Niko Wrote: [ -> ]
(05-25-2012, 05:16 PM)Putmalk Wrote: [ -> ]
(05-25-2012, 01:52 PM)Datguy5 Wrote: [ -> ]I recommend renaming the grunt in the level editor(and remember to press enter always when youve changed the name of something!!)and in the script.Like Grunt1 or something like that.
Um. Why, exactly? -.-

Your problem, OP, looks to be you didn't name "PlayerCollide" area correctly, because the script and syntax look correct.

Make sure the grunt is named "servant_grunt_1", area is named "PlayerCollide", and that's pretty much it.

If your map has a CACHE file, delete it.
Alright, but actually i can only find the .map file from level editor. When i look at it in folder without Level Editor then there is only .hps file.

May that create the problem? Because i made sure those things was named correctly.
The .map and the .hps have to be in the same folder for it to work. That is your problem.
It appeared there when i pressed compatibility files button, but it works now!! i feel so stupid. The problem i had was that i had the .hps file named differrently than the .map file Sad million thanks still, without you i wouldnt have seen that. Smile
Dat level design >.< mansion base walls with worn castle base ceiling for the floor. You didn't even fix the area tie! Judging by the number of grunts, this looks like it will be a PDP map.
So, you can't active 4 grunts true?
Change name to anything what you want... I named it Monster1, Monster2, Monster3, Monster4 ok?
I see on you image ScriptArea, when player go in, the monsters are must activate ok?
Script Area name: ScriptArea_1

This is script:

PHP Code:
void OnStart() 



AddEntityCollideCallback("Player""ScriptArea_1""MonsterFunction"true1); 





void MonsterFunction(string &in asParentstring &in asChildint alState)

{

SetEntityActive("Monster1"true); 
SetEntityActive("Monster2"true); 
SetEntityActive("Monster3"true); 
SetEntityActive("Monster4"true); 

ShowEnemyPlayerPosition("Monster1");
ShowEnemyPlayerPosition("Monster2");
ShowEnemyPlayerPosition("Monster3");
ShowEnemyPlayerPosition("Monster4");

}

void OnEnter()
{

}

void OnLeave()
{



Maybe it will be function Big Grin
(05-25-2012, 09:02 PM)Aresak Wrote: [ -> ]So, you can't active 4 grunts true?
Change name to anything what you want... I named it Monster1, Monster2, Monster3, Monster4 ok?
I see on you image ScriptArea, when player go in, the monsters are must activate ok?
Script Area name: ScriptArea_1

This is script:

PHP Code:
void OnStart() 



AddEntityCollideCallback("Player""ScriptArea_1""MonsterFunction"true1); 





void MonsterFunction(string &in asParentstring &in asChildint alState)

{

SetEntityActive("Monster1"true); 
SetEntityActive("Monster2"true); 
SetEntityActive("Monster3"true); 
SetEntityActive("Monster4"true); 

ShowEnemyPlayerPosition("Monster1");
ShowEnemyPlayerPosition("Monster2");
ShowEnemyPlayerPosition("Monster3");
ShowEnemyPlayerPosition("Monster4");

}

void OnEnter()
{

}

void OnLeave()
{



Maybe it will be function Big Grin
tyvm for making script but it works already, i appreciate that still