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
Collision not working
nerdboyxxx Offline
Junior Member

Posts: 11
Threads: 5
Joined: Sep 2010
Reputation: 0
#1
Collision not working

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.

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

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.
12-16-2010, 09:54 AM
Find
Luis Offline
Frictional Games

Posts: 280
Threads: 19
Joined: Jun 2006
Reputation: 9
#2
RE: Collision not working

Bad type for parameter alState, should be an int.

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

===>

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

EOF
12-16-2010, 10:35 AM
Find
nerdboyxxx Offline
Junior Member

Posts: 11
Threads: 5
Joined: Sep 2010
Reputation: 0
#3
RE: Collision not working

(12-16-2010, 10:35 AM)Luis Wrote: Bad type for parameter alState, should be an int.

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
12-16-2010, 11:25 AM
Find




Users browsing this thread: 1 Guest(s)