Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: [1] 2

Author Topic: Weapon Modding Tutorial?  (Read 12372 times)

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Weapon Modding Tutorial?
« on: June 23, 2012, 08:33:33 PM »

Anyone know of a good weapon modding tutorial anywhere even if only the basics? I already looked at the csv data entry explanations but I am more looking for a how-to of setting certain sprites to certain weapon effects and how the recoil animations work and that sort of stuff.
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #1 on: June 23, 2012, 09:06:16 PM »

Ahhh, you have come to the right place. ;D
I'll PM you a tutorial when I get the chance, if you want.
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

Killian

  • Commander
  • ***
  • Posts: 114
  • I got 99 problems but a core breach ain't one.
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #2 on: June 24, 2012, 01:24:24 AM »

Why not post it openly? Then it can be linked in the Tools & Resources thread too. Everyone wins!
Logged

Vandala

  • Admiral
  • *****
  • Posts: 1841
  • We need ponies, ponies in spaceships!
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #3 on: June 24, 2012, 05:01:43 AM »

TrexTitan

  • Ensign
  • *
  • Posts: 10
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #4 on: June 24, 2012, 06:19:29 AM »

Uhm, asking this here because i don't want to start a new thread for it;

Is there any way to increase the size of ships? i don't care if the sprite gets a little less sharp as a result (like 20% increase in sprite size would bother me..)
I can see the boundary in the ship file, but idk which ones to increase, if that's how you do it.
Logged

Tezarius

  • Lieutenant
  • **
  • Posts: 66
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #5 on: June 24, 2012, 07:33:21 AM »

If you talking about ALL ships then... try to lower zoom scale by mouse wheel  ;D
Any way, as far as I know, there is no way to do it automatically, but if you want to know how .ship files works you can try this:
http://fractalsoftworks.com/forum/index.php?topic=375.0
http://fractalsoftworks.com/forum/index.php?topic=435.0

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7174
  • Harpoon Affectionado
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #6 on: June 24, 2012, 09:22:08 AM »

If you are using the sprite in a new ship, then open the sprite in an image editor (Gimp is a good one) and there should be an option of "scale image". Then load the sprite in a ship editor and redo all the positions - or go through the file by hand and multiply each number by the factor you scaled by. Its a pain.
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #7 on: June 24, 2012, 10:04:10 AM »

Fine, I'll type it here when I get the time. ;D
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #8 on: June 24, 2012, 03:53:30 PM »

@ The Soldier

Thank you!  ;D I will look forward to seeing it under the tools and resources thread or as a pm whichever you prefer; beggars can't be choosers!

As for increasing ship size as it has already said simply importing the image into something like paint.net and scaling it up a bit should work but I wouldn't bother scaling all the other things up from that I would just rebuild the ship from scratch it is probably much easier and less confusing to do so. Also remember that if the ship has weapon mount slots built into the sprite like most vanilla ships do then they will also increase in size and be visible even with weapons fitted.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #9 on: June 24, 2012, 04:02:13 PM »

@ Vandala

Thanks for that resource! That is some useful information and gets me one step closer to completion of my mod  8)
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #10 on: June 25, 2012, 06:16:02 AM »

Weapons coding isn't too hard.  Just copy and paste the .wpn file that's closest in relation to the new weapons (in terms of the shooting effect, e.g. GLOW, SMOKE, FLASH, etc.) just because it's easier to code.  Now, once you've done that, change the name of the weapon to the new name of the weapons (e.g. change "hellbore" to "ingen" as I did for the Ingen Cannon).  THE NAME OF THAT MUST BE THE SAME AS THE NAME OF THE FILE!!!  Then change the last part of the textures line:
Code:

   "turretSprite":"graphics/weapons/(insert original sprite name).png",


To:

Code:

   "turretSprite":"graphics/weapons/(insert new sprite name).png",


Play around with the animation types and colors, it'll take some time to find out how the colors work. (255, 255, 255, 255 code means color, in this order:
Red, Green, Blue, Opaqueness
Opaqueness means how visible the color is)

And the most annoying and hardest to understand part, the Turret/HardpointOffset code.  This means how many barrel the weapon will have.  Now, the lines of code are not as easy as you suspect.  It may look like points on a graph, but it's not.  They're points on a graph, but flipped sideways.  Put simply, just take the coordinates you find (from the center of the spite.  A 64x64 sprite woud have it's center at 32x32) and flip the numbers.  If a barrel was located 5 pixels to the left and 10 pixels up from the center, the code would be (10, 5).  And extended code for more than one barrel would be (10, 5, 10, -5) by just adding more code.  This is the hardest part to understand and explain, so good luck.

Now it's time for the projectile type.  Choose the one that suits the gun most.  Then change the sound of the gun, if necessary, and you're done!

Anyway, that concludes my explanation on how to edit the .wpn file (I had to learn everything by trial-and-error) and if you'd like to learn how to make a new .proj file (new projectile file) then just ask.
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

IIE16 Yoshi

  • Admiral
  • *****
  • Posts: 558
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #11 on: June 25, 2012, 12:05:37 PM »

It isn't that hard to figure out the co-ords thing. Although I do find the part where it's all rotated 90 degrees clockwise to be a bit wierd. That threw me for quite a while.
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #12 on: June 25, 2012, 12:08:39 PM »

It isn't that hard to figure out the co-ords thing. Although I do find the part where it's all rotated 90 degrees clockwise to be a bit wierd. That threw me for quite a while.
Yea, that's my worst enemy. ;D
Took me a few days to figure out why my rocket engines were backwards of where I put the coordinates in.
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

KriiEiter

  • Commander
  • ***
  • Posts: 126
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #13 on: June 25, 2012, 12:43:20 PM »

It isn't that hard to figure out the co-ords thing. Although I do find the part where it's all rotated 90 degrees clockwise to be a bit wierd. That threw me for quite a while.
Yea, that's my worst enemy. ;D
Took me a few days to figure out why my rocket engines were backwards of where I put the coordinates in.

That's why I love Tyrolobot's ship editor.  If we had something like that for weapon coding I'd have a nerdgasm.

Logged
"If it aint broke, don't fix it."

MiniFishy

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: Weapon Modding Tutorial?
« Reply #14 on: June 25, 2012, 12:45:14 PM »

It isn't that hard to figure out the co-ords thing. Although I do find the part where it's all rotated 90 degrees clockwise to be a bit wierd. That threw me for quite a while.
Yea, that's my worst enemy. ;D
Took me a few days to figure out why my rocket engines were backwards of where I put the coordinates in.

That's why I love Tyrolobot's ship editor.  If we had something like that for weapon coding I'd have a nerdgasm.



I believe that's on the way..
Logged
Pages: [1] 2