Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

My ambitious oolite project

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

Moderators: winston, another_commander

treetrunker
Poor
Poor
Posts: 7
Joined: Mon Apr 02, 2007 10:47 pm
Location: Home

My ambitious oolite project

Post by treetrunker »

Hi everyone, I'm new here to the forums, but have been playing Oolite for several months now. I have two questions.

1. Is it really true that you have to be on a mac to make your ships into a .dat file?

2. Is it possible to add/remove planets, solar systems, galaxies, or ships?

I also would like to create an entire new universe, with an overall storyline, using the basic oolite engine. I'm fairly inexperienced with modding at this point, so I will be using this thread to ask for help and to inform you all on my progress. If you might be interested in helping me with this project, please let me know.

Thank you,
Treetrunker
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2868
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

1. Don't think so.

2. Oh yes. (at least you can add them, not sure you can take them away)

If you build it he will come!

Welcome to the boards!

You can mod Oolite in pretty much anyway. Check the Wiki and the OXPs already out. If you wanna write a mission pack, best way to learn is to play a few OXP missions. You can see how they work and crib the code to do the things you want to do with Oolite.

OXPers are generally flatered if you pick up their ideas and use their code in an new OXP. Feel free to c&p any of my stuff if it works for you. I made my mission OXPs by looking at the code of Selezen, Murgh, Wombat, Giles et al and thinking "Ah so thats how they did that. I'll have that code" C&p and change." :wink:

If you download Assassins.oxp and look at the readme past the Big Spoiler Warning, there's a step by step guide to everything the OXP does in code. Might be helpful if you're writing a big mission pack. Look forward to playing it! :)
Last edited by LittleBear on Mon Apr 02, 2007 11:41 pm, edited 2 times in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
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 »

1. No.
2. Yes, no, no, and yes.

I was going to refer you to the wiki on #1, but it’s wrong. There are converter scripts written in Python; it should be possible to get these running under Windows. Unfortunately there doesn’t seem to be a sensible place to download them, so here’s a somewhat unsensible way to get the one that matters: Obj2DatTex.py.

The JavaScript support being phased in over the next few versions will make it much large-scale modding much easier, so I’d reccomend starting at the other end (i.e. ships) for now. Adding/removing/moving galaxies and solar systems isn’t possible at the moment, but if you really need it – and show some progress – it may become possible in future.
treetrunker
Poor
Poor
Posts: 7
Joined: Mon Apr 02, 2007 10:47 pm
Location: Home

Post by treetrunker »

Yeah, I looked at the wiki, and thats why I asked the question. Another question. What is Python, and how do I get that script to work. Also, is removing ships an option, I wasn't clear on your answer to that. I would like to be able to create a whole new set of ships for my mod. Thanks for the help so far though.

Progress so far:
I have created the basic storyline, and have begun working on some basic naval ships. I have also created a map of what I want the Galaxies/Solar Systems to look like.


Yet again I am clueless: Is there a spoiler block function within these forums?
User avatar
Captain Hesperus
Grand High Clock-Tower Poobah
Grand High Clock-Tower Poobah
Posts: 2310
Joined: Tue Sep 19, 2006 1:10 pm
Location: Anywhere I can sell Trumbles.....

Post by Captain Hesperus »

When you say 'ships' do you mean the basic set of ships or ships that are OXPs?
treetrunker wrote:
Yet again I am clueless: Is there a spoiler block function within these forums?
You can try rot13 or change the colour of the text (suitably forewarned with SPOILER!!! or something) to match the background, like this.

P.S. Welcome to the boards and happy coding!:D

Captain Hesperus
treetrunker
Poor
Poor
Posts: 7
Joined: Mon Apr 02, 2007 10:47 pm
Location: Home

Post by treetrunker »

I mean the basic set of ships.
User avatar
Wolfwood
---- E L I T E ----
---- E L I T E ----
Posts: 735
Joined: Wed Mar 29, 2006 9:53 am
Location: Finland
Contact:

Post by Wolfwood »

treetrunker wrote:
I mean the basic set of ships.
A whole new set of ships would indeed mean removing all the old ones. I don't know if there's another way, but one way to remove them is to replace them (using the same names in the code) by new ships.
Author of Tales from the Frontier - official Elite 4 anthology.
Author of Marcan Rayger adventures - unofficial fan-fic novellas set in the Frontier universe.
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 »

Wolfwood’s way is the only one I can think of. Replacing them with ships that never appear would be entirely possible - although you’d have to consider what would happen when the player opens a saved game with a standard ship.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Ahruman wrote:
Wolfwood’s way is the only one I can think of. Replacing them with ships that never appear would be entirely possible - although you’d have to consider what would happen when the player opens a saved game with a standard ship.
You'd be in Witchbase, with no way out but Alt-F4.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Selezen
---- E L I T E ----
---- E L I T E ----
Posts: 2527
Joined: Tue Mar 29, 2005 9:14 am
Location: Tionisla
Contact:

Post by Selezen »

How to create OXPs / DATs:

Download the Python scripting language from www.python.org.

Get that script thing that Ahruman mentioned or download it from the main oolite page.

Get a copy of Wings3d from www.wings3d.com nd learn how to use it.

When you've created your ship, export it as a Wavefront OBJ file.

Copy the OBJ and MTL files into the Python24 folder on your hard drive.

Open a command window. Go to the Python24 folder and type obj2dattex.py shipname.obj.

Tadaaaa! A nice DAT file.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2868
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

If your doing a big mod, it might be best to confine it to a single galaxy to avoid a clash with other OXPs. Nobody has written any missions set in Galaxies 6 or 8 yet.

Adding planets / moons to a system is pretty easy. In planetinfo.plist have a series of commands like this:-

Code: Select all

"rebel_moon" = {
        position = "-40000 0 463000";
        radius = 1500;
        orientation = "1.0 0.0 0.0 0.0";
        texture = "hitsplanet10.PNG";
        seed = "1 2 3 4 5 6";
        "polar_color_factor" = 2.5;
        "rotational_velocity" = 0.13;
    };

"6 13" = { 
        "ambient_level" = "3.0";
 "sky_blur_alpha" = "0.85";
        "sky_blur_cluster_chance" = "0.55";
        "sky_blur_scale" = "25";
        
	"script_actions" = (
                 debugOn, "addMoon: rebel_moon",
	"addMoon: gas_giant",
 "addMoon: gas_giantA",
 "addMoon: gas_giantB",
		         debugOff
			);
The first command defines the moon, the second command adds the moon (and other planets) at this particular system. First number is the Galaxy (1 is 0, so Galaxy 7 is 6), next is the planet number. This command adds a moon and two gas giants only at this system.

All the properties of the System can be changed with commands like this:-

Code: Select all


"setSpecificPlanetInfo: 6=13=description=Eszausve is famous for its rocky moon and the twin gas giants Hades and Lernean, but cursed by one of the most oppressive governments in the Galaxy. Although the People's Popular Front bravely resists the oppressive regime of Governor Tarkin, thus far they have made little progress in restoring freedom to the planet.",

"setSpecificPlanetInfo: 6=13=productivity=98764",
"setSpecificPlanetInfo: 6=13=techlevel=14",
"setSpecificPlanetInfo: 6=13=inhabitants=Oppressed harmless fat birds",
"setSpecificPlanetInfo: 6=13=station=abcstat",

To add ships to the system, use commands like this:-

Code: Select all

{
	conditions = ( 
 						"galaxy_number equal 6",
						"planet_number equal 13",
						"mission_assassins_war equal 0", 
						"status_string equal STATUS_EXITING_WITCHSPACE" 
					); 
	do = ( "checkForShips: ecop", 
	{ conditions = ( "shipsFound_number lessthan 14" ); 
	do = ( "addSystemShips: ecop 6 0.0"); 
						}, 
					); 
				},
A series of commands like this adds the special cops to the system (but only whilst the war variable is a zero). Once the OXPs plot developes then other things start happening here. :wink:

Adding a load of ecops doesn't remove the Vipers as such, but so many ecops are added that very few vipers will be encountered and so it feels to the player that the cops in this system are different.

You define your ships in shipdata.plist and add them by role in script.
Last edited by LittleBear on Tue Apr 03, 2007 9:27 am, edited 1 time in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
ramon
---- E L I T E ----
---- E L I T E ----
Posts: 346
Joined: Thu Jun 01, 2006 2:38 pm
Location: Tavistock
Contact:

Post by ramon »

Selezen wrote:
Open a command window. Go to the Python24 folder and type obj2dattex.py shipname.obj.
isn't it obj2dattex.py shipname.obj shipname.dat
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 »

LittleBear wrote:

Code: Select all

{
    conditions = ( 
        "galaxy_number equal 6",
        "planet_number equal 13",
        "mission_assassins_war equal 0", 
        "status_string equal STATUS_EXITING_WITCHSPACE" 
    ); 
    do = ( "checkForShips: ecop", 
        { conditions = ( "shipsFound_number lessthan 14" ); 
            do = ( "addSystemShips: ecop 6 0.0"); 
        }, 
    ); 
},
Or, in JavaScript:

Code: Select all

this.willExitWitchSpace = function()
{
    if (galaxyNumber == 6 && planetNumber == 13)
    {
        if (missionVariables["assassins_war"] == 0 && system.countShipsWithRole("ecop") < 14)
        {
            system.legacy_addSystemShips("ecop", 6, 0.0);
        }
    }
}
I know I’m pushing this hard, but, to be clear: from the test release of Oolite 1.68 (later today), the old scripting mechanism is deprecated, and learning it for new development is discouraged. It is still necessary if you’re targeting the current release version (1.65), but for a new large-scale mod, use JavaScript. I intend to have a full release (probably 1.70) with a fleshed-out JavaScript scripting model out by the end of May.

JavaScript is currently only available for “world scripts”, equivalent to script.plist in the old model. Addressing this is a major goal for 1.69.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2868
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Will the old script still work?

Anything new I write I'll write in Java, but given the size of the script I really coudn't face having to redo it in java as it has 800+ commands!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
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 »

LittleBear wrote:
Will the old script still work?
Yes. If at some point there’s an Oolite 2.0 with architectural changes that make such support difficult, it might break there. (On the other hand, it may be possible to automatically translate the old scripts to JS. Or not.)
LittleBear wrote:
Anything new I write I'll write in Java, but given the size of the script I really coudn't face having to redo it in java as it has 800+ commands!
JavaScript is not Java. Otherwise, fair enough.
Post Reply