Page 1 of 2

Viewing a ship/texture in Oolite Summary

Posted: Sat Nov 14, 2009 1:46 am
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

Re: Viewing a ship/texture in Oolite Summary

Posted: Sat Nov 14, 2009 11:47 am
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.

Re: Viewing a ship/texture in Oolite Summary

Posted: Sat Nov 14, 2009 1:37 pm
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.

Re: Viewing a ship/texture in Oolite Summary

Posted: Sat Nov 14, 2009 10:14 pm
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.

Re: Viewing a ship/texture in Oolite Summary

Posted: Sat Nov 14, 2009 10:44 pm
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.

Posted: Sat Nov 14, 2009 11:11 pm
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.

Posted: Sun Nov 15, 2009 12:08 am
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.

Posted: Sun Nov 15, 2009 6:47 am
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.

Posted: Sun Nov 15, 2009 8:59 am
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 ;).

Posted: Sun Nov 15, 2009 9:05 am
by CheeseRedux
Zieman wrote:
And by blunt I mean "brick to face"-blunt ;).
Wait; that's not the only kind? :?: :wink:

Posted: Sun Nov 15, 2009 10:03 am
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.

Posted: Sun Nov 15, 2009 2:57 pm
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! :)

Posted: Sun Nov 15, 2009 9:45 pm
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.

Posted: Sun Nov 15, 2009 10:04 pm
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.

Posted: Sun Nov 15, 2009 10:22 pm
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.