03-16-2014, 01:09 AM
So I have this crank on the wall which you can use a hammer to make it get fixed.
After that the player turns the crank and the ladder goes down, now there's this bug that is happening to me. 1st when I touch the stuck crank the ladder goes down already without doing anything 2. is that when the hammer hits it, the ladder quickly goes down, I want the player to be able to turn the crank before the ladder goes down not just hit the crank with the hammer and the ladder goes down quickly!
I'm not sure if I missed anything or if it's a bug but yeah here is the script that I'm using
Do you think there is something that is causing this problem? :/
After that the player turns the crank and the ladder goes down, now there's this bug that is happening to me. 1st when I touch the stuck crank the ladder goes down already without doing anything 2. is that when the hammer hits it, the ladder quickly goes down, I want the player to be able to turn the crank before the ladder goes down not just hit the crank with the hammer and the ladder goes down quickly!
I'm not sure if I missed anything or if it's a bug but yeah here is the script that I'm using
PHP Code:
InteractConnectPropWithMoveObject("ladderwithcrank", "Crank", "LadderPuzzle", true, false, 0);
PHP Code:
void InteractCrank(string &in asEntity)
{
AddQuest("TouchCrank", "TouchCrank");
}
void Test1(string &in asItem, string &in asEntity)
{
SetPlayerActive(false);
SetEntityActive("stone_hammer_move_1", true);
SetMoveObjectState("stone_hammer_move_1", 0.25f);
SetEntityInteractionDisabled("Crank", true);
AddTimer("1", 0.2f, "TimerHammer");
AddTimer("2", 0.6f, "TimerHammer");
AddTimer("3", 0.8f, "TimerHammer");
AddTimer("4", 1.2f, "TimerHammer");
AddTimer("5", 1.4f, "TimerHammer");
}
void TimerHammer(string &in asTimer)
{
if(asTimer == "1"){
PlaySoundAtEntity("bang", "impact_wood_med", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "Crank", false);
SetMoveObjectState("stone_hammer_move_1", 0.0f);
}
if(asTimer == "2"){
SetMoveObjectState("stone_hammer_move_1", 0.25f);
}
if(asTimer == "3"){
SetMoveObjectState("stone_hammer_move_1", 0.0f);
CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "Crank", false);
PlaySoundAtEntity("bang", "impact_wood_med", "Player", 0, false);
}
if(asTimer == "4"){
SetMoveObjectState("stone_hammer_move_1", 0.25f);
}
if(asTimer == "5"){
SetEntityActive("stone_hammer_move_1", false);
PlaySoundAtEntity("bang", "impact_rock_high", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "Crank", false);
CompleteQuest("TouchCrank", "TouchCrank");
GiveSanityBoostSmall();
SetWheelStuckState("Crank", 0, true);
SetEntityInteractionDisabled("Crank", false);
SetPlayerActive(true);
PlayMusic("23_puzzle.ogg", false, 0.7f, 0.5f, 9, false);
SetInventoryDisabled(true); //This is so the music doesnt drag on by having this up
AddTimer("music", 4.0f, "TimerMusic");
AddTimer("inventory", 6.0f, "TimerMusic");
}
}
void TimerMusic(string &in asTimer)
{
if(asTimer == "music"){
StopMusic(4.0f, 9);
return;
}
SetInventoryDisabled(false);
}
//If ladder if in this area, turn off ladder area. Else, allow player to climb it
void CollideCheckLadder(string &in asParent, string &in asChild, int alState)
{
if(alState == -1){
SetEntityActive("LadderArea_1", true);
}
if(alState == 1){
SetEntityActive("LadderArea_1", false);
}
}
void CollideAreaLook(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("LadderPuzzle", 1.0, 1.0, "Function");
AddTimer("LaderPuzzle", 4, "Function");
}
void Function(string &in asTimer)
{
StopPlayerLookAt();
}
void TimerAreaStep(string &in asTimer)
{
int iRand = RandInt(1, 2);
PlaySoundAtEntity(asTimer+iRand, "scare_wood_creak_scuf.snt", asTimer+iRand, 1, false);
SetRadialBlurStartDist(0.8f);
FadeRadialBlurTo(0.1f, 0.03f);
AddTimer("EndRadial", 4.0f, "TimerEndRadial");
AddTimer(asTimer, RandFloat(15.0f, 30.0f), "TimerAreaStep");
}
Do you think there is something that is causing this problem? :/