Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Can someone help explain this script?

ok, heres what im trying to do...  I need a time system for vx that has months and seasons and what not.  the closest i can find it the kts time system but its missing the the months and seasons so im attempting to edit it.  i just hope i dont make my pc explode : P

im thinking that if i can understand klocks script i will be able to add these things in, but i need help understanding some of the lines.  theres a part at the begining where it assigns switches and variables to seconds, hours, times of day and such. 
heres the bit of code, im not sure if you need the whole thing
Code:
  # Settings for Output to Game Variables option.
  #-----------------------------------------------------------------------
  # Set this to true to output the current time to game variables.
  DATABASE_OUTPUT = true
    # Game Variable to be used for time output.
    TIME    = 1 #(Time in string format. Ex: "2:48 AM" or "02:48")
    SECONDS = 2 
    MINUTES = 3 
    HOURS   = 4 
    DAYS    = 5 
    DAYNAME = 6
    # Game Switches to be used for time output.
    NIGHT   = 1 # This switch is on during night hours   (2200-0400)(10pm-4am)
    DAWN    = 2 # This switch is on during dawn hours    (0500-0800)( 5am-8am)
    DAY     = 3 # This switch is on during daytime hours (0900-1800)( 9am-6pm)
    SUNSET  = 4 # This switch is on during sunset hours  (1900-2100)( 7pm-9pm)
but what i dont understand is the connection between the numbers themselves, and the switches and variables.  how does the "night = 1" activate the 001 switch for instance?
 
It appears to be integers corresponding to game variables and switches. Meaning, if TIME is set to 1, it uses Variable 0001's value or something like that. I cannot know for sure how it is used apart from reading those comments without the full script, but that appears to be the case basically.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top