Home » MODDING HQ 1.13 » v1.13 Coding Talk » New Attachment System Beta
Re: New Attachment System Beta[message #257345] Sat, 24 July 2010 00:05 Go to previous messageGo to next message
silversurfer

 
Messages:2678
Registered:May 2009
Only LBE gear is in that range except for the Beretta.

Strange, the XML editor crashes when opening that gun. It says that value 366 was out of range. 366 is "ubGraphicNum". It's not out of range and the "gun366.sti" is there and looks fine. :headscratch:

Re: New Attachment System Beta[message #257382] Sat, 24 July 2010 12:44 Go to previous messageGo to next message
spaeR

 
Messages:77
Registered:September 2008
Location: Hungary
THX!

Maybe later Smile?
Re: New Attachment System Beta[message #257580] Mon, 26 July 2010 19:20 Go to previous messageGo to next message
Cr0aker

 
Messages:5
Registered:June 2010
Location: Canada
It's dependent on the developer of the item mod to make it compatible with the new system if they choose to do so. It will require a lot of XML reworking, but it should be simple enough.
Re: New Attachment System Beta[message #257582] Mon, 26 July 2010 19:59 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Upgrading a mod for NAS is relatively straightforward, and from experience less work than setting up attachments one at a time for each item. Attachments go to attachment slots, which in turn go to the item. The problem is the planning and though that needs to go into developing the slots (you want to be able to reuse slots as much as possible, otherwise the previous statement becomes false).

Right now I am preparing a spreadsheet, documenting the nature of attachments to each gun. Two days in and I am still not done. Funny thing is, the more research I do, the less attachments most guns are getting...

One of the things I am planning are Quad Rail kits for the major weapons families, but I am concerned about ease of implementation. How many layers of slot addition is possible?

ie. In the following scenario:
1. a Quad Rail is attached to a M4, the M4 gets a number of new additional slots. (I know this works see 2.)
2. Reflex Scope when attached, gives the weapon an additional special slot for a Reflex Sight. Specifically demonstrated with the last UC-113NAS.

What happens when the Reflex Scope is added to M4 with a Quad Rail already attached? I think it was mentioned that no additional slots will be added, but I want to check before I start any work.

[Updated on: Mon, 26 July 2010 20:12] by Moderator



Re: New Attachment System Beta[message #257585] Mon, 26 July 2010 20:44 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Because the reflex scope is attached to a slot that was not originally on the gun, it should not add slots.
I know this is not perfect, but it gets horribly complicated to allow added slots to add even more slots.
I would not wish to make the already complicated function that handles this that much more complicated, if I can even get it to work.

Maybe someday someone will be able to simplify it to make it work without becoming utterly unreadable.

[Updated on: Mon, 26 July 2010 20:46] by Moderator

Re: New Attachment System Beta[message #257590] Mon, 26 July 2010 21:06 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Thanks WarmSteel, I was thinking that it was not possible, just needed to be sure as part of the pre-XML work. Three item mods, so I want to think this one out before getting into any implementation.

[Updated on: Mon, 26 July 2010 21:08] by Moderator



Re: New Attachment System Beta[message #257690] Tue, 27 July 2010 22:14 Go to previous messageGo to next message
Slax

 
Messages:1437
Registered:July 2006
Location: People riding polar bears...
Would it be possible to add an "inactive" slot to weapons? For storing extra ammo on shotguns and such. The only thing it would count would be the extra weight, naturally.

Re: New Attachment System Beta[message #257695] Tue, 27 July 2010 23:09 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Possibly, but I'm not keen on adding another tag for it, or telling all the functions that check attachments not to check THAT slot.
It would create too much confusion and work just to store an item.
Re: New Attachment System Beta[message #257697] Tue, 27 July 2010 23:16 Go to previous messageGo to next message
Nickfighter

 
Messages:118
Registered:December 2007
Location: Poland
WarmSteel
Possibly, but I'm not keen on adding another tag for it, or telling all the functions that check attachments not to check THAT slot.
It would create too much confusion and work just to store an item.

But it would be nice. Does that not convince you? ;P
Re: New Attachment System Beta[message #257698] Tue, 27 July 2010 23:17 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Sorry, no Razz
Especially because people might change ammo to be like any other attachment.

But suggestions are always welcome ^^
Re: New Attachment System Beta[message #257705] Wed, 28 July 2010 00:18 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
I just finished setting up a spare magazine storage compartment for the DSR-1, benefit of not reading the thread before acting... It works as expected, except for losing one of the three options to reload. With the slot defined, dragging and dropping a magazine into the Interface for the weapon brings up the item details screen instead of simpily reloading. Dropping the magazine on the bullet icon and firing when empty both still work.

Warmsteel, do you want to call the above a "bug," or just another "unintended exploit" like the new mechanism for folding stocks (I also got working earlier today)? The magazine storage slot is not something I'm sure I'm keeping, especially if there is potential to interfere with a superior magazine system.

[Updated on: Wed, 28 July 2010 00:22] by Moderator



Re: New Attachment System Beta[message #257710] Wed, 28 July 2010 01:13 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
It's not really a bug, because I can't make the game know when someone just wants to store an item instead of really using them.
But storing items is fine as long as they don't change the gun stats, since all attachments will be checked for any modifiers for the gun.
Re: New Attachment System Beta[message #257711] Wed, 28 July 2010 01:24 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Looks like it would be better to drop the magazine storage. Main Reason: The CZ-75B is one of the very small number of guns that would have used the system, but if AET or Glaser ammo is loaded and stored, you get twice the reliablity decrease. Conceptually it is even worse if reliability decreasing ammo is in the storage slot but other ammo is loaded (reliability goes down but for no benefit).

By the way, how wide are the attachment slots (in the system used to define the X/Y coordinates in AttachmentSlots.xml? I am wondering if I could fit four attachment slots along the top of the image, but have the two ends aligned with the pictures edge.


Re: New Attachment System Beta[message #257713] Wed, 28 July 2010 01:29 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Everything works in pixels in JA2.
I don't have an STI editor at hand nor do I have the png image around here, so my guess is as good as yours at the moment.

If you have an STI editor you can just look up the attachment STI, copy it to paint and see how large the image is.
Re: New Attachment System Beta[message #257716] Wed, 28 July 2010 02:07 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Ah, I didn't think of that. According to STI-Edit it is 35x27. Using Default Slot 1 as a guide (30/65) the edge of the item graphic is x=65. Now if I wanted to fit four, the last one should be at 205, unless I forgot something, which is good, because the default slot on the right hand side starts at 206.


Re: New Attachment System Beta[message #257748] Wed, 28 July 2010 10:22 Go to previous messageGo to next message
silversurfer

 
Messages:2678
Registered:May 2009
STI Edit says that an small attachment slot (the one on weapons) is 35x27. The big one is 66x27.
Sometimes is looks a bit small though.

edit: I mean the small one. Wink

[Updated on: Wed, 28 July 2010 10:24] by Moderator


Re: New Attachment System Beta[message #257853] Thu, 29 July 2010 10:09 Go to previous messageGo to next message
GeneralArthur

 
Messages:11
Registered:January 2008
Location: Potchefstroom, South Afri...
Warmsteel, brilliant MOD...I had a Elite the other day with 7 attachments on his FN-FAL give me a good royal rodgering!

Thought you'd like to know that the AI uses it as well!
Re: New Attachment System Beta[message #257906] Fri, 30 July 2010 01:35 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Well, I did the math wrong. Four small attachment slots will leak over the edge of the graphic unless each one overlaps a bit. The overlap is displeasing to the eye. On the otherhand, having everying lined up with the left hand edge of the item image looks reasonably good to me. I am anticipating a NAS Beta version of the UC-1.13 Hybrid by this weekend or early next week.


Re: New Attachment System Beta[message #258028] Sat, 31 July 2010 17:05 Go to previous messageGo to next message
spaeR

 
Messages:77
Registered:September 2008
Location: Hungary
Ha!

I play with NAS 0.503b, and why slow down my mercs when eqipped with TIMS Combat Pack (till now just the TIMS Backpack has slow down)!?

THX!
Re: New Attachment System Beta[message #258042] Sat, 31 July 2010 19:07 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
@ spaeR
It doesn't for me, are you aware that different terrain means different moving costs?
Re: New Attachment System Beta[message #258043] Sat, 31 July 2010 19:08 Go to previous messageGo to next message
silversurfer

 
Messages:2678
Registered:May 2009
Are they overloaded or have low stamina or health?

Re: New Attachment System Beta[message #258045] Sat, 31 July 2010 20:03 Go to previous messageGo to next message
spaeR

 
Messages:77
Registered:September 2008
Location: Hungary
WarmSteel

I move, and see the action point, then quickload, drop the TIMS Combat Pack, and less the AP cost (4 point difference every tile)!

silversurfer

I have max health and stamina!

This problem only in NAS beta, in alpha not appear!
Re: New Attachment System Beta[message #258047] Sat, 31 July 2010 20:18 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
That could mean that it's a feature, because the NAS code hasn't changed much, while the underlying code did.
Re: New Attachment System Beta[message #258067] Sun, 01 August 2010 06:05 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Just a note for anyone with grand plans to have plenty of attachment slot adding attachments. Read the readme (30 limit) before defining all the items. Getting a lot of odd behaviour with random attachments adding slots they were not set to add.

EDIT: Actually, I don't think it was me going beyond 30 tags. Removed all tags, except for one that seemed related to the unwanted adding of slots, didn't fix the problem. Reordering the entire entry to the bottom of the entries for that slot however did fix the problem. Is there some kind of ordering that that should be used when slots are being added (ie. do they all have to be the bottom of the list for each slot in a particular order)?

[Updated on: Sun, 01 August 2010 06:58] by Moderator



Re: New Attachment System Beta[message #258074] Sun, 01 August 2010 13:21 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
That's a 30 limit per attachment. Shouldn't really be a problem, right?

And I don't know about any order that should be used there, but if you could send me your xml, with the needed game files of course, I could debug it and see what's happening.

It kind of sounds like a bug to me Smile
Re: New Attachment System Beta[message #258090] Sun, 01 August 2010 17:00 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Right guess I missread the readme, eyes must be going after the last few weeks of on and off data entry in the XML's. The most tags I have per attachment is four (RIS Handguards for AK and AR-15's). Moving the seems to be shifting the problem around as I am seeing worse examples of extra slots beeing added in the form of overlaps. The time an unintended overlap can be detected is when you attach something to the slot and then try to remove it but cannot due to the extra slot. I'm going to add some notation and move the slots back to where they were when the problem was first seen.

Warmsteel, if you are willing to install the v1.13 Combined Folding Stock System Mod then the needed game files amount to something I can attach by email. Otherwise I was planning on doing a standalone release today of UC-1.13NASv2 (you still need the original Urban Chaos files). Still need to get around to documenting the balance changes.

[Updated on: Sun, 01 August 2010 17:03] by Moderator



Re: New Attachment System Beta[message #258091] Sun, 01 August 2010 17:08 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
I'll wait for the new release, then. In the mean time I'll see if I can spot any problems without.
Re: New Attachment System Beta[message #258095] Sun, 01 August 2010 17:39 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
wil473, how would you like the gun picture being moved a little to the left?
It won't be centered anymore, but it will allow for 2 slots next to each other on the right side of the gun.
Now only one slot fits on either side and a lot of space is wasted.
Moving the item pic to the right is possible too, I don't know what's better.
Smeagol thinks to the left is better because the right side can hold more slots closer to the inventory.

Here's an example smeagol made of this:
http://img830.imageshack.us/img830/6347/examplegunbox.gif
http://img818.imageshack.us/img818/3596/newgunbox.gif

[Updated on: Sun, 01 August 2010 18:50] by Moderator

Re: New Attachment System Beta[message #258101] Sun, 01 August 2010 18:53 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Smeagol's graphic looks good. If implemented I would also suggest moving the default slots to block along the right side to echo the classic attachment slots.

I'm moving the attachment slots back into their original order arranged first by and then by 631, documenting the entries that have add/remove slots tags and fixing missing definitions. However in doing so, I will need to do a new test series to generate savegames with specifical incidents of the problem.

I'm not going to bother documenting the new balance as:
1) mostly implemented/documented in the last version of CFSS
2) I haven't implemented the new sound suppressor penalties yet (something I thought of after the discussion on the NAS Beta penalties)

Hopefully I'll have something uploaded to esnips and moddb later today.


Re: New Attachment System Beta[message #258102] Sun, 01 August 2010 18:55 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Quote:
If implemented I would also suggest moving the default slots to block along the right side to echo the classic attachment slots.
Way ahead of you Wink

I've had an idea to improve the way the game determines what slots a gun has.
This is rather complicated but I think I can make it accept the adding of slots even if the attachment is not on one of the basic gun slots.

Just started this though, hope it works out.
Re: New Attachment System Beta[message #258105] Sun, 01 August 2010 19:02 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
As long as I can continue using the "item-merge/but-not-if-it-fits-the-slot" behaviour of the current NAS implementation I'm happy. I use it for more than just folding stocks now, effectively giving weapons additional "modes" of operation (only partially implemented as I haven't figured out how I want to handle shotguns with integral adjustable chokes yet).

[Updated on: Sun, 01 August 2010 19:03] by Moderator



Re: New Attachment System Beta[message #258109] Sun, 01 August 2010 19:51 Go to previous messageGo to next message
smeagol

 
Messages:2732
Registered:June 2008
Location: Bremen, Germany
Gun box with coordinates:

http://img148.imageshack.us/img148/3596/newgunbox.gif


Re: New Attachment System Beta[message #258113] Sun, 01 August 2010 20:37 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Yes, I'll just hijack that for my thread when I change it, thanks Wink
Re: New Attachment System Beta[message #258154] Mon, 02 August 2010 00:55 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
"Standalone"*** Urban Chaos-1.13 NASv2 Released. I've included Savegames some demonstrating specific capabilities of UC-1.13NAS and others the potential bugs with the tag.

BR Test/Demo: Initial test conditions, and to show off some items

SUSAT Adding Slot bug: The SA80 rifles all have the SUSAT scope as default attachments. However the SUSAT is not meant to add any slots, but does for some reason. Attachment Slot 73 / Item 515 seems to be adding Slot 78 (a slot meant to be added to pistols when the UBAR Bridge is attached to a pistol's underbarrel attachment slot).

Laser Sight Adding Slot Bug: Attaching the Laser Sight (item 241) to any valid attachment slot on some guns seems to be adding adding (different) slots outside the control of AttachmentSlotAssign.xml. The savegame has three examples, note how the M4 and ACR get different new slots when the laser sight is attached, but the G36 does not. The P90 seems to be getting the same unwanted extra slot as the ACR.

AR-15 Attachments: Showing off the RIS Handguard and RIS Scope Mount for AR-15 rifles.

Pistol Demo: Showing off the RIS Bridge Mount and Desert Eagle RIS attachments. Note the penalties of mounting a 10x Scope on a Mark 23 SOCOM.

AK RIS Attachments: Showing off the AK RIS Handguard, and AK-9's built in lower tactical rail (which does not allow for the use of the AK RIS Handguard.

Groza Demo: Demonstrating the old Groza Weapon System, now enhanced using NAS for conversion of the Attachments.

I now go and rest my weary eyes. The modDB link will be posted when they email me with authorization.

*** well as standalone as I feel is appropriate to release as it is built on other people's work, technically three seperate mods (yours WarmSteel, v1.13, and Urban Chaos) must be acquired before the Hybrid does anything.

EDIT: Sorry, forgot to post the link: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=258151#Post258151

[Updated on: Mon, 02 August 2010 01:11] by Moderator



Re: New Attachment System Beta[message #258159] Mon, 02 August 2010 01:23 Go to previous messageGo to next message
Tango

 
Messages:106
Registered:July 2006
First of all thanks, (yet again) to Wil and Warmsteel for all the work on this.

Will try and test everything out this week.

wil473

SUSAT Adding Slot bug: The SA80 rifles all have the SUSAT scope as default attachments. However the SUSAT is not meant to add any slots, but does for some reason. Attachment Slot 73 / Item 515 seems to be adding Slot 78 (a slot meant to be added to pistols when the UBAR Bridge is attached to a pistol's underbarrel attachment slot).


Not directly bug related but the SA80 system of rifles use a rail system referred to as a "NATO Rail" which supposedly has a STANAG assigned to it. This was a predecessor to the now familiar picatinny rail which has only recently been assigned a STANAG.

It also allows the mounting of iron sights which a lot of "rear area" units, like signallers and logistics regiments are still issued. The Kite night sight is also issued with a mount for the NATO rail.

Note the L86 is always issued with a SUSAT in every unit not according to role.

I'm sure you'll be overjoyed at yet another type of rail system Very Happy.
Re: New Attachment System Beta[message #258174] Mon, 02 August 2010 10:39 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Updated the posting to include ModDB download. See: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=258151#Post258151

Thanks Tango for the information. In the balance between realism vs. "its-only-a-game," the NATO Rail can be taken in two ways:

1) Right now the SUSAT has an attachment slot all to itself, but the Kite NV sight can be set to use it as well. The Kite NV sight as of CFSS 20100719 is more or less a 4x Battlescope with night and cave range bonues. The SUSAT is a copy of the 4x, inspired by the general feeling against "built-in" attachments via stats applied directly to the weapons. Note: that I could not get rid of all occurances of "built-in" non-attachments.

2) Allow the SUSAT to use the "RIS: Flat Top" and similar RIS optics attachment slots, which was actually my first thought on seeing your post as changing the attachment slot may mask over the reported random problems with attachments adding attachment slots. Until WarmSteel is able to investigate the problem further, this option will probably lead to other unwanted slots being added. Also, significant to UC, it may be better to keep the SUSAT unique to the SA80's for players that play with the items limited to only the original set (Tons of Guns off).

[Updated on: Mon, 02 August 2010 10:43] by Moderator



Re: New Attachment System Beta[message #258183] Mon, 02 August 2010 14:20 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Thank you, this was very usefull Smile

Seems there was a little screwup when clearing the data from the previous entry.
It's fixed now, but sadly I could not yet remove the restrictions for adding slots.
Still looking at it, though.
Re: New Attachment System Beta[message #258251] Tue, 03 August 2010 01:01 Go to previous messageGo to next message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Good to hear I'm actually being helpful, instead of just horribly abusing your work. (I'm not done yet with convertible attachments.) Oh and good to hear the bug is fixed. Any plans to release a new Beta, perhaps using the new layout?

Are the "restrictions" the ones that prevent Add-on attachments nesting in slots added by previous attachment? Though I have no plans on implementing things this way, a work around would be to have items starting off with the maximum number of possible slots, remove slot tags on each attachment to masks out the unwanted slots. The drawback is of course instead of a small handful of attachments with add slot tags, the majority of attachments will have a list of remove slot tags. Also it would probably be counterintuitive, though the player would know up front before anything is attached what slots are possible (and has a guessing game figuring out which attachments will leave behind the wanted slots).

[Updated on: Tue, 03 August 2010 01:08] by Moderator



Re: New Attachment System Beta[message #258253] Tue, 03 August 2010 01:17 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
wil473, this would be quite counter intuitive (mostly for modders), so I don't think it's a good idea.

It's complicated to explain why what happens happens, without the code.
But theoretically, because we're trying to determine the slots on the gun, we don't know them yet.
Right now attachments only change slots when they're in the right slot.

However... I could tie the changing of slots -only- to the attachment.
This means it doesn't matter in what slot it is, if it's on the gun, it adds/removes attachments.
I think this would make the problem fixable.
Re: New Attachment System Beta[message #258255] Tue, 03 August 2010 02:00 Go to previous messageGo to previous message
Wil473

 
Messages:2842
Registered:September 2004
Location: Canada
Aside from the theoretical loss of fine control (Attachment X can be defined to only add and/or remove slot 45 when in Slot 52, but does something different in Slot 3), I cannot think of a real example where add/remove being tied only to the attachment would be a problem. On the plus side, it would be less work for modders in that the add/removes would only have to be defined once per attachment.

EDIT: even if the change you are suggesting is a problem for a specific unknown purpose, the modder could simply define a second attachment and setup a merge conversion to flip an attachment to that item index before planting it in the new slot (ie. what I've done with folding stocks). So no objections that cannot be worked around by the modder.

[Updated on: Tue, 03 August 2010 02:25] by Moderator



Previous Topic: Experimental Project 7
Next Topic: Code Snippets
Goto Forum:
  


Current Time: Fri Jun 05 11:45:30 EEST 2020

Total time taken to generate the page: 0.02256 seconds