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