Viewing a ship/texture in Oolite Summary

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

Moderators: winston, another_commander

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

Viewing a ship/texture in Oolite Summary

Post by Captain Berf »

VIEWING YOUR SKIN and/or MODEL IN OOLITE

If the ship you want to view is your player ship simply launch the ship and press v to cycle through the external views. Otherwise ...

Install Debug.oxp

Installing Debug.oxp

1. Add Debug.oxp to your Oolite Addons http://wiki.alioth.net/index.php/Debug_OXP
2. Install PyDebugConsole https://developer.berlios.de/project/sh ... up_id=3577


Run Oolite with the DebugConsole

1. Run the DebugConsole
2. Start Oolite (holding down the shift key while it boots if an oxp has been changed (clears the cache))
3. Launch into space (moving into a clear area helps).

Spawning the ship you want to view

Type in the console

Code: Select all

:spawn role
where role is the parameter to be passed to the :spawn macro.
To find the correct argument for role refer to [i.e. open in a text editor]

Code: Select all

config\shipdata.plist 
Find the entry for the ship in question in the shipdata.plist. [we'll call it shipX]

Code: Select all

       <key>shipX</key>
       

Find the defined roles

Code: Select all

       <key>roles</key> 
       
Use one of the defined roles as the argument for :spawn [found between <string></string>]

Code: Select all

<key>shipX</key>
<dict>
...
<key>roles</key>
<string>shipX-trader shipX-escort shipX-hunter</string>
...
</dict>
yields

Code: Select all

:spawn shipX-trader
in the console.

If all the defined roles are generic* modify the shipdata.plist from:

Code: Select all

<key>shipX</key>
<dict>
...
<key>roles</key>
<string>trader escort hunter</string>
...
</dict>
to

Code: Select all

<key>shipX</key>
<dict>
...
<key>roles</key>
<string>shipX-trader trader escort hunter</string>
...
</dict>
[Make sure to use a text editor suitable for programming. One that doesn't change the encoding or add junk to the file.]

To park the spawned ship target it then enter in the console:

Code: Select all

player.ship.target.setAI("dumbAI.plist")
To manipulate sub entities (if the ship has any) use the command:

Code: Select all

player.ship.target.subEntities[0].position = [x, y, z]
[* If the defined roles are only generic e.g trader|pirate|hunter|etc then a random ship fulfilling the role will be spawned. Not necessarily the one you wanted.]



EDIT: changed everything
Last edited by Captain Berf on Mon Nov 16, 2009 12:40 am, edited 5 times in total.
__________
______
Captain Berf
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Viewing a ship/texture in Oolite Summary

Post by another_commander »

Just a couple of comments:
Captain Berf wrote:
Dependencies:
2. Install Python if not already installed. [Python.org]
(NOTE: Python 2.6 is required for PyWin32 & Twisted as of this writing)
3. Install PyWin32 [Python.org]
4. Install Twisted [http://twistedmatrix.com/trac/]
5. Install the OoliteDebugConsole [http://wiki.alioth.net/index.php/Debug_OXP]
All this can be substituted by:
1. Download the debug console executable (PyDebugConsole 1.0) from the listed files in the Berlios repository.
4. Type in the console

Code: Select all

:spawn shipname
It may be necessary to assign a role for the ship to appear:

Code: Select all

:spawn shipname-trader|pirate|escort|etc 
(where shipname is the name of the ship as found in its shipdata.plist and is case sensitive)
The :spawn macro takes the role of the ship as parameter, not its name.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Viewing a ship/texture in Oolite Summary

Post by JensAyton »

Captain Berf wrote:
2. Start Oolite holding down the shift key while it boots (only necessary on the first start if a new oxp has been installed)
Holding down shift is never necessary when you add an OXP. It is, however, necessary if you’ve only changed the contents of an OXP.
User avatar
Captain Berf
Competent
Competent
Posts: 55
Joined: Mon Nov 09, 2009 1:19 am
Location: USA, 1.5 Miles Up

Re: Viewing a ship/texture in Oolite Summary

Post by Captain Berf »

another_commander wrote:
Just a couple of comments:
Captain Berf wrote:
Dependencies:
2. Install Python if not already installed. [Python.org]
(NOTE: Python 2.6 is required for PyWin32 & Twisted as of this writing)
3. Install PyWin32 [Python.org]
4. Install Twisted [http://twistedmatrix.com/trac/]
5. Install the OoliteDebugConsole [http://wiki.alioth.net/index.php/Debug_OXP]
All this can be substituted by:
1. Download the debug console executable (PyDebugConsole 1.0) from the listed files in the Berlios repository.
It is not required to install Python, Twisted, Pywin32, or Debug.oxp to run PyDebugConsole?
Or you want step 5 to point directly to BerliOs instead of indirectly through the oxp?
4. Type in the console

Code: Select all

:spawn shipname
It may be necessary to assign a role for the ship to appear:

Code: Select all

:spawn shipname-trader|pirate|escort|etc 
(where shipname is the name of the ship as found in its shipdata.plist and is case sensitive)
The :spawn macro takes the role of the ship as parameter, not its name.
I was reiterating the information I found. The :spawn takes a shipname e.g.

Code: Select all

:spawn dredgertrader
The shipname is case sensitive and must match the entry in the plist. Right?
The -role was was from one of the pages I read and copied without testing -- I have not had to use it to spawn a ship. Is that what is incorrect?

Thanks.
__________
______
Captain Berf
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Viewing a ship/texture in Oolite Summary

Post by another_commander »

Captain Berf wrote:
It is not required to install Python, Twisted, Pywin32, or Debug.oxp to run PyDebugConsole?
Or you want step 5 to point directly to BerliOs instead of indirectly through the oxp?
Only Debug.oxp and PyDebugConsole 1.0 are required to have a debug console running. You can alternatively do it the hard way (install Python, Twisted, PyWin32 etc.), but there is no reason for that, unless you want to try it as an exercise.
I was reiterating the information I found. The :spawn takes a shipname e.g.

Code: Select all

:spawn dredgertrader
The shipname is case sensitive and must match the entry in the plist. Right?
The -role was was from one of the pages I read and copied without testing -- I have not had to use it to spawn a ship. Is that what is incorrect?
The "dredgertrader" that you are using for :spawn is the role of the ship, not its name. Try spawning an Adder using the name "adder" from the shipdata and you will notice that nothing gets spawned and this is printed in the log:

Code: Select all

***** SCRIPT ERROR :in <anonymous actions>, addShipsWithinRadius: could not add 1 ships with role "adder"
As you see, it is clear from the error message that a role is expected and not a name.
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 »

My apologies. I got that infomation from the wiki.
Note: At the time of writing, a cross-platform, python based, external console application is available in the Berlios Oolite files area. It requires the twisted library, and the pywin32 library if run under windows.
http://wiki.alioth.net/index.php/Debug_OXP

It never occurred to me to install a python script without python.

I will give up my attempts at a how-to.
__________
______
Captain Berf
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

Post by Kaks »

At the time of writing that page of the wiki, I hadn't yet compiled the python console into a windows executable.
All normal python programs are interpreted, they need at least the python interpreter in order to run, and normally have a .py extension. (this is very much the case for the obj to dat converters)

The downloadable file from Berlios contains a precompiled python .exe that doesn't need all that, so in windows you don't need to install any python or portions thereof. All this should already be explained inside the accompanying readme - it's located next to the .exe, inside that .zip file.

If you wanted to run the source .py files directly (again, included in that .zip file), sure, you'd need all of the python language stuff installed first.


In any case, you need to install debug.oxp, for Oolite to communicate with the js console.


On the other source of confusion, roles and ship names are very different things in oolite. Any given ship can only have one ship name, but could in theory have hundreds of different ship roles. The same role could be assumed by many different ships. All the ship creating code uses ship roles, not names. To spawn a specific ship inside oolite, usually an OXP maker creates a uniquely named role for it.

If you were to spawn a trader, any ship that has got 'trader' in its list of roles has a chance to be created by Oolite. You can also define the likelyood of a ship appearing using a specific role.


Hope this clarifies matters a little bit.
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 »

Kaks wrote:
At the time of writing that page of the wiki, I hadn't yet compiled the python console into a windows executable.
All normal python programs are interpreted, they need at least the python interpreter in order to run, and normally have a .py extension. (this is very much the case for the obj to dat converters)

The downloadable file from Berlios contains a precompiled python .exe that doesn't need all that, so in windows you don't need to install any python or portions thereof. All this should already be explained inside the accompanying readme - it's located next to the .exe, inside that .zip file.

If you wanted to run the source .py files directly (again, included in that .zip file), sure, you'd need all of the python language stuff installed first.
I know the difference between an .exe and a .py (generally when things are compiled reference to the language is dropped in the name). Unfortunately in the Windows world many archives are packaged as a self extracting .exe. Since I had no reason to think otherwise and going by the wiki I just assumed it installed a script. I was focused on the end result.
In any case, you need to install debug.oxp, for Oolite to communicate with the js console.
That is the very first step in the first post.
On the other source of confusion, roles and ship names are very different things in oolite. Any given ship can only have one ship name, but could in theory have hundreds of different ship roles. The same role could be assumed by many different ships. All the ship creating code uses ship roles, not names. To spawn a specific ship inside oolite, usually an OXP maker creates a uniquely named role for it.

If you were to spawn a trader, any ship that has got 'trader' in its list of roles has a chance to be created by Oolite. You can also define the likelyood of a ship appearing using a specific role.


Hope this clarifies matters a little bit.
Yes, I got this wrong.

As I stated before, I approached this from the perspective of someone familiar with 2d gfx. It was difficult to find the basic information. I was simply trying to summarize the info I could find in case it helped anyone else. When someone is close to a project they do not realize what is not obvious or well documented. The correct response would have been akin to proofreading not dismissiveness. I was trying to better the documentation not antagonize you or anyone else.
__________
______
Captain Berf
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Post by Zieman »

Funny how differently people interpret same text...

I found no dismissiveness in any replies, to me they are just matter of fact statements, meant to clarify the issue without any emotional aspects.

Oh well, this might be culture-related, here (in Finland) we know only the blunt approach :). And by blunt I mean "brick to face"-blunt ;).
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
User avatar
CheeseRedux
---- E L I T E ----
---- E L I T E ----
Posts: 827
Joined: Fri Oct 02, 2009 6:50 pm

Post by CheeseRedux »

Zieman wrote:
And by blunt I mean "brick to face"-blunt ;).
Wait; that's not the only kind? :?: :wink:
"Actually this is a common misconception... I do *not* in fact have a lot of time on my hands at all! I just have a very very very very bad sense of priorities."
--Dean C Engelhardt
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

CheeseRedux wrote:
Zieman wrote:
And by blunt I mean "brick to face"-blunt ;).
Wait; that's not the only kind? :?: :wink:
There’s also poke-in-the-eye-with-a-blunt-stick blunt.
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

Post by Kaks »

Ahruman wrote:
There’s also poke-in-the-eye-with-a-blunt-stick blunt.
:lol:

And for the ambidextrous: brick-face-and-stick-eye blunt:

"So, you hadn't actually looked inside the js console download and you tried to explain how to use it to other people?"

But as a board we generally don't go for - or appreciate - that sort of thing! :twisted:


PS:
Zieman wrote:
to me they are just matter of fact statements, meant to clarify the issue without any emotional aspects.
that's exactly what I meant them as! :)
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 »

Is this correct re: role?

Refer to config\shipdata.plist
Find the entry for the ship in question
Find the KEY "role"
Use one of the defined roles as the argument for :spawn

(question: it seems to need a role with the shipname in the defined role, e.g :spawn shipX-player. If the defined role is generic it does not necessarily bring up the correct ship e.g. hunter is a defined role for shipX but :spawn hunter brings up vipers. I'd like to make this as easy to follow as possible -- target audience = GFX'ers not JS'ers)

Note: Being an .EXE doesn't preclude requiring external libraries. Why read the read the ReadMe when the install instructions you followed worked? :) (I had to install Python anyway for the Dat2Obj scripts.

Note: Removed the reference to console dependencies for Windows from the wiki.
Last edited by Captain Berf on Sun Nov 15, 2009 10:14 pm, edited 1 time in total.
__________
______
Captain Berf
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

Post by Kaks »

Is this correct re: role?
As far as we know.

Note: if you think the readme included with the js console needs to be clearer than it is already, we're open to suggestions! :)

Edit: I've just noticed you had removed the link to the js console download from the relevant wiki page, so I've put it back. I'm not quite sure why you would want to do that, but please don't do that again.
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 »

Sorry, my mistake. I thought I just removed the references to the dependencies, not the console itself.

The problem wasn't with the console readme but the wiki which said install x, y, & z before you install the console. I don't usually install things without their stated dependencies to see if they'll run anyway. And since it worked it never occurred to me that they weren't needed.

Is there a simple & clean way to word the caveat for choosing a role that will work in all or most cases (to bring up the required ship) e.g. only select a defined role with the shipname in it. Or is this wrong.
__________
______
Captain Berf
Post Reply