Difference between revisions of "How to tweak OXZ's"

From Elite Wiki
m (Emphasis)
(Updating BB links)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Tweaking OXZs ==
 
== Tweaking OXZs ==
OXZ's live in your '''ManagedAddOns''' folder.
+
<font color="Red">OXZ's</font> usually live in your '''ManagedAddOns''' folder (but still work if lurking in your '''AddOns''' folder!).
  
 
*To tweak an '''OXZ''', you expand it, rewrite part of the code (following the instructions), and then repackage it as an '''OXP'''.
 
*To tweak an '''OXZ''', you expand it, rewrite part of the code (following the instructions), and then repackage it as an '''OXP'''.
Line 14: Line 14:
 
:*Note also that the OXPs in your AddOns folder ''trump'' the OXZs in your Managed Expansions folder.
 
:*Note also that the OXPs in your AddOns folder ''trump'' the OXZs in your Managed Expansions folder.
 
*Note also that an OXZ is just a zipped OXP - there is essentially no difference between the two... [[User:Reval|Reval]] recommends adding a simple step to the tweaking process: create a folder in AddOns with an .oxp extension, and unzip the contents of the oxz to it (after renaming it .zip). Presto! - an OXP.
 
*Note also that an OXZ is just a zipped OXP - there is essentially no difference between the two... [[User:Reval|Reval]] recommends adding a simple step to the tweaking process: create a folder in AddOns with an .oxp extension, and unzip the contents of the oxz to it (after renaming it .zip). Presto! - an OXP.
*An OXZ, to be accepted, must also contain a manifest.plist, (it is basically a zipped version of the entire OXP with an added manifest.plist) whereas a pure OXP needs only a requires.plist. [[User:Reval|Reval]]'s belt'n'braces approach is to include both.  
+
*An OXZ, to be accepted, must also contain a manifest.plist, (it is basically a zipped version of the entire OXP with an added manifest.plist) whereas a pure OXP needs only a requires.plist. [[User:Reval|Reval]]'s belt'n'braces approach is to include both.
  
 
== Tweaking OXPs ==
 
== Tweaking OXPs ==
*These are easier - they do not need unzipping/rezipping. They live in your '''AddOns folder'''.
+
<font color="Red">OXP's</font> live in your '''AddOns folder'''.
*Just edit the file name to replace the .oxp ending with .txt - it will transmogrify into a folder. Do your deeds of derring do (see the rest of this page). To return your folder to being an .oxp, just edit the folder name and put .oxp at the end! Pop it into your '''AddOns''' folder, and restart the game with the shift button held down.
+
*These are much easier - they do not need unzipping/rezipping.  
 +
*On some systems the OXP just opens up as a regular folder.
 +
:On an AppleMac '''either''' select the OXP with the control key held down - and then choose the "Show Package Contents" option '''or''' edit the file name to replace the .oxp ending with .txt - it will transmogrify into a folder. Do your deeds of derring do (see the rest of this page). To return your folder to being an .oxp, just edit the folder name and put .oxp at the end! Pop it into your '''AddOns''' folder, and restart the game with the shift button held down.
  
 
== Warning! ==
 
== Warning! ==
Line 25: Line 27:
 
And if you are copying code from the BB, you might find you've included somebody else's invisible text!  
 
And if you are copying code from the BB, you might find you've included somebody else's invisible text!  
  
When copying code from the BB it's always better to hit the "quote" button and copy from the typing window. (Just don't press the "Submit" button after you're finished!) See the discussion [http://aegidian.org/bb/viewtopic.php?p=142502#p142502 here].
+
When copying code from the BB it's always better to hit the "quote" button and copy from the typing window. (Just don't press the "Submit" button after you're finished!) See the discussion [https://bb.oolite.space/viewtopic.php?p=142502#p142502 here].
 +
 
 +
== Discussion: Starting to tweak ==
 +
''Question: TheOldGamer » Fri Jun 03, 2016 4:30 pm''
 +
Hello all - I'm writing these questions with a certain amount of trepidation because usually - or at least in the past - I haven't had a problem getting myself going in the mod department. Most of my mods were centered around fairly simple config and similar files; such as in the Microsoft sim series, Orbiter and the like.
 +
 +
But I must admit that at the moment, I'm kind of stumped.
 +
 +
(sigh) I really, really hate to be the guy asking how one starts modding this game, but I've looked around this thread and the how-to's in the wiki and I can't seem to find an answer. I'm honestly not sure if I'm just missing something obvious, simply didn't read the one critical how-to or just lost a few billion brain cells the day the big 5-0 went whizzing by some time ago. :roll:
 +
 +
In particular, I was enormously pleased to read the [https://bb.oolite.space/viewtopic.php?p=237469#p237469 conversation between Mohawk and Spara], because it was a perfect answer to one of my questions: how to make the various planetary systems a little more realistic. Like Mohawk, I would appreciate a larger, less condensed system and as Spara pointed out, the extra stations make the increased size a worthwhile change. Between them, they laid out the modifications well, clearly and understandably.
 +
 +
I just haven't a flamin' clue which file I'm supposed to modify. (Yiiiii!!! How lame is that?!?)
 +
 +
I've been going through the 'config' folder all morning and either I'm totally dense (which is, of course, always the most likely answer), the 'find' feature (Ctl-F) just doesn't work like it did in Win XP (I'm new to W-10) or Ghu, the Great God of Code simply loves to torture me (another high-level probability) but I simply cannot find the file which describes the overall workings of the Ooniverse.
 +
 +
I must admit - it's a little sobering to want to start modding (which I've always found to be as much fun as playing the game itself) and discovering I can't even figure out the file structure.
 +
 +
I hate to have to ask this, but I need a little nudge in the right direction. Once I get one or two simple tweaks under my belt, I'll get the idea of how this thing works and I'll be able to tinker with confidence. I doubt I'll be able to contribute much soon, but I've a few ideas and once I get the general idea I might be able to offer something in return. :)
 +
 +
Cheers!
 +
 
 +
''Response: another_commander » Fri Jun 03, 2016 8:42 pm''
 +
Before anything else, you need to have an objective regarding modding. This is true in every moddable game and in Oolite even more so, because as you may have already found out, everything in Oolite is moddable. So, what is it that you would want to change? Ship stats? Commander stats and info? Systems? Want to add ships in the game? Add missions? Change the way space looks? Modify the AI? Design a new HUD? Different mod types will require a diiferent knowledge or experience sets.
 +
 +
Having said that, I think that simply starting with, say, [[Shipdata.plist]] and changing ship stats could be a first step. Same with [[Planetinfo.plist]], which changes planet data or [[Descriptions.plist]] which contains all the message strings used in the game. Start by doing small changes and slowly take it from there. Generally speaking, the '''Config''' folder contains all the files with data that the game uses to set up things. As for the other folders and in a very few words: '''Textures''' contains model, sky and planet texture files, '''Images''' contains generic UI stuff, splash screen files etc. '''Music''' contains any music piece that is heard in the game in .ogg format. '''Sounds''' contains sound effect files, again in ogg format. '''Scripts''' contains JavaScript files used by the system populator, as well as for missions and anything else that might respond to game events. '''AIs''' contains files used by the NPC AI, which can be either JavaScript or in the older, pre-1.80 format (for compatibility reasons). '''Scenarios''' contains pre-configured savegame files which are used to set up different starting points and configurations for '''Ooltie'''. Shaders contains GLSL vertex and fragment shader files used by the game's graphics engine. '''Models''' comtains the definitions of all game's model entities and these files are in .dat internal format; however, they are still text files so you can tweak them if that is what you want to do.
 +
 +
Generally, it is not recommended to start tweaking the files in the '''game's Resources folder''' directly. If you mess up, the game might not start or start behaving weirdly. If you do want to start experimenting, say with the files in Config, it is best to make a Config folder under the folder AddOns and copy the files you want to tweak inside. Also, keep in mind that the game maintains a cache file containing all its current settings, OXP paths and data etc and reads that on startup for performance reasons. If you do change things inside any OXP folder or even directly inside the Resources folder, you will need to start the game with the Shift key held down. This forces recreation of the cache file and makes the game re-read everything and thus include any changes you may have made.
 +
 +
Hope this helps. If there are further questions (and I am sure that there will be), feel free to ask. There are many experienced people here ready to help in a newcomer's first steps. And make sure to set some time aside to go through the wiki OXP pages. They are of great help. Good luck.
 +
 
 +
For more of this dialogue, click [https://bb.oolite.space/viewtopic.php?p=249516#p249516 here]
 +
 
 +
== Discussion: Tweaking an orphaned OXP with intent to publish it ==
 +
''Question: Cmdr Fleegman » Sat Feb 15, 2020 11:17 am''
 +
I'm not sure where to post this question, since it's about bug-fixing in oxps rather than tweaking - maybe it should be in Scripters Cove or the The All-in-One Guide.
 +
 +
My question: Is there a procedure/protocol for making permanent mods to other peoples' oxps?
 +
 +
I've written a fix for an oxp that has been left behind by the new Commodities structure in 1.81 and I'd like to get it added to the 'official' release of that oxp.
 +
I sent a pm to the author a little over 3 months ago, describing the problem and including my code to fix it, but I've not heard anything back.
 +
It looks like this oxp has been abandoned (the last update was in 2013) but I don't want to step on any toes or pinch anything that's not up for pinching, and if I wanted to adopt the oxp I wouldn't know how to go about it.
 +
 +
Are there conventions for:
 +
how to notify an author of a bug fix;
 +
how long to wait before considering an oxp orphaned;
 +
how to adopt an oxp and replace the original
 +
?
 +
 
 +
''Answer: UK_Eliter » Sat Feb 15, 2020 12:06 pm''
 +
Good question!
 +
 +
I think we've a convention for adopting or at least for part of that procedure. And we've a rule (prerequisite it) for it. That rule is: the OXP has to include, in its present form, a license that allows others to modify the code. The convention is: one notifies the person(s) who run(s) the official list of OXPs, requesting that your name be assigned to the OXP.
 +
 +
(Sorry if I am a bit terse but I'm pushed for time at the moment.)
 +
 
 +
''Riposte: Cmdr Fleegman » Sat Feb 15, 2020 3:34 pm''
 +
Thanks for the quick response UK_Eliter. I started looking into notifying the OXP List moderator, but in the process I discovered that the last update to the OXP was not 2013 - as shown on the list - but 2016.
 +
I then found the latest version. It was on display at the bottom of the last page of the BB thread, from a link halfway through the OXP wiki page, linked from the OXP List, with a sign on the door saying 'Beware of the Leopard'.
 +
 +
In that version the bug that I enquired about last June - before spending six months researching, gathering data, coding and testing - was already fixed. How I did laugh.
 +
On the upside my character went from Harmless to Dangerous in those six months, and I learned a lot about Oolite coding, so it's all good. :)
 +
 +
Anyway, I'm sure the question of orphaned OXPs will come up in the future, so thanks again for the advice.
  
 
== Links ==
 
== Links ==
  
*[[OXP]] for details on finding the ManagedAddOns & AddOns Folders for AppleMAc, Windows & Linux.
+
*[[OXP]] for details on finding the ManagedAddOns & AddOns Folders for AppleMac, Windows & Linux.
*[http://aegidian.org/bb/viewtopic.php?f=4&t=16337 BB Thread] with more detail and long list of tweaks.
+
*[https://bb.oolite.space/viewtopic.php?f=4&t=16337 BB Thread] with more detail and a lo-o-ong list of tweaks.
  
*[http://www.aegidian.org/bb/viewtopic.php?f=6&t=20650 Suggestions] for change to the system of doing this.
+
*[https://bb.oolite.space/viewtopic.php?f=6&t=20650 Suggestions] for change to the system of doing this.
*[[User:Aegidian|Aegidian]]'s views on tweaking (and on OXZ's generally!): [http://www.aegidian.org/bb/viewtopic.php?p=225294#p225294 here]. ''Tweaking an OXP is easier than doing the same to an OXZ.''
+
*[[User:Aegidian|Aegidian]]'s views on tweaking (and on OXZ's generally!): [https://bb.oolite.space/viewtopic.php?p=225294#p225294 here]. ''Tweaking an OXP is easier than doing the same to an OXZ.''
  
=== Other tweaks ===
+
=== Assorted tweaks ===
 +
==== Tweaking OXPs ====
 +
*[https://bb.oolite.space/viewtopic.php?f=4&t=20937 MasterClass: How to OXP (updating the Sothis.oxp override (''ie'' updating SothisTC.oxp))] (2021) - station spawning, location, markets
  
*[http://aegidian.org/bb/viewtopic.php?f=4&t=18257 Tweaking background stars, space dust, sun distance, etc. for 1.81+]
+
*[[Deep Space Dredger]] - see the "tweaks" section for making DSD's dockable for your [[Docking Computers]] in "non-waltzing"/fast docking mode
  
*[http://aegidian.org/bb/viewtopic.php?f=2&t=20685 Adding extra rows] for new commodities to the F8 Market Screen
+
*[https://bb.oolite.space/viewtopic.php?p=290352#p290352 Adding a Precision Flying indicator (for controllers/joysticks)]] to a HUD
 +
 
 +
*[https://bb.oolite.space/viewtopic.php?f=2&t=19100 Fixing the commodity markets for pre-2015 dockables] (2017)
 +
 
 +
*[https://bb.oolite.space/viewtopic.php?p=276673#p276673 Adding a market to Market Inquirer] for viewing in MFDs/other stations (2021)
 +
 
 +
*[https://bb.oolite.space/viewtopic.php?p=276525#p276525 Making Ship's Library free] (2021)
 +
 
 +
*[https://bb.oolite.space/viewtopic.php?f=4&t=20969 Digebitian variant] for [[BroadcastComms MFD]], for those seeking refinement in expression
 +
 
 +
*[https://bb.oolite.space/viewtopic.php?f=4&t=18257 Tweaking background stars, space dust, sun distance, ''etc''. for Oolite v.1.81+]
 +
 
 +
==== Tweaking game code ====
 +
*[https://bb.oolite.space/viewtopic.php?f=2&t=20685 Adding extra rows] for new commodities to the F8 Market Screen
  
 
*Tweaking galaxy seeds: [[Maps#Interactive_Maps|Interactive Maps]] - and see the linked discussion
 
*Tweaking galaxy seeds: [[Maps#Interactive_Maps|Interactive Maps]] - and see the linked discussion
 +
 +
=== Reference Pages ===
 +
*[[:Category:Oolite scripting]]
 +
*[[Oolite Javascript basics]] This is a very helpful layman's introduction to what Javascript is - and how it interfaces with Oolite
  
 
=== Other advice pages ===
 
=== Other advice pages ===
 
*[[How do I ...]] dock / succeed in trading / win a fight / configure my controller/joystick ''etc''
 
*[[How do I ...]] dock / succeed in trading / win a fight / configure my controller/joystick ''etc''
  
[[Category:Oolite]][[Category:Factual]]
+
[[Category:Oolite]][[Category:Factual]][[Category:Help pages]]

Latest revision as of 01:55, 29 February 2024

Tweaking OXZs

OXZ's usually live in your ManagedAddOns folder (but still work if lurking in your AddOns folder!).

  • To tweak an OXZ, you expand it, rewrite part of the code (following the instructions), and then repackage it as an OXP.
  • You then put the tweaked OXP in your AddOns folder.
  • You then restart the game holding down the shift button.

When you next dive into the entrails of the in-game Expansions Manager you will notice that that Expansion is now listed in red!

  • Note that you can directly download the OXZ in expanded state into your AddOns folder by pressing x when the Expansion is highlighted. The expanded expansion will have an .off extension superadded to the folder.
  • Note that the old OXZ if you have already downloaded one remains in your Managed Expansions folder.
  • Note also that the OXPs in your AddOns folder trump the OXZs in your Managed Expansions folder.
  • Note also that an OXZ is just a zipped OXP - there is essentially no difference between the two... Reval recommends adding a simple step to the tweaking process: create a folder in AddOns with an .oxp extension, and unzip the contents of the oxz to it (after renaming it .zip). Presto! - an OXP.
  • An OXZ, to be accepted, must also contain a manifest.plist, (it is basically a zipped version of the entire OXP with an added manifest.plist) whereas a pure OXP needs only a requires.plist. Reval's belt'n'braces approach is to include both.

Tweaking OXPs

OXP's live in your AddOns folder.

  • These are much easier - they do not need unzipping/rezipping.
  • On some systems the OXP just opens up as a regular folder.
On an AppleMac either select the OXP with the control key held down - and then choose the "Show Package Contents" option or edit the file name to replace the .oxp ending with .txt - it will transmogrify into a folder. Do your deeds of derring do (see the rest of this page). To return your folder to being an .oxp, just edit the folder name and put .oxp at the end! Pop it into your AddOns folder, and restart the game with the shift button held down.

Warning!

Some text editors (eg Windows) add extra lines of invisible text, turning your finely hand-crafted .oxp into gibberish! See Links below for other text editors.

And if you are copying code from the BB, you might find you've included somebody else's invisible text!

When copying code from the BB it's always better to hit the "quote" button and copy from the typing window. (Just don't press the "Submit" button after you're finished!) See the discussion here.

Discussion: Starting to tweak

Question: TheOldGamer » Fri Jun 03, 2016 4:30 pm

Hello all - I'm writing these questions with a certain amount of trepidation because usually - or at least in the past - I haven't had a problem getting myself going in the mod department. Most of my mods were centered around fairly simple config and similar files; such as in the Microsoft sim series, Orbiter and the like.

But I must admit that at the moment, I'm kind of stumped.

(sigh) I really, really hate to be the guy asking how one starts modding this game, but I've looked around this thread and the how-to's in the wiki and I can't seem to find an answer. I'm honestly not sure if I'm just missing something obvious, simply didn't read the one critical how-to or just lost a few billion brain cells the day the big 5-0 went whizzing by some time ago. :roll:

In particular, I was enormously pleased to read the conversation between Mohawk and Spara, because it was a perfect answer to one of my questions: how to make the various planetary systems a little more realistic. Like Mohawk, I would appreciate a larger, less condensed system and as Spara pointed out, the extra stations make the increased size a worthwhile change. Between them, they laid out the modifications well, clearly and understandably.

I just haven't a flamin' clue which file I'm supposed to modify. (Yiiiii!!! How lame is that?!?)

I've been going through the 'config' folder all morning and either I'm totally dense (which is, of course, always the most likely answer), the 'find' feature (Ctl-F) just doesn't work like it did in Win XP (I'm new to W-10) or Ghu, the Great God of Code simply loves to torture me (another high-level probability) but I simply cannot find the file which describes the overall workings of the Ooniverse.

I must admit - it's a little sobering to want to start modding (which I've always found to be as much fun as playing the game itself) and discovering I can't even figure out the file structure.

I hate to have to ask this, but I need a little nudge in the right direction. Once I get one or two simple tweaks under my belt, I'll get the idea of how this thing works and I'll be able to tinker with confidence. I doubt I'll be able to contribute much soon, but I've a few ideas and once I get the general idea I might be able to offer something in return. :)

Cheers!

Response: another_commander » Fri Jun 03, 2016 8:42 pm

Before anything else, you need to have an objective regarding modding. This is true in every moddable game and in Oolite even more so, because as you may have already found out, everything in Oolite is moddable. So, what is it that you would want to change? Ship stats? Commander stats and info? Systems? Want to add ships in the game? Add missions? Change the way space looks? Modify the AI? Design a new HUD? Different mod types will require a diiferent knowledge or experience sets.

Having said that, I think that simply starting with, say, Shipdata.plist and changing ship stats could be a first step. Same with Planetinfo.plist, which changes planet data or Descriptions.plist which contains all the message strings used in the game. Start by doing small changes and slowly take it from there. Generally speaking, the Config folder contains all the files with data that the game uses to set up things. As for the other folders and in a very few words: Textures contains model, sky and planet texture files, Images contains generic UI stuff, splash screen files etc. Music contains any music piece that is heard in the game in .ogg format. Sounds contains sound effect files, again in ogg format. Scripts contains JavaScript files used by the system populator, as well as for missions and anything else that might respond to game events. AIs contains files used by the NPC AI, which can be either JavaScript or in the older, pre-1.80 format (for compatibility reasons). Scenarios contains pre-configured savegame files which are used to set up different starting points and configurations for Ooltie. Shaders contains GLSL vertex and fragment shader files used by the game's graphics engine. Models comtains the definitions of all game's model entities and these files are in .dat internal format; however, they are still text files so you can tweak them if that is what you want to do.

Generally, it is not recommended to start tweaking the files in the game's Resources folder directly. If you mess up, the game might not start or start behaving weirdly. If you do want to start experimenting, say with the files in Config, it is best to make a Config folder under the folder AddOns and copy the files you want to tweak inside. Also, keep in mind that the game maintains a cache file containing all its current settings, OXP paths and data etc and reads that on startup for performance reasons. If you do change things inside any OXP folder or even directly inside the Resources folder, you will need to start the game with the Shift key held down. This forces recreation of the cache file and makes the game re-read everything and thus include any changes you may have made.

Hope this helps. If there are further questions (and I am sure that there will be), feel free to ask. There are many experienced people here ready to help in a newcomer's first steps. And make sure to set some time aside to go through the wiki OXP pages. They are of great help. Good luck.

For more of this dialogue, click here

Discussion: Tweaking an orphaned OXP with intent to publish it

Question: Cmdr Fleegman » Sat Feb 15, 2020 11:17 am

I'm not sure where to post this question, since it's about bug-fixing in oxps rather than tweaking - maybe it should be in Scripters Cove or the The All-in-One Guide.

My question: Is there a procedure/protocol for making permanent mods to other peoples' oxps?

I've written a fix for an oxp that has been left behind by the new Commodities structure in 1.81 and I'd like to get it added to the 'official' release of that oxp.
I sent a pm to the author a little over 3 months ago, describing the problem and including my code to fix it, but I've not heard anything back.
It looks like this oxp has been abandoned (the last update was in 2013) but I don't want to step on any toes or pinch anything that's not up for pinching, and if I wanted to adopt the oxp I wouldn't know how to go about it.

Are there conventions for:
how to notify an author of a bug fix;
how long to wait before considering an oxp orphaned;
how to adopt an oxp and replace the original
?

Answer: UK_Eliter » Sat Feb 15, 2020 12:06 pm

Good question!

I think we've a convention for adopting or at least for part of that procedure. And we've a rule (prerequisite it) for it. That rule is: the OXP has to include, in its present form, a license that allows others to modify the code. The convention is: one notifies the person(s) who run(s) the official list of OXPs, requesting that your name be assigned to the OXP.

(Sorry if I am a bit terse but I'm pushed for time at the moment.)

Riposte: Cmdr Fleegman » Sat Feb 15, 2020 3:34 pm

Thanks for the quick response UK_Eliter. I started looking into notifying the OXP List moderator, but in the process I discovered that the last update to the OXP was not 2013 - as shown on the list - but 2016.
I then found the latest version. It was on display at the bottom of the last page of the BB thread, from a link halfway through the OXP wiki page, linked from the OXP List, with a sign on the door saying 'Beware of the Leopard'.

In that version the bug that I enquired about last June - before spending six months researching, gathering data, coding and testing - was already fixed. How I did laugh.
On the upside my character went from Harmless to Dangerous in those six months, and I learned a lot about Oolite coding, so it's all good. :)

Anyway, I'm sure the question of orphaned OXPs will come up in the future, so thanks again for the advice.

Links

  • OXP for details on finding the ManagedAddOns & AddOns Folders for AppleMac, Windows & Linux.
  • BB Thread with more detail and a lo-o-ong list of tweaks.
  • Suggestions for change to the system of doing this.
  • Aegidian's views on tweaking (and on OXZ's generally!): here. Tweaking an OXP is easier than doing the same to an OXZ.

Assorted tweaks

Tweaking OXPs

Tweaking game code

Reference Pages

Other advice pages

  • How do I ... dock / succeed in trading / win a fight / configure my controller/joystick etc