I'm sorry, I have a bunch of questions. It seems I'm a bit out of my depth, but I'm trying to learn how to swim.
So a calender...
A big complication here is that your planet will not take 365.2422 days to orbit its star or 24 hours to spin on its own axis; do you want the calendar to reflect the planet's date and time, or earth date and time? I am going to assume the later, because then we can use a function I already have.
Create a function called DataAsString that returns a string, and has a single parameter, days. Paste in this code (you might want to change the number in the second line):
months = Split("January;February;March;April;May;June;July;August;September;October;November;December", ";")
year = 2000
flag = true
while (flag) {
if (year % 4 = 0) {
days_this_year = 366
}
else {
days_this_year = 365
}
if (day > days_this_year) {
year = year + 1
day = day - days_this_year
}
else {
flag = false
}
}
if (year % 4 = 0) {
days_in_months = Split("31;29;31;30;31;30;31;31;30;31;30;31", ";")
}
else {
days_in_months = Split("31;28;31;30;31;30;31;31;30;31;30;31", ";")
}
month = 0
for (i, 0, 11) {
days_in_month = ToInt(StringListItem(days_in_months, i))
if (day > days_in_month) {
month = month + 1
day = day - days_in_month
}
else {
return ("" + day + "th of " + StringListItem(months, month) + ", " + year)
}
}
In the start script of the game object, set the start date, as the number of days after the year 2000 (or whatever you set in that second line). This will make it 4/Apr/02 (I think):
game.days = 365 + 365 + 31 + 28 + 31 + 4
If something takes 10 days, then:
game.days = game.days + 10
If you want to display the current date:
msg(DateAsString(game.days))
Objects have an attribute called parent that determines where in the game world it is (and you ca use attributes, even on line!). If an item is in a room, then its parent attribute is that room, if it is in a container, then the attribute is that container, if the player has it, then parent is the player.
To check if an object called teapot is carried by the player:
if (teapot.parent = player) {
To check if it is in the lounge:
if (teapot.parent = lounge) {
To check if it is in the same room as the player:
if (teapot.parent = player.parent) {
All the stuff stuff you describe is possible, if not necessarily trivial.
Thanks! I've actually decided to program food to be worth more if I have less players!
we can/will help with how to do the stuff, and may help with giving an example design, but you're asking to make a lot of designs, which is a lot of your game. Making designs/systems takes a lot more work (granted, it's easier, the better you're at programming: Pixie can create stuff fast and easy whereas I take a long time and with difficulty, but it's still more work for us regardless of our coding/designing abilities, than to just help understanding how to do the basic stuff involved that you need for the design/system).
also, what may seem like something simple, in actually creating/coding it, even the most seemingly simple things, are often quite complex and not quick/simple to do.
Pixie is a machine (lol), most of the guides/code samples/libraries/help etc is his work, that he's so kindly done to help everyone else on all of this stuff.
It's okay, i didn't know if anyone had done it before. I am working on fixing Pixie's calendar, because the message it's giving me is an error message.
Fixed It! turns out I messed up on the function name. Yes! I think I may have to make slight alterations.
This may not help, but here's a link to maybe give you an idea on how to do this stuff (gun/shooting/combat scripting+attributing):
http://textadventures.co.uk/forum/quest/topic/4946/solved-how-to-count-ammunition
(ignore the, 'whatever' Object -> 'Attributes' Tab -> Attributes -> Add -> blah blah blah, stuff as the web/online version doesn't have this, but do look at the scripting stuff, as hopefully you can do that wthin the online/web version. Or if not... then the scripting only applies to using the 'game' Game Object's 'start' Script Attribute)
Thanks! I actually have changed up the game a bit, to make my life a bit easier. I'm currently working on how to make a simpler day counter, as I feel that the Earth date wouldn't be as important.
Thanks! I'm actually thinking of simplifying it a bit. I feel calendars wouldn't matter much to a space traveler. I just set up a disease attribute. (Don't know what I'm going to do with it yet.
You could always use "ship time" for tracking, travel time, fuel use, food use....
No need to change to planet time at every docking...
But then again... Planet time would be based on where you are on that world...
After all, it is 10:30 PM here, (New Mexico, USA, night),
but in London, England it could be 6:30 AM... time for early risers to start their day...
and 4:30 PM in China (? just guessing) and end of their day...
So... when you entered orbit, who, and where, did you hail?
What time zone? Is it their day or night?
Side note...
For spacers, a 400 day year with a 10 day work week makes the math so much easer!
And you could have 20 months of 20 days...
A 24 hour day would be the standard for Earthers or Terrans, but other races may be accustom
to the equivalent of a 20 hour day to a 36 hour day...