Frictional Games Forum (read-only)

Full Version: Collision not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello again,

I've set it so that when the Player collides with an Area, it slams open the door and a monster runs past the door. However my Player fails to collide at all with the area and I cannot work out why.

The script for the level is below.

Code:
//=========================

void OnStart()

{
     SetPlayerActive(true);
     FadeOut(0);
     AddEntityCollideCallback("Player", "doorswingopen", "Door_Swing", true, 0);
     AddTimer("FadeBack", 3.5f, "Fade_Back");
     FadeIn(2);
     PlayMusic("asylum_main", true, 0.5f, 2.0f, 0, true);
}

void Door_Swing(string &in asParent, string &in asChild, string &in alState)

{
     AddDebugMessage("Music stops and door opens suddenly, monster runs past.", true);
     StopMusic(1.5f, 0);
     AddTimer("InfectedSpawn", 2.5f, "Infected_Spawn");    
{
     if(GetSwingDoorClosed("prisondoor_open") == true)
     AddTimer("prisondoor_open", 0.2f, "TimerCreakDoor");

}

}

void TimerCreakDoor(string &in asTimer)

{
     AddPropForce("prisondoor_open", 0, 0, 5, "World");
}

void Infected_Spawn(string &in asTimer)

{
     AddDebugMessage("monster spawns and runs past, disappears shortly after", true);
     SetEntityActive("Infected1", true);
     AddEnemyPatrolNode("Infected1", "infected_patrol_1", 0.0f, "character_infected_run.anm");
     AddEnemyPatrolNode("Infected1", "infected_patrol_2", 1.5f, "character_infected_run.anm");
     FadeEnemyToSmoke("Infected1", true);
     ClearEnemyPatrolNodes("Infected1");
}

//=========================

void OnEnter()

{

}

//=========================

void OnLeave()

{

}

If anyone could help me out I would really appreciate it Smile.
Bad type for parameter alState, should be an int.

Code:
void Door_Swing(string &in asParent, string &in asChild, string &in alState)

===>

void Door_Swing(string &in asParent, string &in asChild, int alState)
(12-16-2010, 10:35 AM)Luis Wrote: [ -> ]Bad type for parameter alState, should be an int.

Code:
void Door_Swing(string &in asParent, string &in asChild, string &in alState)

===>

void Door_Swing(string &in asParent, string &in asChild, int alState)

Thank you very much, that fixed up all my problems Smile