Announcement: Why not try our official idea generator for inspiration when making puzzles?


Caravel Forum : DROD Boards : Architecture : Making a 12-hour Clock System?
New Topic New Poll Post Reply
Poster Message
Camwoodstock
Level: Master Delver
Avatar
Rank Points: 115
Registered: 07-02-2014
IP: Logged
icon Making a 12-hour Clock System? (0)  
I'm trying to make a 12-hour AM/PM clock system as part of a very, very devious hold. This relies on a script which increments a raw Minutes variable every few turns, and there's a further script to convert the raw minutes into a clock timer... However, I can't figure out how to actually do this. I tried, but it caused some issues with the values essentially turning into -1:0... Which is not exactly a known time.

For reference, he's the script that initializes the original values for these variables, located at the first room of the hold:
  Set var "Minutes" = 0
  Set var "Clock_Hour" = 6
  Set var "Clock_Minutes" = 0
  End 


Here's my script to process the Minutes into the clock format:
Label timer
  Wait 0
  Set var "Clock_Minutes" = Minutes % 60
  Set var "Clock_Hour" = (Minutes / 60) - (Minutes % 60)
  Go to timer


A way to make it forcibly display two digits would also be nice, but is optional. If anyone has any leads, let me know.

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, Rooted Hold Runner, Lowest Point Watcher, and 132nd Skywatcher (and 13th Gel Authority)
Mastered all of GatEB, KDD 2.0, JtRH, and TCB! | Saw The Second Sky! (lots of secrets left!)

Her/him | & | Steam | Backloggery
11-29-2019 at 05:18 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4590
Registered: 02-20-2007
IP: Logged
icon Re: Making a 12-hour Clock System? (0)  
DROD works in integers, so to get the hour, you just want Set var "Clock_Hour" = (Minutes / 60). I think you were trying to subtract the fractional part to get the integer remainder, and there's no need for that; DROD will do it for you.

Also, if you want the system to start at 6:00 (as Set var "Clock_Hour" = 6 implies), then it should be Set var "Clock_Hour" = (Minutes / 60) + 6.

____________________________
50th Skywatcher
11-29-2019 at 07:16 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1530
Registered: 06-13-2015
IP: Logged
icon Re: Making a 12-hour Clock System? (0)  
That, or you should initialize the minutes differently, so that you start with 360 minutes already "passed".

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text

11-29-2019 at 07:39 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Making a 12-hour Clock System?
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.