Author Topic: Assault Carbine help  (Read 4356 times)

Offline The Think Tank

  • Captain
  • ***
  • Posts: 80
  • "If we can't see them, they can't see us!" - Rook
    • View Profile
Assault Carbine help
« on: April 11, 2015, 04:20:38 am »
Greetings all! As my first time on this forum, and my first time modding, I apologize for any things I do that may seem...stupid. I have been trying to implement a Assault Carbine to go along with my many other mods I have installed from this wonderful community, however, after much work was done I received a Illegal Map Value notice on line 45 of my code.
If anyone can show me a fix, it would be greatly appreciated.
Code: [Select]
- type: STR_ASSAULT_CARBINE
   listOrder: 2899
   size: 0.2
   costBuy: 2150
   costSell: 2250
   weight: 4
   bigSprite: 301
   floorSprite: 302
   handSprite: 305
   bulletSprite: 2
   fireSound: 82
   compatibleAmmo:
      - STR_ASSAULT_CARBINE_CLIP
   accuracyAuto: 82
   accuracySnap: 88
   accuracyAimed: 98
   tuAuto: 30
   tuSnap: 20
   tuAimed: 25
   battleType: 1
   twoHanded: false
   invWidth: 1
   invHeight: 3
   maxRange: 200
   aimRange: 35
   snapRange: 30
   autoRange: 25
   minRange: 1
   dropoff: 2
   autoShots: 8
   type:- STR_ASSAULT_CARBINE_CLIP
    listOrder:2901
    size:0.1
    costBuy:200
    costSell:150
    weight:0.5
    bigSprite:303
    floorSprite:304   
    hitSound:22
    hitAnimation:26
    power:54
    damageType:1
    clipSize:32
    battleType:2
    ufopaedia:
  - id: STR_ASSAULT_CARBINE
    type_id: 1
    section: STR_WEAPONS_AND_EQUIPMENT
    text: STR_ASSAULT_CARBINE_UFOPEDIA
    listOrder:2901
    STR_ASSAULT_CARBINE_UFOPEDIA: This weapon is still being tested
Now, this is actually an earlier build with a few more errors, so if anyone can help me finish this I would be very grateful. ;)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Assault Carbine help
« Reply #1 on: April 11, 2015, 04:42:49 am »
Code: [Select]
type:- STR_ASSAULT_CARBINE_CLIPfor one thing

and then the indentation is all messed up beyond that, be careful with your spacing.
also you need to put extra strings in an extraStrings section.

Offline The Think Tank

  • Captain
  • ***
  • Posts: 80
  • "If we can't see them, they can't see us!" - Rook
    • View Profile
Re: Assault Carbine help
« Reply #2 on: April 12, 2015, 01:57:46 am »
I have fixed all of that, however, whenever I try to run it, it gets hung up on line 45 (or the one with ufopaedia: )
Its always saying illegal map value...

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Assault Carbine help
« Reply #3 on: April 12, 2015, 02:33:30 am »
remove all the spaces before "ufopaedia:"
then insert:
Code: [Select]
extraStrings:
  - type: en-US
    strings:
between lines 50 and 51, then add two more spaces before "STR_ASSAULT_RIFLE_UFOPAEDIA:"

Offline The Think Tank

  • Captain
  • ***
  • Posts: 80
  • "If we can't see them, they can't see us!" - Rook
    • View Profile
Re: Assault Carbine help
« Reply #4 on: April 12, 2015, 05:16:14 am »
Ok, so before you replied I did some editing, to the point where it no longer shows the mod error when starting up the game, however, I cannot find the weapon anywhere, whether on the UFOpedia nor on the store. I am assuming there are some things I am missing (or coded wrong)
Here is the updated stuff
Code: [Select]
- type: STR_ASSAULT_CARBINE
   listOrder: 2899
   size: 0.2
   costBuy: 2150
   costSell: 2250
   weight: 4
   bigSprite: 301
   floorSprite: 302
   handSprite: 305
   bulletSprite: 2
   fireSound: 82
   compatibleAmmo:
      - STR_ASSAULT_CARBINE_CLIP
   accuracyAuto: 82
   accuracySnap: 88
   accuracyAimed: 98
   tuAuto: 30
   tuSnap: 20
   tuAimed: 25
   battleType: 1
   twoHanded: false
   invWidth: 1
   invHeight: 3
   maxRange: 200
   aimRange: 35
   snapRange: 30
   autoRange: 25
   minRange: 1
   dropoff: 2
   autoShots: 8
   type: STR_ASSAULT_CARBINE_CLIP
   listOrder: 2901
   size: 0.1
   costBuy: 200
   costSell: 150
   weight: 0.5
   bigSprite: 303
   floorSprite: 304   
   hitSound: 22
   hitAnimation: 26
   power: 54
   damageType: 1
   clipSize: 32
   battleType: 2
ufopaedia:
 - id: STR_ASSAULT_CARBINE
   type_id: 4
   section: STR_WEAPONS_AND_EQUIPMENT
   text: STR_ASSAULT_CARBINE_UFOPEDIA
   listOrder:2901
extraSprites
 - type: BIGOBS.PCK
   files:
     10: C:\OpenXcom\data\Resources\Assault_Carbine\Assault_Carbine.GIF
20: C:\OpenXcom\data\Resources\Assault_Carbine\Assault_Carbine_Clip.GIF
 - type: FLOOROBS.PCK
   files:
     30: C:\OpenXcom\data\Resources\Assault_Carbine\Assault_Carbinef.GIF
40: C:\OpenXcom\data\Resources\Assault_Carbine\Assault_Carbine_Clipf.GIF
 - type: HANDOB.PCK
   files:
     50: C:\OpenXcom\data\Resources\Assault_Carbine\HANDOB_Assaul_Carbine.PNG   
extraStrings
 - type: en-US
   strings:
     STR_ASSAULT_CARBINE: Assault Carbine
     STR_ASSAULT_CARBINE: This weapon was created out of a joint project between Heckler & Koch and Colt to supplement the incredibly effective assault rifles on the main battlefield. Designed as a lighter weapon with a higher rate of fire, this weapon can provide a tremendous 1,200 rounds per minute.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Assault Carbine help
« Reply #5 on: April 12, 2015, 06:12:36 am »
Code: [Select]
items:
  - type: STR_ASSAULT_CARBINE
    listOrder: 2899
    size: 0.2
    costBuy: 2150
    costSell: 2250
    weight: 4
    bigSprite: 57
    floorSprite: 73
    handSprite: 128
    bulletSprite: 2
    fireSound: 4
    compatibleAmmo:
      - STR_ASSAULT_CARBINE_CLIP
    accuracyAuto: 82
    accuracySnap: 88
    accuracyAimed: 98
    tuAuto: 30
    tuSnap: 20
    tuAimed: 25
    battleType: 1
    twoHanded: false
    invWidth: 1
    invHeight: 3
    maxRange: 200
    aimRange: 35
    snapRange: 30
    autoRange: 25
    minRange: 1
    dropoff: 2
    autoShots: 8
  - type: STR_ASSAULT_CARBINE_CLIP
    listOrder: 2901
    size: 0.1
    costBuy: 200
    costSell: 150
    weight: 0.5
    bigSprite: 58
    floorSprite: 74   
    hitSound: 22
    hitAnimation: 26
    power: 54
    damageType: 1
    clipSize: 32
    battleType: 2
ufopaedia:
  - id: STR_ASSAULT_CARBINE
    type_id: 4
    section: STR_WEAPONS_AND_EQUIPMENT
    text: STR_ASSAULT_CARBINE_UFOPEDIA
    listOrder: 2901
  - id: STR_ASSAULT_CARBINE_CLIP
    type_id: 4
    section: STR_NOT_AVAILABLE
extraSprites:
  - type: BIGOBS.PCK
    width: 32
    height: 48
    files:
      57: Resources/Assault_Carbine/Assault_Carbine.GIF
      58: Resources/Assault_Carbine/Assault_Carbine_Clip.GIF
  - type: FLOOROBS.PCK
    width: 32
    height: 40
    files:
      72: Resources/Assault_Carbine/Assault_Carbinef.GIF
      73: Resources/Assault_Carbine/Assault_Carbine_Clipf.GIF
  - type: HANDOB.PCK
    width: 256
    height: 40
    subX: 32
    subY: 40
    files:
      128: Resources/Assault_Carbine/HANDOB_Assaul_Carbine.PNG   
extraStrings:
  - type: en-US
    strings:
      STR_ASSAULT_CARBINE: "Assault Carbine"
      STR_ASSAULT_CARBINE_UFOPEDIA: "This weapon was created out of a joint project between Heckler & Koch and Colt to supplement the incredibly effective assault rifles on the main battlefield. Designed as a lighter weapon with a higher rate of fire, this weapon can provide a tremendous 1,200 rounds per minute."


no need to include the full path for your extrasprites, use / instead of \ in paths, be careful with your indentation, don't use tabs, be mindful of the numbers you use for things like bigobs and handobs, as they are very precisely ordered, and must reference sprites that actually exist, wrap your extrastrings in quotes and make sure you define ufopaedia articles for your ammo.
i'd suggest grabbing a mod that does _basically_ what you want to do, as a starting point, and learn from there.
« Last Edit: April 12, 2015, 06:25:42 am by Warboy1982 »