I s&^*^ck at coding for Oolite

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

Moderators: winston, another_commander

Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Re: I s&^*^ck at coding for Oolite

Post by Zireael »

The answer to Zireael's question is that it takes time, dedication and study to learn Oolite's Javascript interface, just as it takes time and study to learn how to mod Egosoft's X games, for example. I would be willing to bet that Zireael did not just start coding in Lua one day, there was some learning and reading to do there, too. And the good news is that the interface for Oolite happens to be really well documented in the Wiki, so it's all there, ready for anyone willing to use it, which is more than I can say for other game mod interfaces, for which learning relies mostly on trial and error.
:lol: :lol: :lol:

It took me half a year to learn Lua enough to be somewhat comfortable with it.
I was always more of a history/languages kind of person.
Mad Hollander
Dangerous
Dangerous
Posts: 84
Joined: Wed Nov 14, 2012 11:57 am

Re: I s&^*^ck at coding for Oolite

Post by Mad Hollander »

another_commander wrote:
- Almost everything in Oolite is not hardcoded, with the (deliberate) exceptions of laser characteristics and 7LY fuel limit. If there are others, please remind me because although I admittedly have not looked at the game code for a while now, I cannot seem to think of any more.
I would add to these exceptions energy, equipment, graphics and etc.

I.e. tell me how render Spectrum-like lasers ? What about creating my own indicator ? I.e. I need to show show hull penetrations on the hud ? Look at the code - all 'widgets' are hardcoded: drawCompas, drawAegis and etc.
What about new equipment ? Oolite hardcoded all equipment logic. I.e. shield boosters or energy units.

Ok, very simple - how to create oxp that allows to bind any action to the joystick ? How to bind oxp-events to the joystick ?

Galaxies i.e. 6 and 7 have regions that are unreachable from the rest of the map. How to create some station, that allows to visit these regions ?
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Re: I s&^*^ck at coding for Oolite

Post by Zireael »

I tend to concur with Max, more things are hardcoded than we think.

And on topic, engine trails are progressing, but I can't figure out how to apply them to other ships... heelp?
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: I s&^*^ck at coding for Oolite

Post by Norby »

Zireael wrote:
how to apply them to other ships... heelp?
Look into OXPs which manipulate NPC ships, in worldscripts check lines after this.shipSpawned = function(ship) and use ship.script.$youroxp_variable to store anything into the new ship.
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Re: I s&^*^ck at coding for Oolite

Post by Zireael »

Norby wrote:
Zireael wrote:
how to apply them to other ships... heelp?
Look into OXPs which manipulate NPC ships, in worldscripts check lines after this.shipSpawned = function(ship) and use ship.script.$youroxp_variable to store anything into the new ship.
There are a lot of examples of spawning new ships, creating completely new ships etc but I can't find any examples of OXPs manipulating NPC ships... Any names?
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: I s&^*^ck at coding for Oolite

Post by Norby »

Zireael wrote:
OXPs manipulating NPC ships... Any names?
[wiki]Detectors[/wiki] (basic), [wiki]ShipVersion[/wiki] (medium), [wiki]HardShips[/wiki] (advanced).
Post Reply