[IMPLEMENTED] Exposing information about moonphases to JS engine

If Wishes were UOX Coders, we'd be done by now ;P Post your wishes/suggestions for UOX3 changes/improvements here.
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Exposing information about moonphases to JS engine

Post by Xuri »

The moonphases of Britannia are saved in time.wsc (in CVS build, uox.ini in latest release build), and thus I assume they actually change ingame as well. It would be nice to have a way of reading that information from within the JS engine, somehow.

The information could be used to script moon-related stuff like... say.. spyglasses that tell you the moonphases, old-school moongates which teleport you to a destination determined by the moonphaes - or for instance characters that turn into werevolves during full moon ;)
Last edited by Xuri on Sat May 26, 2007 1:21 am, edited 1 time in total.
-= Ho Eyo He Hum =-
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Wow!

When was this implemented? That would be awesome. I would love a script that created the moongate at specified location to a specified destination a la Ultima IV. I think that would be a great idea for moonphase-determined events.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

The moonphase values have existed in the .ini file since version 0.67w, and back then they were implemented to affect world lighting. They have, to my knowledge, never been used for anything else in UOX3 since.
-= Ho Eyo He Hum =-
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Do they still affect world lighting?

How did a player know what moonphase it is?

I agree with you that such a feature could introduce a whole new world to UO, that would even be condusive to traditional Ultima Lore:

--Moongates only open at their phase and teleport to the other phase
--spyglass or other tool to identify phase. Cartography skill perhaphs?
--Skull of Mondain appears only appears at it's phase.
--Make Shrine of Spirituality appear at it's phase.


Other ideas

--Weapons that do special effects/damage during a specified phase
--Other items/magical armours that do things based on phase.
--Magical doors that only unlock/appear during a certain phase. (A. La. Tolkien Style)
--A cult of NPCs that appear in the forest during a certain phase
--Xuri's werewolf idea
--Magical Skull Keys that improve picklocking on a certain phase.

I think this is a fun idea and would like it implemented. That list was just a 30 second brain dump I had of ideas that would work with such a script.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Coming soon to the next UOX release near you.... Moonphases Gone Wild!

We expose theese moonphases to the world, and JavaScript totally has its way with them!!!
Scott
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

This is up on the CVS
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Excellent :) Now I can finish my moonstones script :)
-= Ho Eyo He Hum =-
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Care to post (Uox3 guide style) the functions that you implemented and a short example on how to use them?

I'm doing an accelerated engineering class at the moment and won't have any free time until mid june; however, I'd like to see some examples of this script so I can jot down some pseudo-code of some ideas that I have.

What is this moonstone script, Xuri?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Simple:
To read the phases of the moon(s):

Code: Select all

var FeluccaMoon = Moon( 0 );
var TrammelMoon = Moon( 1 );
To set the phases of the moon(s):

Code: Select all

Moon( 0, # ); //Felucca moon
Moon( 1, # ); //Trammel moon
The various moonphases (# in above example):
0 = Full Moon
1 = Waning Gibbous
2 = Last Quarter
3 = Waning Crescent
4 = New Moon
5 = Waxing Crescent
6 = First Quarter
7 = Waxing Gibbous

(Note that we're talking about the moons Felucca and Trammel here, not the facets Felucca and Trammel.)
stranf wrote:What is this moonstone script, Xuri?
Short description: Small stones that can be used to gate from Felucca to Trammel and vice versa.
Long description: Moonstones @ Stratics
-= Ho Eyo He Hum =-
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Thanks Xuri!

Now I just need to get out my old U4 rule book and set up these moongates.

So here are some thoughts/concerns I'm going to throw out to you at the top of my head using these scripts:

--How often do the moon phases change?
--How hard would it be to remove the current moongate (OSI) system and replace it with an Ultima IV style system? Have the moongate pop up in it's supposed location and teleport you to the new location based on moon phase?

--Looks like the GM has the ability, if you create a script, to set the moon phase if the PCs on a quest decide to sit and "wait it out", is there a way to adjust how long it takes for a moongate to change phase normally?


This could be very interesting. There were a lot of critical moments in Utlima IV that were based on the moonphase. Mondains skull, Shrine of spirituality, finding Nightshade/mandrake root, getting one of the stones (when all the moons were dark, near moonglow), etc.

I am really excited to implement these features since our shard is basically an extended-plot Ultima IV with the UO engine.

Kudos to the dev crew!
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

stranf wrote:--How hard would it be to remove the current moongate (OSI) system and replace it with an Ultima IV style system? Have the moongate pop up in it's supposed location and teleport you to the new location based on moon phase?
To remove the one already there, easy peasy. Remove the teleport locations from teleport.scp, and make sure you don't have any moongates using the default moongate-script in your world.

To recreate the Ultima IV style system - slightly more complex, but not much. I guess you could have permanent gates that teleport the user to a different location based on moon phase (which you check when the user collides/uses the moongate). If you want the moongates only to pop up at various moonphases, I guess that would require a new JS event or something... onMoonphase? =P
-= Ho Eyo He Hum =-
Post Reply