Many questions for my Oregon Trail style game concept.

Abigail Storm
07 Dec 2016, 23:33

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.

  1. Could I program a calendar into Online Quest, where the days pass except when you're on a planet, or is that an impossibility? I wish I could have my characters travel for a certain number of days before they could arrive at their next stop. It would take less than a year for the journey to end, and I plan for the journey to start in April, so...
  2. Could I program a ship to travel with my characters? Edit, yes, I can, I just need to figure out how to program "If object is in room logic.
  3. Could I program diseases, where the character would get sick and lose health faster?
  4. If I can program a ship, could I program it to break and need spare parts?
  5. I can't find anything on hunting and ammo. How would I do that?
  6. If I can figure out how to have a calendar, I'd like my character to be held up by events. Is there a way I could do that?
    7: How would I program food to be worth more to every character's health if there are less characters?
    8: Medicine to remove the disease condition.
    9: Theft or fire destroying items?
    Help with any of these items would be greatly appreciated. (I may even put thanks to you in the end sequence.)
    Edit: I decided for my ease, I'm going to design the game with one character, and add others later. (Possibly if/when I get a windows computer)

The Pixie
08 Dec 2016, 08:42

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))

The Pixie
08 Dec 2016, 08:48

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.


Abigail Storm
08 Dec 2016, 21:09

Thanks! I've actually decided to program food to be worth more if I have less players!


hegemonkhan
08 Dec 2016, 21:14

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.


Abigail Storm
08 Dec 2016, 22:04

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.


Abigail Storm
08 Dec 2016, 22:06

Fixed It! turns out I messed up on the function name. Yes! I think I may have to make slight alterations.


hegemonkhan
08 Dec 2016, 22:15

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)


Abigail Storm
08 Dec 2016, 22:21

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.


Abigail Storm
08 Dec 2016, 22:23

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.


Abigail Storm
08 Dec 2016, 22:32

Oops, said essentially the same thing twice...


DarkLizerd
15 Dec 2016, 05:35

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?


DarkLizerd
15 Dec 2016, 05:44

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...