Page 1 of 3
Ship Editing
Posted: Wed Nov 21, 2012 4:08 am
by Flypaste
I have been trying for two days now to be able to pilot some of the AI ships, and something is always wrong, and i don't know how to do a couple things. Firstly, the ship creater i was using, always had a syntax error somewhere. Also, i don't know how to set the weapon mounts on the hull. If there are anymore problems i remember ill edit this and put them there.
Re: Ship Editing
Posted: Wed Nov 21, 2012 8:40 am
by thashepherd
Flypaste wrote:I have been trying for two days now to be able to pilot some of the AI ships, and something is always wrong, and i don't know how to do a couple things. Firstly, the ship creater i was using, always had a syntax error somewhere. Also, i don't know how to set the weapon mounts on the hull. If there are anymore problems i remember ill edit this and put them there.
Which ship creator where you using?
I've been setting weapon mounts via trial-and-error; the XML you'll want to look it is in <ship_name>.xml.
Keep in mind that if you want to pilot an AI ship, you're going to need to copy the image of the AI ship, turn it 90 degrees, and link to it from one of the 9 existing ships in blueprints.xml. I haven't tried using an AI layout from blueprints.xml but I imagine that part will work just fine.
Re: Ship Editing
Posted: Wed Nov 21, 2012 2:04 pm
by Flypaste
I have been using this
http://www.ftlgame.com/forum/viewtopic.php?f=4&t=2959
Are you sure there is no editor to do the weapon linkpoints for you? and yes, i AM rotating the ship image

Re: Ship Editing
Posted: Wed Nov 21, 2012 4:46 pm
by alextfish
Mount points are actually really easy to find out. Open up your ship image in any image editor - even MSPaint will do! Position your mouse cursor over where you want the mount point to be, and look in the status bar for the X and Y coordinates (looking like "253,91" or whatever). That's your mount point.
You can set the place where the artillery beam automatically fires from as the N+1th mount point. Eg if your ship has 4 weapon slots, add a 5th mount point and that's where the artillery beam is fired from.
As for the editor: its capabilities are pretty basic. You should certainly expect to need to update the XML within your .ftl file by hand. It's great for producing the layout file (the myship.txt file) for you, but the blueprint (produced in blueprints.xml.append) is very basic and missing a lot of bits, and it doesn't produce an info file (myship.xml) at all.
You'll need to do the following to the blueprint by hand:
* Remove any surplus weapons, drones or augments
* Specify a <shieldImage>
* Fix the images for systems to ones that are more suited to the shapes of your rooms
* Set the reactor power <maxPower>
Re: Ship Editing
Posted: Wed Nov 21, 2012 5:30 pm
by Flypaste
how do i set the reactor power, and what do you mean about the surplus weapons?
Also, do i need to have a "floor"? (the greyscale image behind the rooms on the ship)
i dont know how to create the shield image

Could you offer any pointers..?
EDIT
img x="-30" y="-56" w="242" h="389" What do i do with THAT?
And what do these mean? <mount x="95" y="80" rotate="false" mirror="true" gib="1" slide="left"/>
Re: Ship Editing
Posted: Wed Nov 21, 2012 11:58 pm
by thashepherd
Flypaste wrote:how do i set the reactor power, and what do you mean about the surplus weapons?
Also, do i need to have a "floor"? (the greyscale image behind the rooms on the ship)
i dont know how to create the shield image

Could you offer any pointers..?
EDIT
img x="-30" y="-56" w="242" h="389" What do i do with THAT?
And what do these mean? <mount x="95" y="80" rotate="false" mirror="true" gib="1" slide="left"/>
1. <maxpower> in blueprints.xml, as the guy posting above just said.
2. Not sure - but a transparent or tiny/cursory floor ought to be fine. Some ships seem not to have one at all.
3. Copy an existing shield image and modify it - the size should be fine for your needs. You can override a ship to use another ship's shield. Multiple layers of shield stamp the same shield image multiple times, so make sure it's transparent.
4. img x="-30" y="-56" w="242" h="389" where? In animations? Should be pretty self-explanatory.
5. <mount x="95" y="80" rotate="false" mirror="true" gib="1" slide="left"/> That would be the x/y offset of the weapon mounting point. Gib tells you which gib fragment the weapon is moved with. Mirror="whatever" lets you have weapons on each side of the ship that are, well, mirrored. Not sure about the rotation attribute.
Re: Ship Editing
Posted: Thu Nov 22, 2012 1:45 am
by shark
for the floor, use a small black or transparent image for the floor. put it there for completeness, make it useless (invisible) and then you won't forget to redo it at some point.
Flypaste wrote:
Could you offer any pointers..?
Sure. 0x412A67EC, 0x459BBAFC, and of course 0xDEADBAAD.

))
On a more serious note, a good way to learn is to ask questions; questions however have a bad side of having to wait for an answer... on the other hand, the solutions are already available to you, so why not rephrase your question then talk with the solution in order to work out your answer from both ends? If the metaphore wasn't clear, i'm talking about reading other people's source-code.
Not simply copy/pasting it, reading it, understanding it and implementing it in a proper way either by remaking it, improving it or by integrating it in your mod (copy/pasting). You just have to be inquisitive, and have the balls to experiment yourself. And that is the best way to learning what won't work, which is a good start to figuring out what will and will not work before running it.
so after that brief motivational speech i'll answer the last unanswered question.
Code: Select all
img x=<horizontal displacement> y=<vertical displacement> w=<image width> h=<image height>
the ship has a "center point" around which it floats. using these displacements one can shift that center point to a better suited position; say if you have a weird looking ship that could still be ellipsized - enclosed by an ellipse - but only if you move the sprite a bit to the left.
shields can also be moved around, but they move relatively to the "center point"; the former allows you to mock-up a different point from which the shield's ellipse will originate. using these two, you should be able to fine tune any shield* to every possible ship because of ellipses inherent ability to be a convex hull. i like how they handled it
also, you can check for sample/reference code in my mod; the obsidian cruiser finely demonstrates a few key techniques you should pick up too. and you get to see what all you need to do to make it work properly

Re: Ship Editing
Posted: Thu Nov 22, 2012 3:11 am
by thashepherd
Well, shark, your answer was better than mine - something tells me you're already tearing up stack overflow

Re: Ship Editing
Posted: Thu Nov 22, 2012 4:58 pm
by Flypaste
Hmm.
What do you mean about horizontal and vertical placement?
w and h, understood.
That other one was about the weapon mounts.
So, what i could do is, put the image n paint or whatever, and hover the cersor over the part of the ship i want the weaponmount to go, then type in its co-ords, with the specified side to slide out from? Interesting. Thanks

Also, what is this? <health amount="0" /> its in the xml document for the ship loadout specifications. And what did you mean about the floor? is it required for the ship to work?
Re: Ship Editing
Posted: Sun Nov 25, 2012 12:08 am
by Flypaste
bump? does the thread display work like this?