OpenXcom Forum

Modding => OpenXcom Extended => OXCE Support => Topic started by: The Martian on October 23, 2019, 07:37:28 am

Title: [Solved] (OXCE) Error when loading custom bullet sprites?
Post by: The Martian 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.
Title: Re: (OXCE) Error when loading custom bullet sprites?
Post by: Nord on October 23, 2019, 04:03:23 pm
Bulletsprite must be divided by 35.
Look here: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom) (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom))
Title: Re: (OXCE) Error when loading custom bullet sprites?
Post by: The Martian 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