Changing the clock using an OXP
Moderators: winston, another_commander
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
Changing the clock using an OXP
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!
What I do when not reading the Oolite bulletin board!
- LittleBear
- ---- 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.
Commander McLane posted this script for a timer under the Black Monks thread:-
Havent tested it but I guess a:-
Would advance the clock by two days.
Not sure whether the variable needs to by in [ ] though.
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" );
},
);
}
Code: Select all
increment: [clock_days_number] 2
or mabey an
add: [clock_days_number] 2
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.
- Commander McLane
- ---- 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:
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.
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.
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
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; gives the following info
and
returns
which Oolite doesn't specifically object to but also doesn't do anything with.
Equally
becomes
and again does nothing, all as correctly predicted by Cmdr McLane.
At the moment, I am assuming that it's not possible.
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
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_'
Code: Select all
increment: [clock_days_number] 2
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"
Equally
Code: Select all
increment: [clock_days_number]
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"
At the moment, I am assuming that it's not possible.
"Get back or I unleash my lethal spotted batoid!!"
What I do when not reading the Oolite bulletin board!
What I do when not reading the Oolite bulletin board!
- LittleBear
- ---- 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.
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.
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
No problem, thanks for your suggestions.LittleBear wrote:Feared it might be so. Lots of Real World suff going on ATM so no chance to test!
"Get back or I unleash my lethal spotted batoid!!"
What I do when not reading the Oolite bulletin board!
What I do when not reading the Oolite bulletin board!
- Commander McLane
- ---- 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:
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.
However I've posted a request for an adjustClock:-method in Ahrumans scripting requests-sticky, among a lot of other requests as well.
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
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 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.
Excellent, thanks.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.
"Get back or I unleash my lethal spotted batoid!!"
What I do when not reading the Oolite bulletin board!
What I do when not reading the Oolite bulletin board!
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
TGHC wrote:Well I put all my clocks forward at the weekend, without any problems.
I can't possibly describe how helpful you have been there, TGHC!
"Get back or I unleash my lethal spotted batoid!!"
What I do when not reading the Oolite bulletin board!
What I do when not reading the Oolite bulletin board!
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
…carefully ignoring the bit about not expressing your request in terms of specific method names for use with the old scripting model. :-)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.
E-mail: [email protected]
Always willing to help old chum
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!)
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"
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
- Commander McLane
- ---- 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:
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.Ahruman wrote:…carefully ignoring the bit about not expressing your request in terms of specific method names for use with the old scripting model.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.
So when I posted method-names together with an explanation what this method should do I felt completely in-line with this:
Sorry if I'm not.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.
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
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!
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.
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!
What I do when not reading the Oolite bulletin board!