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
Chair is flying past the player [Script help]
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#1
Chair is flying past the player [Script help]

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: (Select All)
[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.

Rep if like me or im helpful or you love my stories!
Stephanos house
(This post was last modified: 09-29-2011, 10:18 AM by Gamemakingdude.)
09-29-2011, 10:14 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: Chair is flying past the player [Script help]

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.

09-29-2011, 10:44 AM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#3
RE: Chair is flying past the player [Script help]

Perfect it works great thanks!

Rep if like me or im helpful or you love my stories!
Stephanos house
09-29-2011, 12:40 PM
Find




Users browsing this thread: 2 Guest(s)