System Date system 1.0

Lobster

Old Fogey ofthe site
Reaction score
90
DATE SYSTEM 1.0

A simple date system that allows a custom calendar Which can be customized. Runs on GUI and includes documentation. This can be used for making games that have events on certain dates or days. The system also allows you to define what a day is, wether it be 1 second, or 600 (or more)

In game usage: The game automatically displays a date, including the month(customizable,) the day(customizable), and the day of the month.

Importing:
Modify the variables under the calendar trigger to change the names of the days and months.
Next edit the next day event to a number equal to your days length.

To copy this system into your map, make sure the create unknown variables event is on. then copy the Event system folder.
and that you set the variable array Daysofthweek to 7, and the Months of the year variable to 12.

How does this system work?

This system works by assigning all the days of the week and names of the months a string variable in an array. when a new day occurs, each array is increased by 1. If the array goes bigger than a set number, then the array is set to one and reset.

What can I use this system for?

This system can be used to create games with events only on certain days or months

Do I need to give credits?
This would be apreciated, but is not nesesary(sorry, i cant spell)



Uses GUI:
Code:
Variables
    Events
        Map initialization
    Conditions
    Actions
        Set Daysoftheweek[1] = Monday
        Set Daysoftheweek[2] = Tuesday
        Set Daysoftheweek[3] = Wednesday
        Set Daysoftheweek[4] = Thursday
        Set Daysoftheweek[5] = Friday
        Set Daysoftheweek[6] = Saturday
        Set Daysoftheweek[7] = Sunday
        Set monthsoftheyyear[1] = January
        Set monthsoftheyyear[2] = February
        Set monthsoftheyyear[3] = March
        Set monthsoftheyyear[4] = April
        Set monthsoftheyyear[5] = May
        Set monthsoftheyyear[6] = June
        Set monthsoftheyyear[7] = July
        Set monthsoftheyyear[8] = August
        Set monthsoftheyyear[9] = September
        Set monthsoftheyyear[10] = October
        Set monthsoftheyyear[11] = November
        Set monthsoftheyyear[12] = December
Code:
Calendar init
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Set WeekNumber = 1
        Set Dateint = 1
        Set RandomINT = (Random integer number between 1 and 12)
        Game - Display to (All players) the text: (The month is:  + monthsoftheyyear[RandomINT])
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RandomINT Equal to (Integer A)
                    Then - Actions
                        Set CurrentMonth = (Integer A)
                    Else - Actions
        Set RandomINT = (Random integer number between 1 and 7)
        Game - Display to (All players) the text: (The day is:  + Daysoftheweek[(Random integer number between 1 and 7)])
        For each (Integer A) from 1 to 7, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RandomINT Equal to (Integer A)
                    Then - Actions
                        Set CurrentDay = (Integer A)
                    Else - Actions

Code:
Calendar init
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Set WeekNumber = 1
        Set Dateint = 1
        Set RandomINT = (Random integer number between 1 and 12)
        Game - Display to (All players) the text: (The month is:  + monthsoftheyyear[RandomINT])
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RandomINT Equal to (Integer A)
                    Then - Actions
                        Set CurrentMonth = (Integer A)
                    Else - Actions
        Set RandomINT = (Random integer number between 1 and 7)
        Game - Display to (All players) the text: (The day is:  + Daysoftheweek[(Random integer number between 1 and 7)])
        For each (Integer A) from 1 to 7, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RandomINT Equal to (Integer A)
                    Then - Actions
                        Set CurrentDay = (Integer A)
                    Else - Actions
 

Attachments

  • Date system.w3x
    14.1 KB · Views: 249
  • date system screenie.jpg
    date system screenie.jpg
    52.8 KB · Views: 248

Romek

Super Moderator
Reaction score
963
Post the code, a description, instructions, and format your post better.
 

Romek

Super Moderator
Reaction score
963
No need for the first set of spoilers. :p
You still haven't explained what the system actually does, including in-game usage.
 

Executor

I see you
Reaction score
57
Code:
Calendar init
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Set WeekNumber = 1
        Set Dateint = 1
        Set RandomINT = (Random integer number between 1 and 12)
        Game - Display to (All players) the text: (The month is:  + monthsoftheyyear[RandomINT])
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RandomINT Equal to (Integer A)
                    Then - Actions
                        Set CurrentMonth = (Integer A)
                    Else - Actions
        Set RandomINT = (Random integer number between 1 and 7)
        Game - Display to (All players) the text: (The day is:  + Daysoftheweek[(Random integer number between 1 and 7)])
        For each (Integer A) from 1 to 7, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RandomINT Equal to (Integer A)
                    Then - Actions
                        Set CurrentDay = (Integer A)
                    Else - Actions

=>

Code:
Calendar init
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Set WeekNumber = 1
        Set Dateint = 1
        Set CurrentMonth = (Random integer number between 1 and 12)
        Game - Display to (All players) the text: (The month is:  + monthsoftheyyear[CurrentMonth])
        Set CurrentDay = (Random integer number between 1 and 7)
        Game - Display to (All players) the text: (The day is:  + Daysoftheweek[CurrentDay])

...
...
...

am I missing sth. or is this a joke?
 

Jesus4Lyf

Good Idea™
Reaction score
397
All this does is generate two random numbers and load from a string array. This is not something that is worth finding on this site.

You've also posted the code for one of the triggers twice, by the way... Don't know if that was a mistake covering up some awesome functionality or something.

Graveyarded.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top