Author Topic: Help modding a craft weapon  (Read 12393 times)

Offline guille1434

  • Colonel
  • ****
  • Posts: 123
    • View Profile
Help modding a craft weapon
« on: August 27, 2014, 03:04:07 am »
Hello: Here I found one problem that I cannot solve, and I would like that some kind person here give me some advice.

The problem is that I am making a small air combat rebalance mod, part of it is the adition of some new craft weapons. I did mod in a new craft cannon, which was researched and manufatured without a problem, but while in the "Equip Craft" screen, the very moment I choose one of this weapons the game crashes...

Can anyone give me some suggestion about what to do to solve this problem?

Thanks!  :(

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Help modding a craft weapon
« Reply #1 on: August 27, 2014, 03:31:44 am »
first step in problemsolving is showing your ruleset
likely your sprites are wrongly assigned

Offline guille1434

  • Colonel
  • ****
  • Posts: 123
    • View Profile
Re: Help modding a craft weapon
« Reply #2 on: August 27, 2014, 03:51:53 am »
I checked that aspect of the problem, and I think it is Ok, but... In any case I upload here my .rul file, the problematic craftWeapon is designated STR_CRAFT_MDRIVER_UC

I suspect that the problem has to do with the basebit and Initicon files... Anyone can tell me if those files have to be in any special format (file extension, colors palette, etc)?

I attach them also for someone to check, if possible, if they are  the source of the problems. About this files, if they are faulty, do someone have some "vanilla" files to use as models for my custom ones?

Thanks Falko for your prompt answer!

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Help modding a craft weapon
« Reply #3 on: August 27, 2014, 04:09:13 am »
see
https://www.ufopaedia.org/index.php?title=BASEBITS.PCK
https://www.ufopaedia.org/index.php?title=INTICON.PCK
oxc example:
Code: [Select]
craftWeapons:
  - type: STR_STINGRAY
    sprite: 0
the stingray is in position 5 in inticon and in position 48 in basebits
(i count starting with 0 so position 0 ist the first position)
if you add a weapon with sprite 12
oxc expects file ids in position 5+12 in inticon and in position 48+12 in basebits
so what do we have?
Code: [Select]
  - type: STR_CRAFT_MDRIVER_UC
    sprite: 12
.......
  - type: BASEBITS.PCK
    files:
      56: Resources/FmpAddon/Retaliator/retaliator_base.gif
      #133=100+33
      133: Resources/FmpAddon/Skytrooper/Skytrooper_BASEBITS.PNG
  - type: INTICON.PCK
    files:
      23: Resources/FmpAddon/Retaliator/retaliator_minimised.gif
      34: Resources/FmpAddon/Retaliator/retaliator_dogfight.gif
      100: Resources/FmpAddon/Skytrooper/SkytrooperMinimized_INTICON.PNG
      #111=100+11
      111: Resources/FmpAddon/Skytrooper/SkytrooperDogfight_INTICON.PNG

file ids do not match

Edit:
also your images are in RGBA mode
oxc needs indexed images

one way:
save them as gif
use https://falkooxc.pythonanywhere.com/palconvert# (
upload gif, seelct from base/geo to base/geo palette , more details -> [ x] try to fix palette colors )->that resulting image should work
« Last Edit: August 27, 2014, 04:21:48 am by Falko »

Offline guille1434

  • Colonel
  • ****
  • Posts: 123
    • View Profile
Re: Help modding a craft weapon
« Reply #4 on: August 27, 2014, 04:40:21 am »
So, If I assign sprite number 13 to this weapon (I saw number 12 is already taken), the initicon file has to be number 23 (5 + 13) and basebits 61 (48 + 13)? I will test it....

Here is the modified .rul file.

Also, thanks very much for the tips for the graphic files!!

--- posts merge ---

About the graphic files: I used the palette converter, used the options from ufo-bsescape to ufo-bsescape (did not see base/geo palette), but the resulting files could not be opened in Aseprite... Am I doing something wrong?

--- posts merge ---

Ok, the resulting files were png, not gifs... I changed thier exyensions, but the Initicon one is not looking good... I will try to hand make one new file with the base of a vanille file...

Thanks!!!  8)

--- posts merge, honestly ---


Ok, a partial success... All seems to fine (equip craft, interception launching, the icon showed in the small interceptor radar screen, but now the games crash when the weapon is starting to fire... I think this has to do with the small blob which represents the projectiles while in flight to target... Am I roght? How is this corrected? Or may be the problem is about the sound file? Any special numeration rule for the sound file id number? Thanks again!

--- posts merge, I can do it all day but do I have to? ---

Indeed, the problem seems to be about the sound, as I assigned another sound file number (the same as anothe good-working weapon) and everything was all right... But I would really like to assign this weapon its own characteristic sound... How do I accomplish this? Thanks again!!
« Last Edit: February 03, 2016, 09:18:37 am by Solarius Scorch »

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Help modding a craft weapon
« Reply #5 on: August 27, 2014, 07:02:40 am »
Indeed, the problem seems to be about the sound, as I assigned another sound file number (the same as anothe good-working weapon) and everything was all right... But I would really like to assign this weapon its own characteristic sound... How do I accomplish this? Thanks again!!

add your sound to the resources folder and specify it.

i.e.
Code: [Select]
items:
  - type: STR_DART_PISTOL
#<lines of code cut out here>
    fireSound: 65
extraSounds:
  - type: BATTLE.CAT
    files:
      65: Resources/DartPistol/Sounds/Fire2.wav

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Help modding a craft weapon
« Reply #6 on: August 27, 2014, 08:47:40 am »
Ok, the resulting files were png, not gifs... I changed thier exyensions, but the Initicon one is not looking good... I will try to hand make one new file with the base of a vanille file...

Thanks!!!  8)
inticon needs the geoscape palette called ufo-geo in the webtool
regarding sound no idea what the problem is i never modded sound

Offline guille1434

  • Colonel
  • ****
  • Posts: 123
    • View Profile
Re: Help modding a craft weapon
« Reply #7 on: August 28, 2014, 01:17:30 am »
I managed to mod in the custom graphics without a problem now, but I cannot assign a custom sound file to this weapon without making the game crash... If I assign a vanilal sound everything seems to be Ok.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Help modding a craft weapon
« Reply #8 on: August 28, 2014, 01:27:44 am »
looks like you will want to use geo.cat.


GEO.CAT - Geoscape sound

Code: [Select]
Example:
- type: GEO.CAT
  files:
    55: Resources/Sounds/sample.wav

can you post your ruleset?

Edit: Sorry>>> its SAMPLE.CAT


--- posts merge ---


this is what I found in the last ruleset you posted

Code: [Select]
extraSounds:
  - type: BATTLE.CAT
    files:
      155: Resources/FmpAddon/MassDriverCraft/Sound/MassDriver_Fire1.wav

This should be type: SAMPLE.CAT

https://www.ufopaedia.org/index.php?title=Ruleset_Reference_(OpenXcom)#Craft_Weapons
« Last Edit: February 03, 2016, 09:16:02 am by Solarius Scorch »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Help modding a craft weapon
« Reply #9 on: August 28, 2014, 12:42:49 pm »
GEO.CAT

we use GEO.CAT and BATTLE.CAT internally.
there are multiple different sound files out there, some called SOUNDx.CAT some called SAMPLEx.CAT, but only the internal names we use are of any relevance to modders.

Offline guille1434

  • Colonel
  • ****
  • Posts: 123
    • View Profile
Re: Help modding a craft weapon
« Reply #10 on: August 29, 2014, 07:22:57 pm »
Ivan: Thanks for the advice, but that one does not seem to be the problem... the game is still crashing at the moment of firing the weapon against an Ufo... I will stick with a vanilla sound effect for now...  ::)

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Help modding a craft weapon
« Reply #11 on: August 29, 2014, 08:23:50 pm »
Ok, sorry we didn't get it sorted out. Thanks for the feedback.

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Help modding a craft weapon
« Reply #12 on: August 29, 2014, 08:31:24 pm »
can you upload your wave file?

Offline guille1434

  • Colonel
  • ****
  • Posts: 123
    • View Profile
Re: Help modding a craft weapon
« Reply #13 on: August 30, 2014, 06:12:25 am »
Yes, here is the last version of the .rul file and the .wav file... Thanks for your interest, guys! :-)

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Help modding a craft weapon
« Reply #14 on: September 01, 2014, 05:37:04 am »
found the time to test it
Code: [Select]
craftWeapons:
  - type: STR_STINGRAY
    sound: 66
extraSounds:
  - type: GEO.CAT
    files:
      66: Resources/MassDriver_Fire1.wav
worked fine