aliens

Author Topic: Can I change the position of an item in the Manufacture menu?  (Read 12484 times)

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
I've added an ammunition requirement to the Plasma Cannon, but while the cannon is at the top of the list of manufacturable items, the ammo is at the bottom...

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #1 on: July 23, 2013, 05:59:20 pm »
Not without putting it in the original ruleset, as the game uses the ruleset ordering.

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #2 on: July 23, 2013, 06:06:07 pm »
Ah. That was pretty easy to fix then, just have options.cfg load mine first, then the standard, then mine again!

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: Can I change the position of an item in the Manufacture menu?
« Reply #3 on: July 23, 2013, 06:11:34 pm »
Couldn't this use the same listordering numbers that Warboy used for the inventory layout?

Offline Phezzan

  • Sergeant
  • **
  • Posts: 37
  • Twilight
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #4 on: July 24, 2013, 05:21:51 am »
Yes. I did that.

You can either force a thing down with a high ListOrder or (I believe) there is enough space between each item for 9 new items.

I've done both - but admittedly I magnified the modOrder increment by 10 out of the fear that the number of Xcom1Ruleset items puts the later stuff in the range of the first mod.

I might not fully understand that order generator though.

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #5 on: July 24, 2013, 05:23:31 am »
I've added an ammunition requirement to the Plasma Cannon, but while the cannon is at the top of the list of manufacturable items, the ammo is at the bottom...

Can you share the code to make the ammo?  Want to see if I can do something similar for the Hovertank/Plasma.

Thanks.

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #6 on: July 24, 2013, 08:01:09 am »
there is no actual code per se, all this is done via the ruleset for example, i am adding a grenade launcher to the game

  - type: STR_GRENADE_LAUNCHER
    size: 0.2
    costBuy: 3000
    costSell: 2250
    weight: 8
    bigSprite: 111
    floorSprite: 1
    handSprite: 0
    bulletSprite: 2
    fireSound: 4
    compatibleAmmo:
      - STR_GL_EXPLOSIVE
      - STR_GL_SMOKE
      - STR_GL_INCENDIARY
      - STR_GL_STUN_GAS
    accuracyAuto: 35
    accuracySnap: 60
    accuracyAimed: 110
    tuAuto: 35
    tuSnap: 25
    tuAimed: 80
    battleType: 1
    twoHanded: true
    invWidth: 1
    invHeight: 3
    armor: 20

that is my definition to the actual weapon stating that it has multiple ammo types
and then i have this

  - type: STR_GL_EXPLOSIVE
    size: 0.1
    costBuy: 200
    costSell: 150
    weight: 3
    bigSprite: 112
    floorSprite: 2
    hitSound: 22
    hitAnimation: 26
    power: 30
    damageType: 3
    clipSize: 20
    battleType: 2
    armor: 20

and that defines one of my ammo types, of course if you do this then you have to make sure that this items are available in the ufopedia
at that time you coudl add something like this
  - id: STR_GRENADE_LAUNCHER
    type_id: 4
    section: STR_WEAPONS_AND_EQUIPMENT
    text: STR_GRENADE_LAUNCHER_UFOPEDIA

in this case i have put the item under weapons and equipment and linked the fluff text with STR_GRENADE_LAUNCHER_UFOPEDIA

if you do not want the item to show in the UFOPEDIA then you do something like this

  - id: STR_GL_EXPLOSIVE
    type_id: 4
    section: STR_NOT_AVAILABLE
in this case i have said that my explosive ammo for the grenade launcher has no specific article in the UFOPEDIA

then you go to the language file and add something like this

STR_GRENADE_LAUNCHER
Grenade Launcher
STR_GRENADE_LAUNCHER_UFOPEDIA
This grenade launcher is awesome because i did it, nothing can bit it and it will hit anything with in a mile radius, and it has a blast radius of 2 miles and carries a shit load of ammo types... etc.

I hope that helps a little :)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #7 on: July 24, 2013, 12:37:54 pm »
listOrder dictates where the item appears in lists.

heavy plasma is 5000, the clip is 5100. if you want it below the weapon, set it to 5000-5099, if you want it to appear after the default clip, set it to 5100-5199.

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #8 on: July 24, 2013, 12:43:18 pm »
listOrder dictates where the item appears in lists.
Doesn't seem to be in the ruleset anymore; it's mentioned in a comment, but not defined for any item there.



Can you share the code to make the ammo?  Want to see if I can do something similar for the Hovertank/Plasma.

Thanks.
Yeah, it's just ruleset editing. Under craftWeapons, find
Code: [Select]
- type: STR_PLASMA_BEAM_UCand add
Code: [Select]
clip: STR_PLASMA_BEAM_AMMOSome other changes might also be appropriate, like maxAmmo and rearmRate, unless you don't mind paying one Elerium per shot and 200 Elerium to fill it up the first time.

Then, under items, add
Code: [Select]
  - type: STR_PLASMA_BEAM_AMMO
    size: 0.1
    costSell: 13300
    transferTime: 48

And finally, under manufacture, add
Code: [Select]
  - name: STR_PLASMA_BEAM_AMMO
    category: STR_CRAFT_AMMUNITION
    requires:
      - STR_PLASMA_CANNON
    space: 4
    time: 100
    cost: 8000
    requiredItems:
      STR_ELERIUM_115: 1

If you want it to display prettily, tack on
Code: [Select]
extraStrings:
  - type: English
    strings:
      STR_PLASMA_BEAM_AMMO: Plasma Beam Ammo
right at the end of the ruleset.

Attached file contains a bunch of other changes as well, so use caution.
« Last Edit: July 24, 2013, 12:47:21 pm by Align »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #9 on: July 24, 2013, 01:33:02 pm »
Doesn't seem to be in the ruleset anymore; it's mentioned in a comment, but not defined for any item there.

never was in the ruleset, hence the comment.
by default it increments the listOrder by 100.

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #10 on: July 24, 2013, 10:11:32 pm »
Hm, makes it a little difficult to do via ruleset... In this case it was the craft plasma beam, not the heavy plasma rifle.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #11 on: July 25, 2013, 12:53:40 am »
oh, sorry, manufacture... that's a seperate list.

in the manufacture list, the heavy plasma has a listOrder of 1400, and the cannon is 200

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #12 on: July 25, 2013, 02:45:46 am »
Yeah, it's just ruleset editing. Under craftWeapons, find

Thanks for all for the help.  Yeah, when I said "code" I actually meant ruleset editing.

I think I might be trying to do something that can't be done.  I've successfully modded the Plasma Cannon to use Elerium to recharge.  To be internally consistent, I was also hoping to make the Hovercraft/Plasma use Elerium to power to cannon.  Is there a way to produce multiple "shells" at a time.  I was thinking like the aircraft Cannon which each purchase equates to 50 rounds.  I think I can set it up so each Elerium is the "shells" for the weapon, but 1 Elerium for each shot is way too much imo.  So, I was hoping there was another way to do it, like being able to make 5 or 10 rounds for the 1 Elerium cost or something similar.  But, I'm thinking the craft weapons work differently than the hovertanks, so maybe it's not possible without editing the program code, which I wouldn't want to do even if I could.  Any idea if this is possible somehow, or at least achieving this effect?  Can you build a "clip" for the hovertank which then gives 20-30 shots?

Thanks again for the help.

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #13 on: July 25, 2013, 01:16:40 pm »
I don't think tank weapons are handled differently from infantry weapons, and Plasma Rifle clips cost 2 elerium but give 28 shots, so it should be pretty easy to copy and change a few lines.

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Re: Can I change the position of an item in the Manufacture menu?
« Reply #14 on: July 27, 2013, 09:55:01 pm »
I don't think tank weapons are handled differently from infantry weapons, and Plasma Rifle clips cost 2 elerium but give 28 shots, so it should be pretty easy to copy and change a few lines.

Thanks, but I can't get it to work.  I can change the clip size, but no matter what clip size, it uses a 1-1 relationship for shots and ammo.  Unless there's a way to make multiple shells for 1 "build", like with the Craft Cannon which uses a reload mechanism not found with the HWPs, then I don't see how to make it work.