aliens

Author Topic: [Solved] (OXCE) Error when loading custom bullet sprites?  (Read 2002 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
[Solved] (OXCE) Error when loading custom bullet sprites?
« on: October 23, 2019, 07:37:28 am »
I'm trying to add custom bullet sprites however I'm encountering an error when starting OXCE.

So far I've added the images to the extraSprites: section and that appears to load without displaying an error. However when I assign the index for bulletSprite: in the items: section I get the following error:

Quote
"ERROR: failed to load 'Bullet Example'; mod disabled
Error for 'STR_EXAMPLE_WEAPON': offset '875' exceeds mod size limit 57 in set 'Projectiles'

Here is the code for the extraSprites: section:
Code: [Select]
extraSprites:
  - type: Projectiles
    height: 3
    width: 65
    subX: 3
    subY: 3
    files:
      385: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      420: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      455: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      490: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      525: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      595: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      630: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      665: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      700: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      735: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      770: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      805: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      840: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      875: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png



Here is the code for the items: section:
Code: [Select]
items:
  - type: STR_EXAMPLE_WEAPON
    size: 0.2
    costSell: 36900
    weight: 8
    bigSprite: 1
    floorSprite: 1
    handSprite: 0
    bulletSprite: 875
    fireSound: 1
    hitSound: 1
    hitAnimation: 1
    power: 60
    damageType: 4
    accuracyAuto: 46
    accuracySnap: 65
    accuracyAimed: 100
    tuAuto: 34
    tuSnap: 25
    tuAimed: 50
    clipSize: -1
    battleType: 1
    twoHanded: true
    invWidth: 1
    invHeight: 3
    attraction: 9
    listOrder: 3725

I'll also attach to this post a small example mod containing the above code that reproduces the error message.
« Last Edit: February 11, 2023, 07:08:24 pm by Meridian »

Offline Nord

  • Commander
  • *****
  • Posts: 1625
  • The Gate is open.
    • View Profile
Re: (OXCE) Error when loading custom bullet sprites?
« Reply #1 on: October 23, 2019, 04:03:23 pm »

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: (OXCE) Error when loading custom bullet sprites?
« Reply #2 on: October 23, 2019, 11:30:11 pm »
Thank you Nord that solved it.

I got tripped up because HandObs image sets are handled differently.

So basically although the Projectiles sprite sets in extraSprites: are indexed in multiples of 35 the items: bulletSprite: value must be the Projectiles sprite set index divided by 35.

Example: If you want to use the sprite set "875: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png" the value that bulletSprite: in the items: section should be set to is bulletSprite: 25 not 875.

Code: [Select]
extraSprites:
  - type: Projectiles
    height: 3
    width: 65
    subX: 3
    subY: 3
    files:
      385: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      420: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      455: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      490: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      525: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      595: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      630: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      665: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      700: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      735: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      770: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      805: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      840: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      875: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
Code: [Select]
items:
  - type: STR_EXAMPLE_WEAPON
    size: 0.2
    costSell: 36900
    weight: 8
    bigSprite: 1
    floorSprite: 1
    handSprite: 0
    bulletSprite: 25
    fireSound: 1
    hitSound: 1
    hitAnimation: 1
    power: 60
    damageType: 4
    accuracyAuto: 46
    accuracySnap: 65
    accuracyAimed: 100
    tuAuto: 34
    tuSnap: 25
    tuAimed: 50
    clipSize: -1
    battleType: 1
    twoHanded: true
    invWidth: 1
    invHeight: 3
    attraction: 9
    listOrder: 3725