Is there a JavaScript command to make a ship available for purchase?
Also, to give player x number of credits:
credits : x
Is that correct? (I'm missing something, it does not work in the console)
[Seeing if there is a way to give the player a certain ship in order to preview texture. Is there an Oolite JavaScript cheatsheet?]
Is it no longer possible to create an account to edit the wiki?
Thanks,
JavaScript console: make ship available for purchase?
Moderators: winston, another_commander
- Captain Berf
- Competent
- Posts: 55
- Joined: Mon Nov 09, 2009 1:19 am
- Location: USA, 1.5 Miles Up
JavaScript console: make ship available for purchase?
__________
______
Captain Berf
______
Captain Berf
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
For credits:
where n is the number you want.
For putting up ships for sale I don't remember having anything, but if you just want to preview a ship's texture you can just do this:
Launch in space and type in the console:where shipRole is the role of the ship you want to spawn. You may have to add a distinctive role in the ship's roleset in order to be able to invoke it. Note the colon at the start of the line, it's needed.
If you want to make things even easier for studying your ship, instead of chasing it around trying to view it from a good angle, you can simply target it after it has been spawned and execute on the console:
This will stop it right where it is in space and start rotating it. You can approach from any angle you want and get as close as you like without it trying to get away from you.
Code: Select all
player.credits = n
For putting up ships for sale I don't remember having anything, but if you just want to preview a ship's texture you can just do this:
Launch in space and type in the console:
Code: Select all
:spawn shipRole
If you want to make things even easier for studying your ship, instead of chasing it around trying to view it from a good angle, you can simply target it after it has been spawned and execute on the console:
Code: Select all
player.ship.target.setAI("dumbAI.plist")
Re: JavaScript console: make ship available for purchase?
Possibly not what you're after but:Captain Berf wrote:Is there an Oolite JavaScript cheatsheet?
http://wiki.alioth.net/index.php/Catego ... _scripting
& automatic accounts are suspended due to too much spamming. I if you pm winston he should be able to add you in when he gets the time, though?
Last edited by Kaks on Wed Nov 11, 2009 7:12 pm, edited 2 times in total.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Captain Berf
- Competent
- Posts: 55
- Joined: Mon Nov 09, 2009 1:19 am
- Location: USA, 1.5 Miles Up
- Captain Berf
- Competent
- Posts: 55
- Joined: Mon Nov 09, 2009 1:19 am
- Location: USA, 1.5 Miles Up
Re: JavaScript console: make ship available for purchase?
Oops simul-post.Kaks wrote:Possibly not what you're after but:Captain Berf wrote:Is there an Oolite JavaScript cheatsheet?
http://wiki.alioth.net/index.php/Catego ... _scripting
& automatic accounts are suspended do to too much spamming. I if you pm winston he should be able to add you in when he gets the time, though?
I've been browsing that. I wondered if there was a 1 page summary. When your base-knowledge=0 and you don't know what you're looking for a clean summary can help.
Thanks
__________
______
Captain Berf
______
Captain Berf
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
And when you have ships with subentities and are not sure about the exact position it needs, you can even play with them by using:
Code: Select all
player.ship.target.subEntities[0].position = [x, y, z]
UPS-Courier & DeepSpacePirates & others at the box and some older versions