Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » All about modding JA2 » Too many items for an attachment?
Too many items for an attachment?[message #351760] Mon, 25 December 2017 04:54 Go to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Is there a limit to how many items a single attachment can be assigned to in Attachments.xml? Specifically, I am having a problem where all recently new weapons I have made that are assigned a Rifle Sling as an attachment do not allow the Rifle Sling to be attached even though the weapon's attachment box (in-game) indicates a Rifle Sling is attachable in that box. The past few days I've been trying to find out why, but I am stumped.

Report message to a moderator

Sergeant Major
Re: Too many items for an attachment?[message #351761 is a reply to message #351760] Mon, 25 December 2017 05:03 Go to previous messageGo to next message
Deleted.

 
Messages:2657
Registered:December 2012
Location: Russian Federation
You can define attachment point for Rifle Sling, it should work well.


Left this community.

Report message to a moderator

Lieutenant

Re: Too many items for an attachment?[message #351763 is a reply to message #351761] Mon, 25 December 2017 05:17 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:

You can define attachment point for Rifle Sling, it should work well.


I have not read up on that system yet. Can you point me to a description of how the system works and what the attachment tags are? After this release of AV I plan on re-working the attachment system to this newer one, but as of now I don't have a clue on how to implement it.

Report message to a moderator

Sergeant Major
Re: Too many items for an attachment?[message #351766 is a reply to message #351763] Mon, 25 December 2017 05:46 Go to previous messageGo to next message
Deleted.

 
Messages:2657
Registered:December 2012
Location: Russian Federation
edmortimer wrote on Mon, 25 December 2017 08:17
Quote:

You can define attachment point for Rifle Sling, it should work well.


I have not read up on that system yet. Can you point me to a description of how the system works and what the attachment tags are? After this release of AV I plan on re-working the attachment system to this newer one, but as of now I don't have a clue on how to implement it.

You simply define attachment point which is actually a bitmask, for example possible attachment points in VR (it's just a list for convenience, you don't need to define it anywhere):
Toggle Spoiler

Add this point to Items.xml:
Toggle Spoiler

Then define available attachment point for the weapon you want your sling to attach to:
Toggle Spoiler

That's all, as far as I know.
You can also add these points to lookup table if you plan to use XML Editor:
AttachmentPoint.xml:
Toggle Spoiler

You can combine as many available attachment point tags in items.xml entry as you like as they are only combined as a bitmask. Since the value is stored in int64, there can be no more than 64 bits that represent different attachment points, but you can combine several bits together for convenience.
You also don't need to define attachment point for each item, instead you can use it like in real life - if weapon has a rail, any attachment that fits this rail type can be attached here, something like this was implemented in AFS, also SDO mod uses attachment point system.

Also, this code
<!-- Small Molle -->
is just a comment, you can ignore it.

[Updated on: Mon, 25 December 2017 05:52]




Left this community.

Report message to a moderator

Lieutenant

Re: Too many items for an attachment?[message #351770 is a reply to message #351766] Mon, 25 December 2017 06:14 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Thank you! happy That works -- and doesn't seem to break anything else!

Report message to a moderator

Sergeant Major
Re: Too many items for an attachment?[message #361403 is a reply to message #351770] Tue, 29 September 2020 14:44 Go to previous messageGo to next message
rattus is currently offline rattus

 
Messages:33
Registered:March 2003
Trying to add ZF-42 scope to MG3. I can get the slot to be clear and for it to say that ZF-42 can be attached but when I try to attacvh it i get a message saying it can't be attached. I've obviously missed something but can';t figure it out - Help would be much appreciated.add (for

Report message to a moderator

Private 1st Class
Re: Too many items for an attachment?[message #361404 is a reply to message #361403] Tue, 29 September 2020 15:33 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:
Trying to add ZF-42 scope to MG3. I can get the slot to be clear and for it to say that ZF-42 can be attached but when I try to attacvh it i get a message saying it can't be attached. I've obviously missed something but can';t figure it out - Help would be much appreciated.

How did you do it? Old system or new? Did you start a fresh, new game? - I know, really frustrating to have to start a new game every time you change something in attachments, and not use any map-editor placed items to test with, but I must have restarted this game a million times just to check a new modification.

Report message to a moderator

Sergeant Major
Re: Too many items for an attachment?[message #361405 is a reply to message #361404] Tue, 29 September 2020 17:31 Go to previous messageGo to next message
Kurt is currently offline Kurt

 
Messages:420
Registered:March 2004
Sorry to barge in, but in my own (limited) experience editing Attachments.xml in 8796, and without restarting the game, I sometimes had some newly added attachment refuse to work indeed.

In those cases I quit the game to check my Attachments.xml for errors, usually find none, and lo and behold, when going back to the game the attachment now works - I changed nothing.

My point is that the game mostly accepts new/modified entries in item-related XML files in mid-game, but you sometimes have to insist a little. I didn't manage to detect a pattern (I can make two additions, one works, the other not), all I know is it eventually works.

I'd suggest to quit JA2, restart it and try again.

(Sacrificing a black goat can help, but isn't mandatory)

Report message to a moderator

Master Sergeant
Re: Too many items for an attachment?[message #361407 is a reply to message #361405] Wed, 30 September 2020 15:15 Go to previous messageGo to next message
rattus is currently offline rattus

 
Messages:33
Registered:March 2003
I tried with starting a new game (and edited starting equipment so MG and ZF-42 were available from the start). I'm using the NAS (default settings).
I edited weapons and items XMLs to change descriptions and calibre. Editted magazines and items to ensure that all the ammo types work properly and everything is fine until it gets to adding the sight. I added the attachment point for the ZF-42 to the [MG3] entry in the weapons.xml By default, the MG3 cannot take any optics or sights - only (in the current May 20 build) internals and lasers/LAM. So now the "slot" appears in the weapon display as useable - and the Bobby Rays entry shows ZFG-42 as attachable to the slot. In the game however the attachment is not allowed. I have sacrificed all the neighbour's goats. I wonder if there is an underlying slot-opening entry missing somewhere (I mean, because there is usually no useable slot in the MG3 for optics, then the slot itself requires some other entry somewhere to open it before it is useable in the way I have defined it. I have so far managed to "reverse engineer" things and using what I can find in the forum as a guide but I'm a complete newby as far as modding JA2 is concerned.

Report message to a moderator

Private 1st Class
Re: Too many items for an attachment?[message #361408 is a reply to message #361407] Wed, 30 September 2020 17:38 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:

I tried with starting a new game (and edited starting equipment so MG and ZF-42 were available from the start). I'm using the NAS (default settings).
I edited weapons and items XMLs to change descriptions and calibre. Editted magazines and items to ensure that all the ammo types work properly and everything is fine until it gets to adding the sight. I added the attachment point for the ZF-42 to the [MG3] entry in the weapons.xml By default, the MG3 cannot take any optics or sights - only (in the current May 20 build) internals and lasers/LAM. So now the "slot" appears in the weapon display as useable - and the Bobby Rays entry shows ZFG-42 as attachable to the slot. In the game however the attachment is not allowed. I have sacrificed all the neighbour's goats. I wonder if there is an underlying slot-opening entry missing somewhere (I mean, because there is usually no useable slot in the MG3 for optics, then the slot itself requires some other entry somewhere to open it before it is useable in the way I have defined it. I have so far managed to "reverse engineer" things and using what I can find in the forum as a guide but I'm a complete newby as far as modding JA2 is concerned.
Did you put the <AttachmentPoint> tag on the ZF-42, as well as the <AvailableAttachmentPoint> on the weapon?

Report message to a moderator

Sergeant Major
Re: Too many items for an attachment?[message #361410 is a reply to message #361408] Wed, 30 September 2020 18:38 Go to previous messageGo to next message
Kurt is currently offline Kurt

 
Messages:420
Registered:March 2004
edmortimer wrote on Wed, 30 September 2020 16:38
Did you put the <AttachmentPoint> tag on the ZF-42, as well as the <AvailableAttachmentPoint> on the weapon?

Interesting, I went a different way with my new attachments (all working), apparently the old way:

Edit "Attachments.xml", and add
<ATTACHMENT>
	<attachmentIndex>1180</attachmentIndex>
	<itemIndex>1075</itemIndex>
	<APCost>20</APCost>
</ATTACHMENT>
(where 1180 is the ZF-42 Scope, and 1075 the MG3.)

Attachment points appear all on their own, and as I said above, either it works right from the start, or it just needs a little insisting.

Report message to a moderator

Master Sergeant
Re: Too many items for an attachment?[message #361411 is a reply to message #361410] Wed, 30 September 2020 20:04 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:


edmortimer wrote on Wed, 30 September 2020 16:38

Did you put the <AttachmentPoint> tag on the ZF-42, as well as the <AvailableAttachmentPoint> on the weapon?


Interesting, I went a different way with my new attachments (all working), apparently the old way:

Either way works. The old way bloats the Attachments.XML file if you have a ton of additional weapons & attachments as some mods have, and it slows the game down.

Report message to a moderator

Sergeant Major
Re: Too many items for an attachment?[message #361420 is a reply to message #361411] Thu, 01 October 2020 01:57 Go to previous messageGo to next message
Kurt is currently offline Kurt

 
Messages:420
Registered:March 2004
Sure, it's just I didn't find any clear explanation yet on how to use the new way. (I'm still reading through the forum, there is a lot to catch up on.)

I can definitely see the advantage of not having to make a new entry for every attachment an item can have. On the other hand, the old way is simple and reliable...

Report message to a moderator

Master Sergeant
Re: Too many items for an attachment?[message #361421 is a reply to message #361420] Thu, 01 October 2020 02:31 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:

Sure, it's just I didn't find any clear explanation yet on how to use the new way. (I'm still reading through the forum, there is a lot to catch up on.)

I can definitely see the advantage of not having to make a new entry for every attachment an item can have. On the other hand, the old way is simple and reliable...

I completely agree with you on all points. I had to learn a lot by looking at how similar things were put together and lots of trial & error. I had to convert to the NAS because my Attachments.XML grew too large, and not only was it slowing the qame down but it was causing glitches with the attachments. There is a limit on how big the file can get before it no longer works reliably - for a while I was moving sections to the NAS but also adding new weapons and attachments the old way, and a few times I hit that wall again. So now I've cleared a lot out of Attachments.XML and all new weapons and attachments go to NAS until I hit that limit (10 attachment points max on a weapon).

Report message to a moderator

Sergeant Major
Re: Too many items for an attachment?[message #361429 is a reply to message #361421] Thu, 01 October 2020 15:46 Go to previous messageGo to next message
rattus is currently offline rattus

 
Messages:33
Registered:March 2003
Thanks guys - really appreciated.
I have probably done a bit of both NAS and OAS and hence got neither working!
I had added:
<ATTACHMENT>
<attachmentIndex>1180</attachmentIndex>
<itemIndex>1075</itemIndex>
<APCost>20</APCost>
</ATTACHMENT>
to the end of the attachments.xml - but it is out of sequence at the very end. Don't know if the order is important happy

In the items.xml the ZF-42 (item 1180) has attachmentclass and nasattachmentclass of 16... but I have put the availableattachmentpoint for Item 1075 in the imtems.xml as being 268435456 (which it seems is actually the ?itemclass of the scope.... I guess I should make it 16 instead.

So I'll try this and let you know - now running out of goats but happy to move onto any kind of sacrificial animal if required.

EDIT:

Okay that didn't work... but moving
<ATTACHMENT>
<attachmentIndex>1180</attachmentIndex>
<itemIndex>1075</itemIndex>
<APCost>20</APCost>
</ATTACHMENT>
back into its proper sequence did! Success Comrade!
I would still like to know how/why it didn't work using the NAS method. Should i have defined the attachment point as a "nasAttachmentPoint"?

Regards and thanks

R.

[Updated on: Thu, 01 October 2020 16:14]

Report message to a moderator

Private 1st Class
Re: Too many items for an attachment?[message #361433 is a reply to message #361421] Fri, 02 October 2020 03:29 Go to previous messageGo to next message
Hawkeye is currently offline Hawkeye

 
Messages:2432
Registered:October 2005
Location: Australia
edmortimer wrote on Thu, 01 October 2020 09:31

I completely agree with you on all points. I had to learn a lot by looking at how similar things were put together and lots of trial & error. I had to convert to the NAS because my Attachments.XML grew too large, and not only was it slowing the qame down but it was causing glitches with the attachments. There is a limit on how big the file can get before it no longer works reliably.

Hey Ed, can you remember what the threshold limit was when it started causing problems?

Report message to a moderator

Lieutenant

Re: Too many items for an attachment?[message #361436 is a reply to message #361433] Fri, 02 October 2020 07:18 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:
Hey Ed, can you remember what the threshold limit was when it started causing problems?

Sorry, I did not count the entries and don't remember the line count - my memory is getting poor with age.

Report message to a moderator

Sergeant Major
Re: Too many items for an attachment?[message #361441 is a reply to message #361436] Sat, 03 October 2020 09:51 Go to previous message
Hawkeye is currently offline Hawkeye

 
Messages:2432
Registered:October 2005
Location: Australia
I know that feeling. suprised

Report message to a moderator

Lieutenant

Previous Topic: New Mod Announcment (Tuscany)
Next Topic: Steal Weapons from AIMNAS
Goto Forum:
  


Current Time: Tue Oct 08 18:11:38 GMT+3 2024

Total time taken to generate the page: 0.01302 seconds