I’m having trouble with creating a calendar system for my game which includes a “day of the week” cycle and a 24 hour clock
What items do you want to show up on the screen?
And just curious, but is it a fantasy calendar or our usual gregorian?
Our usual Gregorian calendar and I just want the day of the week to be depicted as so:
Today is (Monday) and class starts at 8:00 and ends at 10 am… You have (x) hours to go until your next session of class starts. Currently on is the class of (whatever). Note: On weekends, there is no class
Hmm. So there’s also hour.
I suppose you can treat the hour as a basic “resource” which depletes whenever you make a choice.
Here’s what I’ve got currently. For the time/hour
*create hour 0
<<Let's just assume we got 100 hrs 'cuz why not>>
*set hour 100
<<This is the template you want to go for "doing stuff reduces hour">>
*choice
#Do a thing
*set hour -10
#Another thing
*set hour -15
#and so on
*set hour -100
<<To prevent hour minus. Might want to turn it into subroutine>>
*if hour <= 0
*set hour 0
<<For time sensitive contents/mandatory contents>>
*if hour = 0
It's time for the next session!
As for the day, it’s pretty simple
*create day 0
<<To make different schedules for each day, you might want to make a *label for each day>>
*if day = 1
*goto sunday <<contains story snippet of sunday>>
*elseif day = 2
*goto monday <<and so on>>
<<don't forget to include *set day [number] at each *label>>
<<as for the stats screen>>
Today is @{(day +1) |Sun|Mon|Tues|Wed|Thirs|etc.} and class starts at 8:00 and ends at 10 am… You have ${hour} hours to go until your next session of class starts. Currently on is the class of (whatever). Note: On weekends, there is no class.
Of course, if you have more to ask, ask away. Even I’m not really satisfied with this solution as I don’t have more time to think a better one.
Error: choicescript_stats line 2: invalid @{} variable substitution at letter 10
What does this mean? I did everything exactly as you told me
Well, you don’t have to actually follow my codes. I’m just giving the big picture.
Anyway, can I see your code? How did you write the multireplace @{} ?
This is what I wrote on the choicescript_stats screen. But $ signs are all missing, I apologise for it
You are ${location}, ${title} ${name}! You currently wear ${clothes} currently, and you are a ${title} of ${university} university. Your current rank is ${rank}.
Today is @{(day +1)} and class starts at 8:00 and ends at 10 am… You have ${hour} hours to go until your next session of class starts. Currently on is the class of (whatever).
Note: On weekends, there are no classes availiable and you’re free to do whatever!
Meanwhile on the startup screen:
*label day
*set day
*if day = 1
*goto Sunday
*if day = 2
*goto Monday
*if day = 3
*goto Tuesday
*if day = 4
*goto Wednesday
*if day = 5
*goto Thursday
*if day = 6
*goto Friday
*if day = 7
*goto Saturday*label Sunday
Today is the Sabbath and the end of the weekend! Last day before class starts!
*set day 1
*set day “Sunday”*label Monday
Today is Monday
*set day 2
*set day “Monday”*label Tuesday
Today is Tuesday
*set day 3
*set day “Tuesday”*label Wednesday
Today is Wednesday
*set day 4
*set day “Wednesday”*label Thursday
Today is Thursday
*set day 5
*set day “Thursday”*label Friday
Today is Friday- it’s the last day of this week!
*set day 6
*set day “Friday”*label Saturday
Today is Saturday, and the start of the weekend
*set day 7
*set day “Saturday”
Oh, I C.
Are you already familiar with multireplace command?
You need to add “what happened” inside the command, especially on this part.
Today is @{(day +1)}
For more info, this is the announcement when multireplace got added to CScript.
Error: choicescript_stats line 2: invalid character. (ChoiceScript text should be saved in the UTF-8 encoding.) Today is @{(day +1) |Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday} and class starts at 8:00 and ends at 10 am�
Hm, the error mentions UTF-8.
Did you saved your files with UTF-8 encoding?
How do I save it with UTF-8 encoding? Show me how
If you’re on windows and use default notepad program:
- Save as
- On the left of the cancel/save button duo, there’s a drop-down menu. Pick UTF-8
- Save
If you use Notepad++
- IIRC, try opening the File button (or Edit, or View, one from the bar)
- Find the option “Encoding”
- Pick UTF-8
I’m on phone, so I can’t provide screenshots for now. When I get back, I’ll see what I can do. If you’re on Mac, I’m not sure what should you do exactly, but the gist should be the same.