Frictional Games Forum (read-only)

Full Version: Chair is flying past the player [Script help]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, i am trying to make an event where an rather large chair flies past the chair and hits a door with an brute behind it. I have the chair the script area in the game but for some reason i dont know if its triggering the scripted area or making the chair move or fly. Here is my hpl code for the map.

PHP Code:
[code]////////////////////////////
// Run first time starting map
void OnStart()
{
    
//Add the Lantern and 10 Tinderboxes when in Debug mode, always good to have light!
    
if(ScriptDebugOn())
    {
        
GiveItemFromFile("lantern""lantern.ent");
 
        for(
int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i"tinderbox.ent");
    }
    
    
SetEntityPlayerInteractCallback("Key_1""HammerScare"true);
    
AddUseItemCallback("""Key_1""mansion_1""UsedKeyOnDoor"true);
    
AddEntityCollideCallback("Player","script_chairscare","ChairScare"false1);
    for (
int x 123x++) {
        
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_"+x0"");
        }
    
AddEntityCollideCallback("servant_grunt_1""ScriptArea_1""Reverse"false1);
}

void Reverse() {
    for (
int x 231x--) {
        
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_"+x0"");
        }
}
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntity,false,true);
    
PlaySoundAtEntity("","unlock_door"asEntity0false);
    
RemoveItem(asItem);
}

void HammerScare(string &in entitystring &in type)
{
  
AddPropForce("sledge_1"990000"world");
}

void ChairScare(string &in entitystring &in type)
{
  
SetEntityActive("chairscare",true);
  
AddPropImpulse("chairscare"00, -9990"world");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
 
}
 
////////////////////////////
// Run when leaving map
void OnLeave()
{
 

[/code]

I hope i get a reply as soon as possible. Mean while ill continue with the rest of my map, with the anticipation that people will be scared shitless. Big Grin
Let me fix the code up.
Change this:

ChairScare(string &in entity, string &in type)

To this:

ChairScare(string &in asParent, string &in asChild, int alState)

It should be like that because the callback was the type of collide callback.
Perfect it works great thanks!