The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
Puzzle Script Won't Reset - by D3AD UPR1S1NG - 11-21-2013, 12:13 PM
RE: Puzzle Script Won't Reset - by DnALANGE - 11-21-2013, 02:50 PM
RE: Puzzle Script Won't Reset - by D3AD UPR1S1NG - 11-21-2013, 07:21 PM
RE: Puzzle Script Won't Reset - by DnALANGE - 11-22-2013, 03:58 PM



Users browsing this thread: 1 Guest(s)