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
Script Help Puzzle Script Won't Reset
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#1
Puzzle Script Won't Reset

Hey Smile I was just wandering if for the sake of a puzzle in my custom story whether it would be possible to reset the puzzle should the player fail it as I have attempted to reset the variables however it refuses to work a second time. The puzzle involves the player having to ignite torches in a specific order and if they get it wrong the torches will be unlit and the player will have to attempt it again.

I don't know if it's going to be of much use but here's the puzzle script Tongue
          void Equality(string &in asEntity, string &in type)
          {
          if(GetLocalVarInt("PuzzleLightCount") > 1 || GetLocalVarInt("PuzzleLightCount") == 1)
          {
          AddLocalVarInt("PuzzleLightCount", 1);
          }
          
          if(GetLocalVarInt("PicturePuzzle") == 1)
          {
          AddLocalVarInt("PicturePuzzle", 1);
          }
          
          if(GetLocalVarInt("PuzzleLightCount") == 5 && GetLocalVarInt("PicturePuzzle") < 5)
          {
          AddTimer("", 0, "PuzzleFail");
          }
        }
          
          void Congregation(string &in asEntity, string &in type)
          {
          if(GetLocalVarInt("PuzzleLightCount") > 1 || GetLocalVarInt("PuzzleLightCount") == 1)
          {
          AddLocalVarInt("PuzzleLightCount", 1);
          }
          
          if(GetLocalVarInt("PicturePuzzle") == 2)
          {
          AddLocalVarInt("PicturePuzzle", 1);
          }
          
          if(GetLocalVarInt("PuzzleLightCount") == 5 && GetLocalVarInt("PicturePuzzle") < 5)
          {
          AddTimer("", 0, "PuzzleFail");
          }
        }

          void Unity(string &in asEntity, string &in type)    
          {
          if(GetLocalVarInt("PuzzleLightCount") > 1 || GetLocalVarInt("PuzzleLightCount") == 1)
          {
          AddLocalVarInt("PuzzleLightCount", 1);
          }
          
          if(GetLocalVarInt("PicturePuzzle") == 3)
          {
          AddLocalVarInt("PicturePuzzle", 1);
          }
          
          if(GetLocalVarInt("PuzzleLightCount") == 5 && GetLocalVarInt("PicturePuzzle") < 5)
          {
          AddTimer("", 0, "PuzzleFail");
          }
         }

          void Execution(string &in asEntity, string &in type)
          {
          if(GetLocalVarInt("PuzzleLightCount") > 1 || GetLocalVarInt("PuzzleLightCount") == 1)
          {
          AddLocalVarInt("PuzzleLightCount", 1);
          }
          
          if(GetLocalVarInt("PicturePuzzle") == 4)
          {
          StopMusic(0.0, 1);
          PlayMusic("02_puzzle", false, 100, 0, 1, true);
          GiveSanityBoost();
          }
          
          if(GetLocalVarInt("PuzzleLightCount") == 5 && GetLocalVarInt("PicturePuzzle") < 5)
          {
          AddTimer("", 0, "PuzzleFail");
          }
         }
        
          void PuzzleFail(string &in asTimer)
          {
           StopMusic(0.3, 1);
           PlayGuiSound("CustomScare02", 0.3);
           SetMessage("Messages", "PuzzleOneFail", 1);
           SetLocalVarInt("PuzzleLightCount", 1);
           SetLocalVarInt("PicturePuzzle", 1);
           AddTimer("", 1, "PuzzleReset");
          }
          
          void PuzzleReset(string &in asTimer)
          {
           SetLampLit("PuzzleCandle01", false, true);
           SetLampLit("PuzzleCandle02", false, true);
           SetLampLit("PuzzleCandle03", false, true);
           SetLampLit("PuzzleCandle04", false, true);
          }

Thanks in advance Big Grin

The Harrowing Tale Of Redendrew Mansion
(This post was last modified: 11-21-2013, 07:22 PM by D3AD UPR1S1NG.)
11-21-2013, 12:13 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: Puzzle Script Won't Reset

As far as i can see your arent CHECKING if stuff is gonne happen.
here is an example from my mod. :
}
void ReSpawnRunners ()
{
if ( GetLocalVarInt( "SpawnMonsterCheckRunners") == 1)
{
AutoSave();
}
}
ReSpawnRunners();
The ReSpawnRunners(); Put that in PuzzleFail(string &in asTimer){}
IF i am correct, didnt take real close look.
11-21-2013, 02:50 PM
Find
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#3
RE: Puzzle Script Won't Reset

(11-21-2013, 02:50 PM)DnALANGE Wrote: As far as i can see your arent CHECKING if stuff is gonne happen.
here is an example from my mod. :
}
void ReSpawnRunners ()
{
if ( GetLocalVarInt( "SpawnMonsterCheckRunners") == 1)
{
AutoSave();
}
}
ReSpawnRunners();
The ReSpawnRunners(); Put that in PuzzleFail(string &in asTimer){}
IF i am correct, didnt take real close look.

Thanks for the help Smile but I managed to fix it by redoing the entire script, thanks again Smile

The Harrowing Tale Of Redendrew Mansion
11-21-2013, 07:21 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: Puzzle Script Won't Reset

Ok that is good, you found the problem.
You can tell the people here what you did so we can all learn from things.
And please add this SOLVED in your treath status.
11-22-2013, 03:58 PM
Find




Users browsing this thread: 1 Guest(s)