Page 1 of 1

How to change .txt file to .oxz?

Posted: Thu Jan 12, 2017 12:45 am
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

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

Posted: Thu Jan 12, 2017 1:21 am
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?

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

Posted: Thu Jan 12, 2017 1:43 am
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.

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

Posted: Thu Jan 12, 2017 2:01 am
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?

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

Posted: Thu Jan 12, 2017 2:04 am
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

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

Posted: Thu Jan 12, 2017 2:19 am
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.

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

Posted: Thu Jan 12, 2017 2:25 am
by phkb
Cmdr. Aiden Henessy wrote:
Major brownie points to you, sir.
Cool! But can I get those brownies converted into cookies? Mmmm, cookies...