Re: Scripters cove
Posted: Sat Apr 28, 2012 9:28 am
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.
For information and discussion about Oolite.
https://bb.oolite.space/
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.
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...
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.
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.
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.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.
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);
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?
this.fee = Number(player.ship.passengers[0].fee)
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.
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.