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

How to change .txt file to .oxz?

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

Moderators: winston, another_commander

Post Reply
User avatar
Cmdr. Aiden Henessy
Competent
Competent
Posts: 36
Joined: Wed Aug 24, 2016 10:30 pm

How to change .txt file to .oxz?

Post by Cmdr. Aiden Henessy »

Hey All,

So I'd just like to preface with a quick apology - I did do my research beforehand, but I was unable to find an answer to this or I'm somehow missing something and thus unable to do it. I'm sure there's plenty of people who just ask questions without searching for the answer, but I have attempted to do that myself. Despite that though I feel bad asking what is probably a pretty simple question. In my defense however, this is a huge learning experience for me and I'm excited to do even this small simple project, because I've never tried any form of coding before - even simple ones where I just add values to data.

With that in mind however. I have a shiny new .txt file I made on Notepad++ with data for a laser I'd like to implement. However I'm unable to figure out how to turn that .txt file into a .oxp file, and thus Oolite cannot read the file. Could someone point me in the right direction or show me the steps to take? I've read most all of the pinned posts about OXP development, but couldn't figure it out. I've got my file all zipped up and it's all formatted correctly, I just can't figure out how to change that .txt to .oxp.


Thanks for your help! Fly safe, commanders.

-Cmdr Aiden H
I'm Ravished by the Sheer Implausibility of that Last Statement

It should be a crime for Anacondas to fly without escort. That much temptation is just too much to resist.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4704
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: How to change .txt file to .oxz?

Post by phkb »

I'm going to assume that your .txt file is the definition for a new laser of some sort, with text that looks something like this:

Code: Select all

(
	(
		10, 60000, "My SuperLaser",
		"EQ_WEAPON_MYSUPER_LASER",
		"Superpowerful laser of my own design",
		{
			available_to_all = true;
			weapon_info = {
				range = 30000;
				energy = 1.1;
				damage = 12.0;
				recharge_rate = 0.1;
				shot_temperature = 4.25;
				color = "magentaColor";
				threat_assessment = 1.0;
			};
		}
	),
)
That file should not have a .txt extension, though. It needs to be named "equipment.plist".

You need to create a folder structure in your "AddOns" folder, something like this:

Code: Select all

Addons/
	MySuperlaser.oxp/
		Config/
	
You need to save your "equipment.plist" file in that "Config" folder.
Finally, you need to add a "manifest.plist" file in the "MySuperlaser.oxp" folder. This is another text file that will look something like this:

Code: Select all

{
	"identifier" = "oolite.oxp.your_name_or_id.MySuperLaser";
	"required_oolite_version" = "1.82";
	"title" = "My Superlaser";
	"version" = "1.0";
	"category" = "Weapons";
	"description" = "Adds 'MySuperLaser' as a purchasable laser";
	"author" = "Your Name";
	"license" = "CC BY-NC-SA 4.0";
}
So you should end up with a file/folder structure that looks like this:

Code: Select all

AddOns/
	MySuperlaser.oxp/
		Config/
			equipment.plist
		manifest.plist
That should be the bare-bones minimum for creating an OXP for a laser weapon. To convert an OXP to an OXZ, you simply zip the contents of the "MySuperlaser.oxp" folder. But note: not the "MySuperlaser.oxp" folder itself. The content only.

Is that what you're after?
User avatar
Cmdr. Aiden Henessy
Competent
Competent
Posts: 36
Joined: Wed Aug 24, 2016 10:30 pm

Re: How to change .txt file to .oxz?

Post by Cmdr. Aiden Henessy »

phkb wrote: Thu Jan 12, 2017 1:21 am
That file should not have a .txt extension, though. It needs to be named "equipment.plist".
Yeah, that's the thing, I can't figure out how to make it not have a file type of .txt. Is that something that needs to be done inside of Notepad++, a "save as" sort of function?

I feel like it's such a simple question, but I'm just missing something.
I'm Ravished by the Sheer Implausibility of that Last Statement

It should be a crime for Anacondas to fly without escort. That much temptation is just too much to resist.
Rustem
Deadly
Deadly
Posts: 170
Joined: Mon May 25, 2015 5:23 pm
Location: Russia

Re: How to change .txt file to .oxz?

Post by Rustem »

Cmdr. Aiden Henessy wrote: Thu Jan 12, 2017 1:43 am
I feel like it's such a simple question, but I'm just missing something.
You operating system is GNU/Linux or OSX or Windows?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4704
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: How to change .txt file to .oxz?

Post by phkb »

You should be able to do a "Save as..." in Notepad++. Or you can rename the file in Windows Explorer. Just make sure you have the extensions visible, otherwise your "mydoc.txt" file will probably just be shown as "mydoc". See this URL for info on how to show file extensions. http://www.thewindowsclub.com/show-file ... in-windows
User avatar
Cmdr. Aiden Henessy
Competent
Competent
Posts: 36
Joined: Wed Aug 24, 2016 10:30 pm

Re: How to change .txt file to .oxz?

Post by Cmdr. Aiden Henessy »

phkb wrote: Thu Jan 12, 2017 2:04 am
You should be able to do a "Save as..." in Notepad++. Or you can rename the file in Windows Explorer. Just make sure you have the extensions visible, otherwise your "mydoc.txt" file will probably just be shown as "mydoc". See this URL for info on how to show file extensions. http://www.thewindowsclub.com/show-file ... in-windows
Thank you, that did it! :) This community is awesome. Major brownie points to you, sir.
I'm Ravished by the Sheer Implausibility of that Last Statement

It should be a crime for Anacondas to fly without escort. That much temptation is just too much to resist.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4704
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: How to change .txt file to .oxz?

Post by phkb »

Cmdr. Aiden Henessy wrote:
Major brownie points to you, sir.
Cool! But can I get those brownies converted into cookies? Mmmm, cookies...
Post Reply