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
Monster isn't quite activating.
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#5
RE: Monster isn't quite activating.

(04-21-2011, 04:48 PM)DominusVita Wrote: My other syntax code seems to work fine with it - I tried changing it but no go Sad

It's fine, I'll figure it out at one point or another. Thought I'd poll the more experienced before trying again.

The trick is identifying exactly what the problem is. I suggest the following, so that you can trace the execution of your script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddDebugMessage("Started",false);
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)
{
AddDebugMessage("First Called: " +asParent + "," + asChild,false);
SetMessage("TheBeginning", "Entry1", 20.0f);
}


void Second(string &in asParent , string &in asChild , int alState)
{
AddDebugMessage("Second Called: " +asParent + "," + asChild,false);
SetMessage("TheBeginning", "Entry2", 20.0f);
}


void MonsterMash(string &in asParent , string &in asChild , int alState)
{
AddDebugMessage("MonsterMash Called: " +asParent + "," + asChild,false);
SetEntityActive("BadMofo", true);
}


void FirstTele(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("FirstTele Called: " +asParent + "," + asChild,false);
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()
{

}

If it turns out "MonsterMash Called" never shows up, then you know you aren't triggering the script area*. If it does, you know the problem is in your SetEntitiyActive code. If you are still struggling to locate the error, print out more information. The more information you have, the easier it will be to find the problem.

*This could mean either your callback code is incorrect, or, teleporting into a script area doesn't fire a collision event - the latter you would have to work around.
(This post was last modified: 04-21-2011, 05:19 PM by Apjjm.)
04-21-2011, 05:18 PM
Find


Messages In This Thread
Monster isn't quite activating. - by DominusVita - 04-21-2011, 04:31 PM
RE: Monster isn't quite activating. - by Josh707 - 04-21-2011, 04:44 PM
RE: Monster isn't quite activating. - by Apjjm - 04-21-2011, 05:18 PM
RE: Monster isn't quite activating. - by MrBigzy - 04-21-2011, 05:15 PM
RE: Monster isn't quite activating. - by palistov - 04-21-2011, 05:36 PM



Users browsing this thread: 1 Guest(s)