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
ceiling doll not appearing!
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#1
ceiling doll not appearing!

PHP Code: (Select All)
//Global Variables
bool GruntScareDone false;
bool chairScare false;

////////////////////////////
// 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);
    
AddEntityCollideCallback("Player","script_GruntScare","GruntScare",false,1);
    
SetEntityConnectionStateChangeCallback("lever_nice01_1""func_shelf");
    
AddEntityCollideCallback("Player","script_dollscare","DollScare",false,1);
    for (
int x 123x++) {
        
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_"+x0"");
        }
    
AddEntityCollideCallback("servant_grunt_1""ScriptArea_1""Reverse"false1);

    for (
int x 24188x++) {
        
AddEnemyPatrolNode("servant_brute_deadiler_1""PathNodeArea_"+x0"");
        }
    for (
int x 240x--) {
        
AddEnemyPatrolNode("servant_brute_deadiler_1""PathNodeArea_"+x0"");
        }

}

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 DollScare(string &in entitystring &in type) {
    
SetEntityActive("ceiling_doll_1",true);
    
AddPlayerBodyForce(0,0,100000,false);
    }

void HammerScare(string &in entitystring &in type)
{
  
AddPropImpulse("sledge_1"30520"world");
  
PlaySoundAtEntity("FistPump""FistPump.snt","Player"0false);
}

void ChairScare(string &in asParentstring &in asChildint alState)
{
  
//SetEntityActive("chairscare",false);
  
if(chairScare == false) {
      
PlaySoundAtEntity("StephanoScream""StephanoScream.snt","Player"0false);
      
AddPropImpulse("chairscare"00, -25"world");
      
chairScare true;
      
AddTimer("1",2.0f,"StephanoDisappear");
}
}

void GruntScare(string &in asParentstring &in asChildint alState)
{
    if(
GruntScareDone == false) {
        
SetEntityActive("servant_grunt_ragdoll_1",true);
        
PlaySoundAtEntity("","react_scare","Player",0,false);
        
AddPropImpulse("servant_grunt_ragdoll_1"3000"world");
        
SetEntityActive("Stephano",true);
        
PlaySoundAtEntity("HelloStephano""HelloStephano.snt","Player"0false);
        
AddTimer("1",3.0f,"CloseDoor");
        
AddTimer("2",4.0f,"CloseDoor");
        
GruntScareDone true;
}
}

void CloseDoor(string &in asTimer) {
    if (
asTimer == "1") {
        
SetSwingDoorClosed("mansion_3"truetrue);
        
SetEntityActive("SpotLight_2",false);
    }
    if (
asTimer == "2") {
    
SetSwingDoorLocked("mansion_3"truetrue);
    }
}

void StephanoDisappear(string &in asTimer) {
    if(
asTimer == "1") {
        
SetEntityActive("chairscare",false);
    }
}


void func_shelf(string &in asEntityint alState)
{
     if (
alState == 1)
     {
     
SetMoveObjectState("shelf_secret_door_rot_1",1.0f);
     
PlaySoundAtEntity("""quest_completed.snt""shelf_move_1"0false);
          return;
     }
    
/* if (alState == 0)
     {
     SetMoveObjectState("shelf_secret_door_rot_1",0.0f);
        return;
    }*/
}

void InsaneMoment(string &inEntity) {
    
SetMoveObjectState("shelf_secret_door_rot_1",0.0f);
    
StartPlayerLookAt("shelf_secret_door_rot_1",10,100,"");
    
StartScreenShake(0.3f,10.0f,3.0f,1.0f);
    
AddTimer("1"2.0f,"Stare");
    
AddTimer("2"4.0f"Stare");
    
AddTimer("3"6.0f"Stare");
    
AddTimer("4"8.0f"Stare");
    
AddTimer("5"10.0f"Stare");
    
AddTimer("6"12.0f"Stare");
    
AddTimer("7"14.0f"Stare");
}

void Introduce(string &inEntity) {
    
PlaySoundAtEntity("IntroduceMartin""IntroduceMartin.snt","Player"0false);
    }
void Stare(string &in asTimer) {
    if(
asTimer == "1") {
        
        
SetEntityActive("painting_portrait_insane_1"true);
        
CreateParticleSystemAtEntity("PSDustPainting""ps_ghost_release.ps""painting_portrait_insane_1"false);
        
StartPlayerLookAt("painting_portrait_insane_1"10100"");
        
PlaySoundAtEntity("snd_scare""react_scare.snt""Player"0.0false);
        
GiveSanityDamage(3true);
        
CreateParticleSystemAtEntity("PSRoses""rose_petals_loop.ps""chandelier_nice_1"false);
    }
    if(
asTimer == "2") {
        
SetEntityActive("spider_2",true);
        
StartPlayerLookAt("spider_2"10100"");
        
GiveSanityDamage(3true);
        }
    if(
asTimer == "3") {
        
StopPlayerLookAt();
        
SetLampLit("chandelier_nice_1"falsefalse);
        
SetLampLit("bonfire_1"truetrue);
        }
    if(
asTimer == "4") {
        
SetEntityActive("chandelier_nice_1"false);
        
SetEntityActive("hanging_prisoner_1"true);
        
StartPlayerLookAt("hanging_prisoner_1"10100"");
        
GiveSanityDamage(3true);
        }
    if(
asTimer == "5") {
        
StopPlayerLookAt();
        
SetEntityActive("corpse_male_1"true);
        
StartPlayerLookAt("corpse_male_1"10100"");
        
AddPropImpulse("corpse_male_1",0,0,-200"world");    
        
GiveSanityDamage(10,true);
        }
    if(
asTimer == "6") {
        
StopPlayerLookAt();
        
SetEntityActive("painting_portrait_insane_1"false);
        
SetEntityActive("spider_2",false);
        
SetEntityActive("chandelier_nice_1"false);
        
SetEntityActive("hanging_prisoner_1"false);
        
SetEntityActive("corpse_male_1"false);
        
SetEntityActive("chandelier_nice_1"true);
        
SetMoveObjectState("shelf_secret_door_rot_1",1.0f);
    if(
asTimer == "7") {
        
SetEntityActive("CustomPainting_1",true);
        }
}
}

////////////////////////////
// Run when entering map
void OnEnter()
{
 
}
 
////////////////////////////
// Run when leaving map
void OnLeave()
{
 


The part is the dollscare. I have named everything correctly but nothing happens in the game!

Rep if like me or im helpful or you love my stories!
Stephanos house
10-07-2011, 12:18 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: ceiling doll not appearing!

You wrote it was a Collide Callback, and you wrote for signature function:
void DollScare(string &in entity, string &in type)

Is it a collide callback or is it a special type callback?

10-07-2011, 12:33 PM
Website Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#3
RE: ceiling doll not appearing!

Just a collide.

Rep if like me or im helpful or you love my stories!
Stephanos house
10-07-2011, 12:39 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
RE: ceiling doll not appearing!

For Collide Callbacks signature function input is this: (string &in asParent, string &in asChild, int alState)

(This post was last modified: 10-07-2011, 12:48 PM by Tanshaydar.)
10-07-2011, 12:48 PM
Website Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#5
RE: ceiling doll not appearing!

PHP Code: (Select All)
void LeverOpen(string &in asParentstring &in asChildint alState) {
    
SetMoveObjectStateExt("door_barricade_1",0.5f,5.0f,10.0f,0.0f,false);
    } 

That fixes that. But i have another script collide.
For some reason this wont open the handle halfway.

Rep if like me or im helpful or you love my stories!
Stephanos house
10-07-2011, 12:53 PM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#6
RE: ceiling doll not appearing!

Anyone wanna help?

Rep if like me or im helpful or you love my stories!
Stephanos house
10-07-2011, 03:07 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#7
RE: ceiling doll not appearing!

(10-07-2011, 03:07 PM)Gamemakingdude Wrote: Anyone wanna help?

LeverOpen's signature implies an entity collision. However, you don't have any AddEntityCollideCallback functions setting LeverOpen as a callback for a collision.

Tutorials: From Noob to Pro
10-07-2011, 04:38 PM
Website Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#8
RE: ceiling doll not appearing!

PHP Code: (Select All)
//Global Variables
bool GruntScareDone false;
bool chairScare false;
bool dollScareDone false;

////////////////////////////
// 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);
    
AddEntityCollideCallback("Player","script_GruntScare","GruntScare",false,1);
    
SetEntityConnectionStateChangeCallback("lever_nice01_1""func_shelf");
    
AddEntityCollideCallback("Player","script_dollscare","DollScare",false,1);
    
AddEntityCollideCallback("Player","LeverOpen","LeverOpen",false,1);
    
AddEntityCollideCallback("Player","MartinTalk_1","MartinTalk_1",false,1);
    
    for (
int x 123x++) {
        
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_"+x0"");
        }
    
AddEntityCollideCallback("servant_grunt_1""ScriptArea_1""Reverse"false1);

    for (
int x 24188x++) {
        
AddEnemyPatrolNode("servant_brute_deadiler_1""PathNodeArea_"+x0"");
        }
    for (
int x 240x--) {
        
AddEnemyPatrolNode("servant_brute_deadiler_1""PathNodeArea_"+x0"");
        }

}
void MartinTalk_1(string &in asParentstring &in asChildint alState) {
    
PlaySoundAtEntity("IntroduceMartin""IntroduceMartin.snt","Player"0false);
    }

void MartinTalk_2(string &in asParentstring &in asChildint alState) {
    


void LeverOpen(string &in asParentstring &in asChildint alState) {
    
SetMoveObjectStateExt("door_barricade_1",0.5f,5.0f,10.0f,0.0f,false);
    }

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 DollScare(string &in asParentstring &in asChildint alState) {
    if(
dollScareDone == false) {
    
SetEntityActive("ceiling_doll_1",true);
    
AddPlayerBodyForce(0,0,100000,false);
    
dollScareDone true;
    }
}

void HammerScare(string &in entitystring &in type)
{
  
AddPropImpulse("sledge_1"30520"world");
  
PlaySoundAtEntity("FistPump""FistPump.snt","Player"0false);
}

void ChairScare(string &in asParentstring &in asChildint alState)
{
  
//SetEntityActive("chairscare",false);
  
if(chairScare == false) {
      
PlaySoundAtEntity("StephanoScream""StephanoScream.snt","Player"0false);
      
AddPropImpulse("chairscare"00, -25"world");
      
chairScare true;
      
AddTimer("1",2.0f,"StephanoDisappear");
}
}

void GruntScare(string &in asParentstring &in asChildint alState)
{
    if(
GruntScareDone == false) {
        
SetEntityActive("servant_grunt_ragdoll_1",true);
        
PlaySoundAtEntity("","react_scare","Player",0,false);
        
AddPropImpulse("servant_grunt_ragdoll_1"3000"world");
        
SetEntityActive("Stephano",true);
        
PlaySoundAtEntity("HelloStephano""HelloStephano.snt","Player"0false);
        
AddTimer("1",3.0f,"CloseDoor");
        
AddTimer("2",4.0f,"CloseDoor");
        
GruntScareDone true;
}
}

void CloseDoor(string &in asTimer) {
    if (
asTimer == "1") {
        
SetSwingDoorClosed("mansion_3"truetrue);
        
SetEntityActive("SpotLight_2",false);
    }
    if (
asTimer == "2") {
    
SetSwingDoorLocked("mansion_3"truetrue);
    }
}

void StephanoDisappear(string &in asTimer) {
    if(
asTimer == "1") {
        
SetEntityActive("chairscare",false);
    }
}


void func_shelf(string &in asEntityint alState)
{
     if (
alState == 1)
     {
     
SetMoveObjectState("shelf_secret_door_rot_1",1.0f);
     
PlaySoundAtEntity("""quest_completed.snt""shelf_move_1"0false);
          return;
     }
    
/* if (alState == 0)
     {
     SetMoveObjectState("shelf_secret_door_rot_1",0.0f);
        return;
    }*/
}

void InsaneMoment(string &inEntity) {
    
SetMoveObjectState("shelf_secret_door_rot_1",0.0f);
    
StartPlayerLookAt("shelf_secret_door_rot_1",10,100,"");
    
StartScreenShake(0.3f,10.0f,3.0f,1.0f);
    
AddTimer("1"2.0f,"Stare");
    
AddTimer("2"4.0f"Stare");
    
AddTimer("3"6.0f"Stare");
    
AddTimer("4"8.0f"Stare");
    
AddTimer("5"10.0f"Stare");
    
AddTimer("6"12.0f"Stare");
    
AddTimer("7"14.0f"Stare");
}

void Introduce(string &inEntity) {
    
PlaySoundAtEntity("IntroduceMartin""IntroduceMartin.snt","Player"0false);
    }
void Stare(string &in asTimer) {
    if(
asTimer == "1") {
        
        
SetEntityActive("painting_portrait_insane_1"true);
        
CreateParticleSystemAtEntity("PSDustPainting""ps_ghost_release.ps""painting_portrait_insane_1"false);
        
StartPlayerLookAt("painting_portrait_insane_1"10100"");
        
PlaySoundAtEntity("snd_scare""react_scare.snt""Player"0.0false);
        
GiveSanityDamage(3true);
        
CreateParticleSystemAtEntity("PSRoses""rose_petals_loop.ps""chandelier_nice_1"false);
    }
    if(
asTimer == "2") {
        
SetEntityActive("spider_2",true);
        
StartPlayerLookAt("spider_2"10100"");
        
GiveSanityDamage(3true);
        }
    if(
asTimer == "3") {
        
StopPlayerLookAt();
        
SetLampLit("chandelier_nice_1"falsefalse);
        
SetLampLit("bonfire_1"truetrue);
        }
    if(
asTimer == "4") {
        
SetEntityActive("chandelier_nice_1"false);
        
SetEntityActive("hanging_prisoner_1"true);
        
StartPlayerLookAt("hanging_prisoner_1"10100"");
        
GiveSanityDamage(3true);
        }
    if(
asTimer == "5") {
        
StopPlayerLookAt();
        
SetEntityActive("corpse_male_1"true);
        
StartPlayerLookAt("corpse_male_1"10100"");
        
AddPropImpulse("corpse_male_1",0,0,-200"world");    
        
GiveSanityDamage(10,true);
        }
    if(
asTimer == "6") {
        
StopPlayerLookAt();
        
SetEntityActive("painting_portrait_insane_1"false);
        
SetEntityActive("spider_2",false);
        
SetEntityActive("chandelier_nice_1"false);
        
SetEntityActive("hanging_prisoner_1"false);
        
SetEntityActive("corpse_male_1"false);
        
SetEntityActive("chandelier_nice_1"true);
        
SetMoveObjectState("shelf_secret_door_rot_1",1.0f);
    if(
asTimer == "7") {
        
SetEntityActive("CustomPainting_1",true);
        }
}
}

////////////////////////////
// Run when entering map
void OnEnter()
{
 
}
 
////////////////////////////
// Run when leaving map
void OnLeave()
{
 


Rep if like me or im helpful or you love my stories!
Stephanos house
10-07-2011, 04:41 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#9
RE: ceiling doll not appearing!

Use SetLeverStuckState instead of SetMoveObjectStateExt.

Tutorials: From Noob to Pro
10-07-2011, 04:44 PM
Website Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#10
RE: ceiling doll not appearing!

Still doesnt open it.

Rep if like me or im helpful or you love my stories!
Stephanos house
10-07-2011, 04:51 PM
Find




Users browsing this thread: 1 Guest(s)