Date Extension

Dom818

  • *
  • Posts: 1296
Yep, sound good ! Thanks for the integration, it's cool for us !

An updated version with the blocks I specified above has now been uploaded to the first post. Try it out and let me know what you think.

Aasimar

  • *
  • Posts: 605
Damn cool !
Deleted my custom blocks to use yours !

Thanks Dom !

Dom818

  • *
  • Posts: 1296
Glad it works for you!

ta2909i

  • Posts: 8
Where can I download this from?    ???

Dom818

  • *
  • Posts: 1296
Where can I download this from?    ???

You can find the download on the first post of this thread.

is it possible to make a countdown timer using the date?

Dom818

  • *
  • Posts: 1296
is it possible to make a countdown timer using the date?

Yeah, it's possible. You would need to save a time stamp at when you start the countdown plus how long you want the timer to be. Once you have that, subtract that time by the current timestamp to get how much time is left. You can then use conversion blocks if you want to display the time left.

thanks man, please would you help me with an example

addable13

  • Posts: 15
how do i install

UnrealCanine

  • Posts: 244
This might be a stretch, but would I be able to use this to tell when the next full moon would be (e.g. so a moon in the game matches the Moon phase in real life), or that just too impossible

Innes

  • *
  • Posts: 1961
All the date extension can do, is tell you the time and date. However using that information, you can calculate anything that is based on the time and / or date. There are algorithms to calculate moon phases, such as:


http://www.voidware.com/moon_phase.htm


It is well commented, so I don't see why you couldn't create this with Stencyl blocks; it just appears to be very basic math.


Another option would be to find a reliable source of moon phase information on the web, and scrape it using the [visit URL...] block, although this would require an Internet connection. I think the algorithm above would be a better solution.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

Dom818

  • *
  • Posts: 1296
This might be a stretch, but would I be able to use this to tell when the next full moon would be (e.g. so a moon in the game matches the Moon phase in real life), or that just too impossible

I can probably use Innes' link to build a moon phase function (either in the extension of as a behavior you import).  I'll think about which one I'll do and make it soon (probably tonight as long as homework allows).

Also, thank you Innes for the information on moon  phases. It is very helpful.

Innes

  • *
  • Posts: 1961
Maybe validate the algorithm against another source before using it!
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

LIBERADO

  • *
  • Posts: 2715
@Dom818, thanks so much for this useful extension.

Let me tell you that I think there is an error in it.

It seems that the "current day of the week (0-6)" option does not give the correct result.

Please, see the attached image:

« Last Edit: September 26, 2014, 05:45:31 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Rimrook

  • Posts: 251
Yeah I ran into the 0-6 day of the week problem too.
If you plan on updating this extension, that'd be a good thing to fix.