Scripters cove
Moderators: winston, another_commander
Re: Scripters cove
Hmm, ok. But there's still the question of both the background transparency and more importantly having the ship control keys still accessible with the mission screen visible.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Scripters cove
Fair enough point for Gimbal's use....however inflight Mission Screens could be used for all sorts of other useful Shenanigans.Thargoid wrote:Hmm, ok. But there's still the question of both the background transparency and more importantly having the ship control keys still accessible with the mission screen visible.
Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Re: Scripters cove
mission.runScreen works pretty well inflight. The only limit is that you can't display a model there. But using missionscreens inflight is simply a bad design decision for OXPs as it takes away control from the player. OXPs can use other ways if they really need to display additional infos or to give the player options.
Re: Scripters cove
Is it possible to change player-ship's cargo capacity on-the-fly?
I have a ship in the pipeline, that has 2 subentities that can be shot off - it would be cool if losing the subents would reduce cargo space and repairing them would give the space back.
I think I could get away with one such subent with a bit of scripting & invisible Lagre Garco Bay, but not with two...
I have a ship in the pipeline, that has 2 subentities that can be shot off - it would be cool if losing the subents would reduce cargo space and repairing them would give the space back.
I think I could get away with one such subent with a bit of scripting & invisible Lagre Garco Bay, but not with two...
...and keep it under lightspeed!
Friendliest Meteor Police that side of Riedquat
Far Arm ships
Z-ships
Baakili Far Trader
Tin of SPAM
Friendliest Meteor Police that side of Riedquat
Far Arm ships
Z-ships
Baakili Far Trader
Tin of SPAM
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Scripters cove
Have a look at Thargoid's HyperCargo and Vortex oxps for some ideas on 'virtual' cargo bays. Then beware that you'll need to make them compatible with cim's new Cargoes, and I'll have to update Illegal Goods Tweak. But don't let that put you off it sounds like a fun idea.Zieman wrote:Is it possible to change player-ship's cargo capacity on-the-fly?
I have a ship in the pipeline, that has 2 subentities that can be shot off - it would be cool if losing the subents would reduce cargo space and repairing them would give the space back.
I think I could get away with one such subent with a bit of scripting & invisible Lagre Garco Bay, but not with two...
Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Scripters cove
That would be the only reason I'd ever use them in flight - the player wouldn't be in control, they would be a kind of holding screen whilst a script does all sorts of weirdness that you don't really want the player to see the effects of.Svengali wrote:But using missionscreens inflight is simply a bad design decision for OXPs as it takes away control from the player.
Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
- Okti
- ---- E L I T E ----
- Posts: 700
- Joined: Sun Sep 26, 2010 1:51 pm
- Location: A GH shop, near witchpoint to Oresrati in Galaxy 8
Re: Scripters cove
One is used for LongRangeScanner as a cheat or debugging tool . I know it is not elegant but no other choice. Also as Thargoid said same aproach is used in Vortex. If you are in need to give inflight choices for the player there are two options: mission screens or custom messages via a special equipment. Choice is up to the scripters.Capt. Murphy wrote:That would be the only reason I'd ever use them in flight - the player wouldn't be in control, they would be a kind of holding screen whilst a script does all sorts of weirdness that you don't really want the player to see the effects of.Svengali wrote:But using missionscreens inflight is simply a bad design decision for OXPs as it takes away control from the player.
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Scripters cove
Can anyone tell me what I'm doing wrong in attempting to add a Passenger via script / debug console.
The eta is in the future, there is space for a passenger, but the addPassenger method is returning false?
Current trunk.
Edit to add - it appears to be a minor Oolite bug when you purchase a new ship or use the new player.replaceShip method. If the current ship has a passenger when you purchase or replace the ship examining the save files before and after shows that
The eta is in the future, there is space for a passenger, but the addPassenger method is returning false?
Current trunk.
Code: Select all
> player.ship.addPassenger("Ab Nuthsoen",129,2,180058873294,528)
false
> player.ship.passengers
[]
> player.ship.passengerCapacity
1
> player.ship.passengerCount
0
> player.ship.addPassenger("Ab Nuthsoen",129,2,180058873294,528)
false
> clock.seconds
180058229497.2031
> clock.seconds < 180058873294
true
<key>passenger_record</key>
isn't updated, although <key>passengers</key>
is. And attempting to add a passenger with the same name as one present in <key>passenger_record</key>
fails, even if <key>passengers</key>
is empty. Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Re: Scripters cove
Thanks - will fix.Capt. Murphy wrote:Edit to add - it appears to be a minor Oolite bug when you purchase a new ship or use the new player.replaceShip method. If the current ship has a passenger when you purchase or replace the ship examining the save files before and after shows that<key>passenger_record</key>
isn't updated, although<key>passengers</key>
is. And attempting to add a passenger with the same name as one present in<key>passenger_record</key>
fails, even if<key>passengers</key>
is empty.
EDIT: fixed in r4892. Since it could theoretically cause problems in 1.76 in very obscure circumstances, fixed in maintenance as well as trunk.
Re: Scripters cove
Can anyone explain why this isn't allowed in a JS script:
Can I not add passengers to a ship using stored variables?
Code: Select all
var name = missionVariables.mission_taxi_passenger;
var curloc = system.ID;
var dest = missionVariables.mission_taxi_dest;
var time = missionVariables.mission_taxi_time;
var pay = missionVariables.mission_taxi_pay;
player.ship.addPassenger(name, curloc, dest, clock.seconds+time*24*3600, pay);
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Re: Scripters cove
It should make absolutely no difference whether the function is called with stored variables or not.Pleb wrote:Can I not add passengers to a ship using stored variables?
Just to check the obvious things first:
1) The ship has at least one empty passenger cabin
2) The ship does not already have a passenger with the same name as missionVariables.mission_taxi_passenger
Assuming that's not it, feel free to PM me a link to the OXP and I'll have a look for more obscure things.
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Scripters cove
Possibly relevant or possibly not (depending on where you are getting your variables from) but the wiki entry http://wiki.alioth.net/index.php/Oolite ... passengers is wrong in the passengers[0].fee is not returned as an integer as stated but a string (albeit a number in a string). Same goes for http://wiki.alioth.net/index.php/Oolite ... #contracts
Not sure if this is a documentation error or a bug.
However both addPassenger and awardContract require fee to be a number.
Conversion is straight forward. e.g
Not sure if this is a documentation error or a bug.
However both addPassenger and awardContract require fee to be a number.
Conversion is straight forward. e.g
this.fee = Number(player.ship.passengers[0].fee)
Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Re: Scripters cove
The interface between Javascript and the Oolite engine is fairly flexible about this - provided the number is recognisably a number, it can be 528, 528.0, "528", or "528.0". If the problem is the JS type of a variable being provided to a function, I'll be surprised.Capt. Murphy wrote:However both addPassenger and awardContract require fee to be a number.
As for the Wiki entry, that looks more like a bug rather than a documentation error (since all the other numeric values are both documented as and returned as numeric types), and I'll fix that now.
EDIT: fixed in r4900. Just in case there's some OXP code that relies on the old type, I won't push this change to the maintenance branch yet.
Re: Scripters cove
For reasons unknown I've managed to get my code to work now. I still can't explain why it wasn't working, but I think it was to do with the time...however it is working now so never mind cheers anyways though.
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Scripters cove
Looking at the code, there are only two reasons when adding a contract fails:Pleb wrote:For reasons unknown I've managed to get my code to work now. I still can't explain why it wasn't working, but I think it was to do with the time...however it is working now so never mind cheers anyways though.
A: When there is no free passenger cabin.
B: When that passenger is already present.
I assume B can easily happen during testing. At least it should be added to the wiki that there can not be two passengers with the same name. (edit: done)
UPS-Courier & DeepSpacePirates & others at the box and some older versions