JavaScript console: make ship available for purchase?

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

Moderators: winston, another_commander

Post Reply
User avatar
Captain Berf
Competent
Competent
Posts: 55
Joined: Mon Nov 09, 2009 1:19 am
Location: USA, 1.5 Miles Up

JavaScript console: make ship available for purchase?

Post by Captain Berf »

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,
__________
______
Captain Berf
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

For credits:

Code: Select all

player.credits = n
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:

Code: Select all

:spawn shipRole
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:

Code: Select all

player.ship.target.setAI("dumbAI.plist")
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.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: JavaScript console: make ship available for purchase?

Post by Kaks »

Captain Berf wrote:
Is there an Oolite JavaScript cheatsheet?
Possibly not what you're after but:
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)
User avatar
Captain Berf
Competent
Competent
Posts: 55
Joined: Mon Nov 09, 2009 1:19 am
Location: USA, 1.5 Miles Up

Post by Captain Berf »

Thanks.

I thought that using the external view of the player ship would stop the chasing, but parking the spawn is much easier.

[I've been making procedure lists of what I have learned re: skinning, but there is no option to create an account on the alioth wiki.]
__________
______
Captain Berf
User avatar
Captain Berf
Competent
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?

Post by Captain Berf »

Kaks wrote:
Captain Berf wrote:
Is there an Oolite JavaScript cheatsheet?
Possibly not what you're after but:
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?
Oops simul-post.

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
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

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]
Post Reply