aliens

Author Topic: bug when running mod from main rule file  (Read 4554 times)

Offline bladum

  • Colonel
  • ****
  • Posts: 213
  • Bladum
    • View Profile
bug when running mod from main rule file
« on: November 15, 2014, 01:18:28 am »
symptoms:

app is crush when starting mission and big object should be displayed

my setup is:

latest night build + shotgun mod https://www.openxcom.com/mod/shotgun + x-com extender

steps to duplicate:

when mod is integrated into main rul file then GIF files from mod cannot be read, for example when big object should be loaded then game crashes or when hand object should be then game crashes
when mod is run as a seperate mod then its working fine without changes

For sure this is related for this part
Code: [Select]
extraSprites:
  - type: BIGOBS.PCK
    files:
      60: Resources/Shotgun/Shotgun.gif
      61: Resources/Shotgun/ReinforcedShotgun.gif
      62: Resources/Shotgun/ShotgunAmmo.gif
      63: Resources/Shotgun/AlloyShotgunAmmo.gif
      64: Resources/Shotgun/EleriumShotgunAmmo.gif
  - type: FLOOROB.PCK
    files:
      74: Resources/Shotgun/ShotgunF.gif
      75: Resources/Shotgun/ReinforcedShotgunF.gif
      76: Resources/Shotgun/ShotgunAmmoF.gif
      77: Resources/Shotgun/AlloyShotgunAmmoF.gif
      78: Resources/Shotgun/EleriumShotgunAmmoF.gif
  - type: HANDOB.PCK
    files:
      128: Resources/Shotgun/ShotgunH.gif
      136: Resources/Shotgun/ReinforcedShotgunH.gif
    width: 128
    height: 80
    subX: 32
    subY: 40
important notes:

i moved most stuff outside Xcom1Ruleset to other rulesets to have all under control.

My questions are:

1) does order of mods matter ? i mean file names
2) can several  BIGOBS.PCK be loaded under single extraSprites in one file or should they be divided single extraSprites per a file

Tom

Offline bladum

  • Colonel
  • ****
  • Posts: 213
  • Bladum
    • View Profile
Re: bug when running mod from main rule file
« Reply #1 on: November 15, 2014, 11:35:11 am »
i removed all comments ( for example "# ALIENS| ) from rul files and its working, that is strage...

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: bug when running mod from main rule file
« Reply #2 on: November 15, 2014, 12:54:29 pm »
1: xcom1ruleset.rul should always be loaded first, followed by any mods.

2: mods themselves need to be "self contained" meaning that if you're using extra graphics for some weapon (ie: shotgun) it MUST be defined in the same rule file.

Offline bladum

  • Colonel
  • ****
  • Posts: 213
  • Bladum
    • View Profile
Re: bug when running mod from main rule file
« Reply #3 on: November 24, 2014, 10:35:15 am »
thanks !

this is by design ? how to split larger mod into different files ? only images need to be in the same file as source (craft, unit, item etc) ?

Tom

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: bug when running mod from main rule file
« Reply #4 on: November 24, 2014, 12:07:48 pm »
images, and sounds, yes.

Offline bladum

  • Colonel
  • ****
  • Posts: 213
  • Bladum
    • View Profile
Re: bug when running mod from main rule file
« Reply #5 on: November 29, 2014, 01:04:04 pm »
and what should be location for this file ?

  - type: Projectiles
    width: 105
    height: 78
    subX: 3
    subY: 3
    files:
      0: Resources/BulletSprites.png  ?

When put into main rul data it does not work, when put into mod file it does not either. When everything is put into single file (main file) then its ok, projectiles are loaded properly.

Actually i am unable to load any projectile with ID larger then standard maximum (which is 11 i think), so >=12 does not work. In the same time all other graphics including explosions works ok.

Any recent changes in exe file ? I am using latest night builds.

EDIT

That is strange

Inside main rule file

  - type: Projectiles
    width: 105
    height: 33
    subX: 3
    subY: 3
    files:
      0: Resources/BulletSprites/BulletSprites.png   

Inside item file

  - type: Projectiles
    width: 105
    height: 45
    subX: 3
    subY: 3
    files:
      385: Resources/BulletSprites/BulletSprites2.png 

This is the only way it works. Is there a limit how many sprites can be loaded in single png file ?
« Last Edit: November 29, 2014, 03:21:10 pm by bladum »

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: bug when running mod from main rule file
« Reply #6 on: November 29, 2014, 05:37:47 pm »
Sounds like you're still trying to make multiple .rul files that depend on each other. Don't.
You can split IF the parts can work independantly from each other.
ie playing with just part1 makes sense, and playing with just part2 makes sense too.

Offline bladum

  • Colonel
  • ****
  • Posts: 213
  • Bladum
    • View Profile
Re: bug when running mod from main rule file
« Reply #7 on: December 01, 2014, 12:23:46 pm »
thanks for help