Making New Weapons (Melee, Guns w/ Ammo)??

4 posts / 0 new
Last post
Making New Weapons (Melee, Guns w/ Ammo)??

I'm kinda interested (seeing how the code looks) in the .xml file to try and start modding. It looks simple, but I'm wondering how to add new weapons (Melee, Ranged (and with ammo)?

Thank you :>


I'm busy making a makeshift Laser Rifle

Spoiler: Highlight to view

I'll post a short tutorial if/when I get it working :) unless someone beats me too it :D less work then haha


Short Tutorial for making your own Ranged weapon

firstly you gotta copy/paste a itemtype to work from, I copied the code from the perferator shotgun and worked from there...

Spoiler: Highlight to view
<table name="itemtypes"> <column name="id">417</column> <column name="nGroupID">60</column> <column name="nSubgroupID">11</column> <column name="strName">rifle</column> <column name="strDesc">makeshift laser rifle</column> <column name="strDescAlt">Makeshift Laser Rifle</column> <column name="nCondID">87</column> <column name="vImageList">ItmMakeshiftLaserRifleStored.png,ItmMakeshiftLaserRifleHeld.png</column> <column name="vSpriteList">20=CreItmSBS4HeldL.png,21=CreItmSBS4HeldR.png</column> <column name="vImageUsage">0,0,0,0,1,1</column> <column name="fWeight">2.5</column> <column name="fMonetaryValue">250</column> <column name="fMonetaryValueAlt">250</column> <column name="fDurability">1</column> <column name="fDegradePerHour">0</column> <column name="fEquipDegradePerHour">0.001</column> <column name="fDegradePerUse">0.02</column> <column name="vDegradeTreasureIDs">35,35</column> <column name="aEquipConditions"></column> <column name="aPossessConditions"></column> <column name="aUseConditions"></column> <column name="aCapacities">2x2</column> <column name="vEquipSlots">21=1=1,20=1=1</column> <column name="vUseSlots"></column> <column name="bSocketLocked">0</column> <column name="vProperties">17,28,48,50,75,84</column> <column name="aContentIDs">25</column> <column name="nFormatID">3</column> <column name="nTreasureID">583</column> <column name="nComponentID">3</column> <column name="bMirrored">0</column> <column name="nSlotDepth">0</column> <column name="strChargeProfiles"></column> <column name="aAttackModes">20=[color=blue]59[/color],20=6,21=[color=blue]59[/color],21=6</column> <column name="nStackLimit">1</column> <column name="aSwitchIDs"></column> </table>

For a description of most of the values look here : (I'll leave out the really really self-explanatory ones or the ones I have no idea what they do but hope they don't really do anything important)

Spoiler: Highlight to view
nGroupID is the value of the category of the item, in my example, 60 is the rifles category
nSubGroupID is the value of the item within the category, I used 11 because it was the next available/free number. If I add another itemtype, I would use 12.
strName is the title of your object
strDesc is the description of your object
strAlt is the alternate? description of your object
nCondID is the condition that affects this object, in my example, 87 will give you a range bonus IF you have the Ranged skill

vImageList here you will list the images you're working with and seperate them with commas
vSpriteList here you list images and tell the game where to use them on the hex movement screen. if you're holding the weapon in your left hand 20 will show the CreItmSBS4HeldL.png sprite/image alternatively if in the right hand 21 will show CreItmSBS4HeldR.png

vImageUsage here I'm not really sure what goes on, but its really important to match the image size with the values here, (thanks to Kaaven for spotting that!) If you are like me and use the perferator shotgun images to create new images then you would use 0,0,0,0,1,1. Otherwise be sure to check the value of the weapon you're "cloning" for reference.

aCapacities is the size of your "ammo container" is, my rifle uses a laptop battery for ammo, which is 2x2 blocks
vEquipSlots is another important one, and is directly affected by vImageUsage, since I went with 0,0,0,0,1,1 I have to use 21=1=1,20=1=1, if I had 0,0,0,0,2,2, I would have to use 21=2=2,20=2=2

vProperties are just the properties of your object, if it's waterproof, flammable, large, etc etc
aContentIDs refers to your container type of your "ammo container". Since I use laptop battery I have to use it's containertype ID here which is 25.

nTreasureID here refers to a treasuretable ID which has the ammo of weapon

And finally aAttackModes refers to attack modes you can toggle between 20 is when in the left hand, 21 is when in the right hand. These 2 values can have multiple IDs to attackmodes.

Then next thing you're going to need for your weapon an attack mode, you can use exsisting attack modes or copy/paste and alter one to make your own like I did : Also be sure to update the ID in your itemtype so it uses your new attack mode

Spoiler: Highlight to view
<table name="attackmodes"> <column name="id">[color=blue]59[/color]</column> <column name="strName">Makeshift Laser Rifle Shot</column> <column name="nRange">80</column> <column name="fDamageCut">0.8</column> <column name="fDamageBlunt">0.2</column> <column name="strChargeProfiles">[color=green]32[/color]</column> <column name="nPenetration">1</column> <column name="nType">1</column> <column name="strSnd">cueLaser</column> <column name="bTransfer">0</column> <column name="vAttackerConditions">211x1.0</column> <column name="strIMG">AModeMakeshiftLaserRifle.png</column> <column name="fMorale">0.6</column> <column name="strWieldPhrase"></column> <column name="vAttackPhrases"></column> </table>

Everything in attack mode table looks pretty straight-forward but since I use charged ammos, I have to include a chargeprofile, mine is 32 :

Spoiler: Highlight to view
<table name="chargeprofiles"> <column name="nID">[color=green]32[/color]</column> <column name="strName">Makeshift Laser Rifle</column> <column name="strItemID">10.3</column> [color=lightgreen]<--- make sure this is 10.3 (Not sure what it does/is but I'll update later)[/color] <column name="nPerUse">10</column> <column name="nPerHour">0</column> <column name="nPerHourEquipped">0</column> <column name="nPerHex">0</column> </table>

Here you just change it as appropriate, you tell the game what kind of object you using in the strItemID. I'm using the Laptop battery so my ID and subgroup number is 33.2.

Lastly, you need to create a treasure table for your ammo :

Spoiler: Highlight to view
<table name="treasuretable"> <column name="id">583</column> <column name="strName">Makeshift Laser Rifle Contents</column> <column name="aTreasures">33.2x1x1</column> <column name="bNested">1</column> <column name="bSuppress">1</column> <column name="bIdentify">1</column> </table>

If you go right back to our itemtype at the top, you'll see that I made sure to use the new treasuretable ID in nTreasureID.

And that does it, if I'm not mistaken it should work, unless I've forgotten something, which is likely ;D

Be sure to check out my Makeshift Laser Rifle Mod here

or for more information on creating crafting recipes for your new monster weapon go here

Hope this helps! happy modding :)


Added to the Little Book of Modding Lore (Patent Pending)

Why do you have to to this and how do I determine mine? <column name="aTreasures">33.2x1x1</column>

I typed ze wrong name :( lol. I wanted sanjrang.