Changing the clock using an OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Changing the clock using an OXP

Post by Uncle Reno »

Title says it all really. I want the clock to be advanced on by a couple of days when certain conditions are met but can't seem to find a way to do that, is it possible? I've found mention of ship_clock_adjust but can't get this to do anything for me.
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Commander McLane posted this script for a timer under the Black Monks thread:-

Code: Select all

 { 
               conditions = (  
                  "status_string equal STATUS_EXITING_WITCHSPACE", 
                  "mission_monks equal RUNNING" 
               ); 
               do = ( 
                  "set: mission_monks_checkdate [clock_days_number]", 
                  "subtract: mission_monks_checkdate [mission_monks_startdate]", 
                  { 
                     conditions = ( "mission_monks_checkdate greaterthan 6" ); 
                     do = ( 
                        "decrement: mission_monks_timer", 
                        "add: mission_monks_startdate 7", 
                        "add: mission_monks_loan 625" ); 
                        }, 
                     ); 
                  }
Havent tested it but I guess a:-

Code: Select all


increment: [clock_days_number] 2

or mabey an

add: [clock_days_number] 2

Would advance the clock by two days.

Not sure whether the variable needs to by in [ ] though.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

I am not sure whether this works, too. Usually the system variables have special methods to set them, like "setLegalStatus: X", which cannot be replaced by "set: legalStatus_number X". The engine doesn't understand the latter syntax, which is however the normal syntax for setting mission_foo and local_foo variables. So I guess it wouldn't work for clock_days_number as well.

But this is only a guess. I would be interested in your testing results, Uncle Reno.

BTW: Do you remember where you have found the mentioning of ship_clock_adjust? I haven't come across that yet.
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

Thanks for the replies LittleBear and Commander McLane.

I found the reference on this board in this post.

As Cmdr McLane suggested, the methods you put forward don't work LB;

Code: Select all

add: [clock_days_number] 2
gives the following info

Code: Select all

Oolite [script.debug.replaceVariablesInString]: EXPANSION: "clock_days_number" becomes "2084007"
Oolite [script.debug.note.scriptAction]: scriptAction after expansion: "add: 2084007 2"
Oolite [unclassified]: ***** CANNOT ADD: '2084007 2'
Oolite [unclassified]: ***** IDENTIFIER '2084007' DOES NOT BEGIN WITH 'mission_' or 'local_'
and

Code: Select all

increment: [clock_days_number] 2
returns

Code: Select all

Oolite [script.debug.note.scriptAction]: scriptAction: "increment: [clock_days_number] 2 "
Oolite [script.debug.replaceVariablesInString]: EXPANSION: "clock_days_number" becomes "2084007"
Oolite [script.debug.note.scriptAction]: scriptAction after expansion: "increment: 2084007 2"
which Oolite doesn't specifically object to but also doesn't do anything with.
Equally

Code: Select all

increment: [clock_days_number]
becomes

Code: Select all

Oolite [script.debug.note.scriptAction]: scriptAction: "increment: [clock_days_number]"
Oolite [script.debug.replaceVariablesInString]: EXPANSION: "clock_days_number" becomes "2084007"
Oolite [script.debug.note.scriptAction]: scriptAction after expansion: "increment: 2084007"
and again does nothing, all as correctly predicted by Cmdr McLane.

At the moment, I am assuming that it's not possible. :cry:
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Feared it might be so. Lots of Real World stuff going on ATM so no chance to test!
Last edited by LittleBear on Tue Mar 27, 2007 9:11 pm, edited 1 time in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

LittleBear wrote:
Feared it might be so. Lots of Real World suff going on ATM so no chance to test!
No problem, thanks for your suggestions. :)
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Well I put all my clocks forward at the weekend, without any problems. :wink:
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Thanks for the testing, Uncle Reno, and sorry that it didn't work out. Also thanks for the link, that suggests, that ship_clock_adjust is not a scripting method, but an engine command, coming from the decompiled code of the game itself, as far as I understand.

However I've posted a request for an adjustClock:-method in Ahrumans scripting requests-sticky, among a lot of other requests as well.
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

Commander McLane wrote:
Thanks for the testing, Uncle Reno, and sorry that it didn't work out. Also thanks for the link, that suggests, that ship_clock_adjust is not a scripting method, but an engine command, coming from the decompiled code of the game itself, as far as I understand.
No problem. I had a suspicion that it wouldn't work myself but given that I have been scripting (verrrrry sloooowly) for only 2 weeks I thought I'd see if anybody else had experience of this.
Commander McLane also wrote:
However I've posted a request for an adjustClock:-method in Ahrumans scripting requests-sticky, among a lot of other requests as well.
Excellent, thanks.
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

TGHC wrote:
Well I put all my clocks forward at the weekend, without any problems. :wink:
:lol:
I can't possibly describe how helpful you have been there, TGHC! :wink:
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Commander McLane wrote:
However I've posted a request for an adjustClock:-method in Ahrumans scripting requests-sticky, among a lot of other requests as well.
…carefully ignoring the bit about not expressing your request in terms of specific method names for use with the old scripting model. :-)
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

:D Always willing to help old chum :wink:

Seriously though your idea of clock adjusting could be a whole new facet of gamepaly, with timewarps and back to the future stuff, who knows if we ever get to land on planets we could be in Jurassic Park! or even find out when England finally win a footie match. (Well they're playing Andorra tonight apparently one of the weakest teams in the world, so they might scrape a draw or even score a goal!)
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Ahruman wrote:
Commander McLane wrote:
However I've posted a request for an adjustClock:-method in Ahrumans scripting requests-sticky, among a lot of other requests as well.
…carefully ignoring the bit about not expressing your request in terms of specific method names for use with the old scripting model. :-)
Oops, I didn't get that bit. Perhaps I didn't understand your opening post of that thread. I was honestly thinking you were asking for requests apart from the Java Script-thing as well.

So when I posted method-names together with an explanation what this method should do I felt completely in-line with this:
Ahruman wrote:
Please post specific requests for scripting functionality here, so we’ve got them in one place. Post a description of the desired method name, since a) a name that seems clear to you might not to me, and b) future scripting enhancements will primarily be for JavaScript.
Sorry if I'm not. :?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Does it say that? Damn. *fixes*
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

OK, moving on (slightly) from changing the clock, I have noticed now that buying/selling goods takes exactly no time at all! Yes, you could load up your ship with a full 127 tonnes of Wine (for example) and it is immediately teleported on! :wink:
My vote would be for this to be changed at some point, after all, it takes 10 minutes for your ship to launch, whether you buy any goods or not.
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
Post Reply