Frictional Games Forum (read-only)
ceiling doll not appearing! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: ceiling doll not appearing! (/thread-10643.html)

Pages: 1 2


ceiling doll not appearing! - Gamemakingdude - 10-07-2011

PHP Code:
//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!


RE: ceiling doll not appearing! - Tanshaydar - 10-07-2011

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?


RE: ceiling doll not appearing! - Gamemakingdude - 10-07-2011

Just a collide.


RE: ceiling doll not appearing! - Tanshaydar - 10-07-2011

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


RE: ceiling doll not appearing! - Gamemakingdude - 10-07-2011

PHP Code:
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.



RE: ceiling doll not appearing! - Gamemakingdude - 10-07-2011

Anyone wanna help?


RE: ceiling doll not appearing! - Your Computer - 10-07-2011

(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.


RE: ceiling doll not appearing! - Gamemakingdude - 10-07-2011

PHP Code:
//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()
{
 




RE: ceiling doll not appearing! - Your Computer - 10-07-2011

Use SetLeverStuckState instead of SetMoveObjectStateExt.


RE: ceiling doll not appearing! - Gamemakingdude - 10-07-2011

Still doesnt open it.