Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 Modding, Customising, Editing » Modding Weapons In Game. (SOLVED, basically)
Modding Weapons In Game. (SOLVED, basically)[message #365975] Wed, 20 March 2024 10:58 Go to next message
Marcus is currently offline Marcus

 
Messages:123
Registered:November 2014
A: AFAIK I need images for BigItems folder, I need to edit MDGUNS.sti, SDGUNS.sti, Weapons.xml, items.xml. Is there anything else to edit?

B: I Want to add camo jackets and trousers: What abour medium and small .sti? I found mditems 1,2,3. I gave a look with sti-edit and it seems to me they are the files I need. Am I correct?

C: How does the attachment system work for weapons? I don't find it defined in items or weapons.xml. I also want camo jacket and trouser to accept light body armour, How can I make it?

D: Is weapons weight expressed in ounces?

E: A few line in items/weapons .xml I can't get:

usItemClass>2</usItemClass

nasLayoutClass>1</nasLayoutClass

ubClassIndex>1</ubClassIndex

ubWeaponClass>1</ubWeaponClass

ubWeaponType>1</ubWeaponType

IE, how does the game understand that a pistol is a pistol and not a bazooka? Are there lists?

Thanks in advance.

EDIT: In the FAL OSW configuration I found these lines:

<DefaultAttachment>1006</DefaultAttachment>
DefaultAttachment>1011</DefaultAttachment
DefaultAttachment>1746</DefaultAttachment

Are these what I'm looking for?

[Updated on: Sun, 24 March 2024 23:53]

Report message to a moderator

Sergeant
Re: Modding Weapons In Game.[message #365977 is a reply to message #365975] Wed, 20 March 2024 21:52 Go to previous messageGo to next message
Kitty

 
Messages:505
Registered:October 2017
Location: Germany
Ok, some answers that may help


Let's take a look at that FN FAL OSW


a few of its tags in items.xml:


<uiIndex>648</uiIndex>                     unique index number

<usItemClass>2</usItemClass>               item class 2 = Gun

<nasLayoutClass>1</nasLayoutClass>         NAS (NewAttachmentSystem) layout class 1 = weapons

<ubClassIndex>648</ubClassIndex>           index-nr of this item in it's class-specific xml - here it's class 2, a gun, so for this item it's refering to weapons.xml

<ubGraphicNum>181</ubGraphicNum>           index number of the sti-graphic - since it's a gun: BigItems/Gun181.sti and index 181 inside Interface/mdguns.sti and Tilesets/0/smguns.sti

<DefaultAttachment>1006</DefaultAttachment>   the attachments this item comes already be equiped with - item nr of attached item - here 1006 = reflex sight
<DefaultAttachment>1011</DefaultAttachment>   1011 = Foregrip
<DefaultAttachment>1746</DefaultAttachment>   1746 = Folding Stock

so, how did I know the numbers used in <usItemClass> and <nasLayoutClass> ?

there are two ways

first: the xml in TableData/Lookup will tell

or: check it in code itself

the first has a little unsecurity, those might not got updated, so there may be some things missing
code is safer, but Lookup is easier (and in almost all cases totally valid, just felt I should mention it)

ok, now weapons.xml

pretty much the same, check xml in Lookup (or in code) to see what class and type are

<ubClassIndex>648</ubClassIndex> tells us that the FN FAL OSW is at index 648 in weapons.xml (in most cases it's the same as item-index, but maybe not allways)

<ubWeaponClass>3</ubWeaponClass> = Rifle

and specifically

<ubWeaponType>6</ubWeaponType> = Assault Rifle

----
other examples:

Glock 17

class 1 handgun
type 1  pistol

but

Glock 18

class 1 handgun
type 2  machinepistol
----

and attachments.xml

if we search that xml for "648", first we'll see is

<ATTACHMENT>
<attachmentIndex>37</attachmentIndex>
<itemIndex>648</itemIndex>
<APCost>20</APCost>
</ATTACHMENT>

that says that item 37 can be attached at item 648

item 37 is the standard combat knife, it fits the gun as bayonet, same slot where we usually put silencers, barrel extender, etc

and so on

anything in attachments.xml that has <itemIndex>648</itemIndex> will be a possible attachment for that weapon
what that attachment is, that's the number at <attachmentIndex>

if you check the numbers, you'll see those default-attachments from items.xml in there as well

speaking of, you may realise that out of those default attachments there is one that behaves different than the others

it's 1746, the Folding Stock

unlike the other two default attachments, that one is inseperable, kinda like build-in

to solve that mystery, look at 1746 in items.xml

and yes, there's the tag <Inseparable>2</Inseparable>

so what's 2?

here's a comment on that found in code:

UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.  
		      //But now we will make it so that these items can be replaced, but still not removed directly.
		      //0 = removeable (as before)
		      //1 = inseparable (as before)
		      //2 = inseparable, but replaceable
so, this stock is inseperable, until we put something else in there (i.e replace with a retracktable stock, if that's a valid attachment for weapon)


and how does the game know that a silencer goes at front, a foregrip at underbarrel-slot, a scope at top-right slot on top?

that's NAS

the NAS-layout tells what slots are where
and the NAS-attachment class puts stuff in fitting slot

i.e. item 37, the comabt knife has

NAS-layout class 1 = weapon

and

NAS-attachment class 2 = barrel

with NAS-layout weapon, barrel slot is just that, the slot at barrel

-




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

First Sergeant
Re: Modding Weapons In Game.[message #365978 is a reply to message #365977] Wed, 20 March 2024 22:45 Go to previous message
Marcus is currently offline Marcus

 
Messages:123
Registered:November 2014
Oookeey..

I must say there's nothing overcomplicated, just a ginormous amount of work.

Anyway, you also just told me how to handle my camo stuff, thanks! Now, more questions:

F: Most impotant, are empty slots allowed in the game files? I.E, can I jump from item 650 to 670 in any given list? I got this feeling in the xml's I edited, but i want to be sure.

G: If it's so, deleting an item from the lists deletes it from the game? Is it so simple?

Thanks again Kitty.

UPDATE:
After going on a modelling spree and producing some 45 weapons (many are variants of the same) I managed to get ridd of original stuff without crashing the game: Set the coolnedd to 0 (zero). Deleting items or setting their other stats to 0 crashes the game. This is an info I found on this very subforum, but repeating helps. I'll try to mod something in tomorrow, prepare for more questions.. Have a nice week everybody.

[Updated on: Sun, 24 March 2024 23:59]

Report message to a moderator

Sergeant
Previous Topic: New weapons sprites (SOLVED)
Next Topic: MDGuns and SMGuns (More workarounded than SOLVED, but..)
Goto Forum:
  


Current Time: Fri Jun 12 21:46:11 GMT+3 2026

Total time taken to generate the page: 0.00640 seconds