OpenXcom Forum
Modding => Work In Progress => Topic started by: Align on July 23, 2013, 03:40:48 pm
-
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...
-
Not without putting it in the original ruleset, as the game uses the ruleset ordering.
-
Ah. That was pretty easy to fix then, just have options.cfg load mine first, then the standard, then mine again!
-
Couldn't this use the same listordering numbers that Warboy used for the inventory layout?
-
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.
-
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.
-
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 :)
-
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.
-
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
- type: STR_PLASMA_BEAM_UC
and add
clip: STR_PLASMA_BEAM_AMMO
Some 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
- type: STR_PLASMA_BEAM_AMMO
size: 0.1
costSell: 13300
transferTime: 48
And finally, under manufacture, add
- 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
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.
-
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.
-
Hm, makes it a little difficult to do via ruleset... In this case it was the craft plasma beam, not the heavy plasma rifle.
-
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
-
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.
-
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.
-
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.
-
Is there any way we can get a listing of all the "LISTORDER" positions for modding?
-
Bump.
Is there any way we can get a listing of all the "LISTORDER" positions for modding?
I second that, since it's often necessary to know where's what to give a listOrder to something you created.