Gamemakingdude
Senior Member
Posts: 470
Threads: 82
Joined: Nov 2010
Reputation:
9
|
ceiling doll not appearing!
//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", false, 1); AddEntityCollideCallback("Player","script_GruntScare","GruntScare",false,1); SetEntityConnectionStateChangeCallback("lever_nice01_1", "func_shelf"); AddEntityCollideCallback("Player","script_dollscare","DollScare",false,1); for (int x = 1; x < 23; x++) { AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+x, 0, ""); } AddEntityCollideCallback("servant_grunt_1", "ScriptArea_1", "Reverse", false, 1);
for (int x = 24; x < 188; x++) { AddEnemyPatrolNode("servant_brute_deadiler_1", "PathNodeArea_"+x, 0, ""); } for (int x = 24; x > 0; x--) { AddEnemyPatrolNode("servant_brute_deadiler_1", "PathNodeArea_"+x, 0, ""); }
}
void Reverse() { for (int x = 23; x > 1; x--) { AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+x, 0, ""); } } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity,false,true); PlaySoundAtEntity("","unlock_door", asEntity, 0, false); RemoveItem(asItem); }
void DollScare(string &in entity, string &in type) { SetEntityActive("ceiling_doll_1",true); AddPlayerBodyForce(0,0,100000,false); }
void HammerScare(string &in entity, string &in type) { AddPropImpulse("sledge_1", 30, 5, 20, "world"); PlaySoundAtEntity("FistPump", "FistPump.snt","Player", 0, false); }
void ChairScare(string &in asParent, string &in asChild, int alState) { //SetEntityActive("chairscare",false); if(chairScare == false) { PlaySoundAtEntity("StephanoScream", "StephanoScream.snt","Player", 0, false); AddPropImpulse("chairscare", 0, 0, -25, "world"); chairScare = true; AddTimer("1",2.0f,"StephanoDisappear"); } }
void GruntScare(string &in asParent, string &in asChild, int alState) { if(GruntScareDone == false) { SetEntityActive("servant_grunt_ragdoll_1",true); PlaySoundAtEntity("","react_scare","Player",0,false); AddPropImpulse("servant_grunt_ragdoll_1", 30, 0, 0, "world"); SetEntityActive("Stephano",true); PlaySoundAtEntity("HelloStephano", "HelloStephano.snt","Player", 0, false); AddTimer("1",3.0f,"CloseDoor"); AddTimer("2",4.0f,"CloseDoor"); GruntScareDone = true; } }
void CloseDoor(string &in asTimer) { if (asTimer == "1") { SetSwingDoorClosed("mansion_3", true, true); SetEntityActive("SpotLight_2",false); } if (asTimer == "2") { SetSwingDoorLocked("mansion_3", true, true); } }
void StephanoDisappear(string &in asTimer) { if(asTimer == "1") { SetEntityActive("chairscare",false); } }
void func_shelf(string &in asEntity, int alState) { if (alState == 1) { SetMoveObjectState("shelf_secret_door_rot_1",1.0f); PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false); 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", 0, false); } 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", 10, 100, ""); PlaySoundAtEntity("snd_scare", "react_scare.snt", "Player", 0.0, false); GiveSanityDamage(3, true); CreateParticleSystemAtEntity("PSRoses", "rose_petals_loop.ps", "chandelier_nice_1", false); } if(asTimer == "2") { SetEntityActive("spider_2",true); StartPlayerLookAt("spider_2", 10, 100, ""); GiveSanityDamage(3, true); } if(asTimer == "3") { StopPlayerLookAt(); SetLampLit("chandelier_nice_1", false, false); SetLampLit("bonfire_1", true, true); } if(asTimer == "4") { SetEntityActive("chandelier_nice_1", false); SetEntityActive("hanging_prisoner_1", true); StartPlayerLookAt("hanging_prisoner_1", 10, 100, ""); GiveSanityDamage(3, true); } if(asTimer == "5") { StopPlayerLookAt(); SetEntityActive("corpse_male_1", true); StartPlayerLookAt("corpse_male_1", 10, 100, ""); 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!
|
|
10-07-2011, 12:18 PM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
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 |
|
Gamemakingdude
Senior Member
Posts: 470
Threads: 82
Joined: Nov 2010
Reputation:
9
|
RE: ceiling doll not appearing!
Just a collide.
|
|
10-07-2011, 12:39 PM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
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 |
|
Gamemakingdude
Senior Member
Posts: 470
Threads: 82
Joined: Nov 2010
Reputation:
9
|
RE: ceiling doll not appearing!
void LeverOpen(string &in asParent, string &in asChild, int 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.
|
|
10-07-2011, 12:53 PM |
|
Gamemakingdude
Senior Member
Posts: 470
Threads: 82
Joined: Nov 2010
Reputation:
9
|
RE: ceiling doll not appearing!
Anyone wanna help?
|
|
10-07-2011, 03:07 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
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.
|
|
10-07-2011, 04:38 PM |
|
Gamemakingdude
Senior Member
Posts: 470
Threads: 82
Joined: Nov 2010
Reputation:
9
|
RE: ceiling doll not appearing!
//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", false, 1); 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 = 1; x < 23; x++) { AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+x, 0, ""); } AddEntityCollideCallback("servant_grunt_1", "ScriptArea_1", "Reverse", false, 1);
for (int x = 24; x < 188; x++) { AddEnemyPatrolNode("servant_brute_deadiler_1", "PathNodeArea_"+x, 0, ""); } for (int x = 24; x > 0; x--) { AddEnemyPatrolNode("servant_brute_deadiler_1", "PathNodeArea_"+x, 0, ""); }
} void MartinTalk_1(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("IntroduceMartin", "IntroduceMartin.snt","Player", 0, false); }
void MartinTalk_2(string &in asParent, string &in asChild, int alState) {
void LeverOpen(string &in asParent, string &in asChild, int alState) { SetMoveObjectStateExt("door_barricade_1",0.5f,5.0f,10.0f,0.0f,false); }
void Reverse() { for (int x = 23; x > 1; x--) { AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+x, 0, ""); } } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity,false,true); PlaySoundAtEntity("","unlock_door", asEntity, 0, false); RemoveItem(asItem); }
void DollScare(string &in asParent, string &in asChild, int alState) { if(dollScareDone == false) { SetEntityActive("ceiling_doll_1",true); AddPlayerBodyForce(0,0,100000,false); dollScareDone = true; } }
void HammerScare(string &in entity, string &in type) { AddPropImpulse("sledge_1", 30, 5, 20, "world"); PlaySoundAtEntity("FistPump", "FistPump.snt","Player", 0, false); }
void ChairScare(string &in asParent, string &in asChild, int alState) { //SetEntityActive("chairscare",false); if(chairScare == false) { PlaySoundAtEntity("StephanoScream", "StephanoScream.snt","Player", 0, false); AddPropImpulse("chairscare", 0, 0, -25, "world"); chairScare = true; AddTimer("1",2.0f,"StephanoDisappear"); } }
void GruntScare(string &in asParent, string &in asChild, int alState) { if(GruntScareDone == false) { SetEntityActive("servant_grunt_ragdoll_1",true); PlaySoundAtEntity("","react_scare","Player",0,false); AddPropImpulse("servant_grunt_ragdoll_1", 30, 0, 0, "world"); SetEntityActive("Stephano",true); PlaySoundAtEntity("HelloStephano", "HelloStephano.snt","Player", 0, false); AddTimer("1",3.0f,"CloseDoor"); AddTimer("2",4.0f,"CloseDoor"); GruntScareDone = true; } }
void CloseDoor(string &in asTimer) { if (asTimer == "1") { SetSwingDoorClosed("mansion_3", true, true); SetEntityActive("SpotLight_2",false); } if (asTimer == "2") { SetSwingDoorLocked("mansion_3", true, true); } }
void StephanoDisappear(string &in asTimer) { if(asTimer == "1") { SetEntityActive("chairscare",false); } }
void func_shelf(string &in asEntity, int alState) { if (alState == 1) { SetMoveObjectState("shelf_secret_door_rot_1",1.0f); PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false); 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", 0, false); } 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", 10, 100, ""); PlaySoundAtEntity("snd_scare", "react_scare.snt", "Player", 0.0, false); GiveSanityDamage(3, true); CreateParticleSystemAtEntity("PSRoses", "rose_petals_loop.ps", "chandelier_nice_1", false); } if(asTimer == "2") { SetEntityActive("spider_2",true); StartPlayerLookAt("spider_2", 10, 100, ""); GiveSanityDamage(3, true); } if(asTimer == "3") { StopPlayerLookAt(); SetLampLit("chandelier_nice_1", false, false); SetLampLit("bonfire_1", true, true); } if(asTimer == "4") { SetEntityActive("chandelier_nice_1", false); SetEntityActive("hanging_prisoner_1", true); StartPlayerLookAt("hanging_prisoner_1", 10, 100, ""); GiveSanityDamage(3, true); } if(asTimer == "5") { StopPlayerLookAt(); SetEntityActive("corpse_male_1", true); StartPlayerLookAt("corpse_male_1", 10, 100, ""); 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() { }
|
|
10-07-2011, 04:41 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: ceiling doll not appearing!
Use SetLeverStuckState instead of SetMoveObjectStateExt.
|
|
10-07-2011, 04:44 PM |
|
Gamemakingdude
Senior Member
Posts: 470
Threads: 82
Joined: Nov 2010
Reputation:
9
|
RE: ceiling doll not appearing!
Still doesnt open it.
|
|
10-07-2011, 04:51 PM |
|
|