04-21-2011, 04:31 PM
Hey there. I'm trying to activate a grunt and it isn't quite happening. I checked the tutorials various times, and used the script provided. The monster is set to inactive, and the script looks like the following(The important sections are in bold):
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "FirstArea", "First", true, 1);
AddEntityCollideCallback("Player", "TeleStart", "FirstTele", true, 1);
AddEntityCollideCallback("Player", "Tele", "MonsterMash", true, 1);
AddEntityCollideCallback("Player", "WTF", "Second", true, 1);
}
void First(string &in asParent , string &in asChild , int alState)
{
SetMessage("TheBeginning", "Entry1", 20.0f);
}
void Second(string &in asParent , string &in asChild , int alState)
{
SetMessage("TheBeginning", "Entry2", 20.0f);
}
void MonsterMash(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("BadMofo", true);
}
void FirstTele(string &in asParent, string &in asChild, int alState)
{
TeleportPlayer("Tele");
// Optional fading effects to make a better teleporting transition.
FadeOut(0);
FadeIn(20);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
//Add the Lantern and 10 Tinderboxes when in Debug mode, always good to have light!
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<2;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "FirstArea", "First", true, 1);
AddEntityCollideCallback("Player", "TeleStart", "FirstTele", true, 1);
AddEntityCollideCallback("Player", "Tele", "MonsterMash", true, 1);
AddEntityCollideCallback("Player", "WTF", "Second", true, 1);
}
void First(string &in asParent , string &in asChild , int alState)
{
SetMessage("TheBeginning", "Entry1", 20.0f);
}
void Second(string &in asParent , string &in asChild , int alState)
{
SetMessage("TheBeginning", "Entry2", 20.0f);
}
void MonsterMash(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("BadMofo", true);
}
void FirstTele(string &in asParent, string &in asChild, int alState)
{
TeleportPlayer("Tele");
// Optional fading effects to make a better teleporting transition.
FadeOut(0);
FadeIn(20);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
//Add the Lantern and 10 Tinderboxes when in Debug mode, always good to have light!
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<2;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}