Home » MODDING HQ 1.13 » v1.13 Coding Talk » New Attachment System Beta
Re: New Attachment System Beta[message #266920] Mon, 15 November 2010 14:18 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
DepressivesBrot
Quote:
What code is JA2 written in btw? Haven't done any since uni but might start looking into it and tinkering in spare time one of these days if it's a language I'm vaguely familiar with.

C++, link to the SVN repository below
https://81.169.133.124/source/ja2/branches/Wanne/JA2 1.13 MP


Additional Info: You need Visual Studio 2005/2008/2010 to compile the code.

Report message to a moderator

Sergeant Major

Re: New Attachment System Beta[message #266933] Mon, 15 November 2010 19:37 Go to previous messageGo to next message
Bever is currently offline Bever

 
Messages:24
Registered:March 2009
Location: Australia
Sweet thanks for info... yay actually know c++ or although haven't used it for 3yrs or so, mainly been teaching Java. Good thing the uni has Visual Studio cause no way I could afford it.

Report message to a moderator

Private 1st Class
Re: New Attachment System Beta[message #266934] Mon, 15 November 2010 20:25 Go to previous messageGo to next message
Faithless is currently offline Faithless

 
Messages:439
Registered:October 2009
Location: The safe end of the barre...
Visual C++ express is free. You can get it from their website.
I doubt anyone here is actually using the payed version Wink

Report message to a moderator

Master Sergeant
Re: New Attachment System Beta[message #266942] Tue, 16 November 2010 03:32 Go to previous messageGo to next message
Bever is currently offline Bever

 
Messages:24
Registered:March 2009
Location: Australia
Good Point... will download it today Very Happy

Hmmm... just ran build solution and got the JA2_EN_Debug.exe from \JA2 1.13 MP\Build\bin\VS2010\Debug\ folder and added it to the files from \JA2 1.13 MP\GameDir\

Was wondering if this is all I have to do before copying the files overtop of the latest 1.13 Stable SVN release or have I missed some other files produced by the build?

[Updated on: Tue, 16 November 2010 05:15] by Moderator

Report message to a moderator

Private 1st Class
Re: New Attachment System Beta[message #266946] Tue, 16 November 2010 09:26 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
One of the features of NAS is the ability to do away with "cylinder" ammo for grenade launchers. Instead of a cylinder, we'll have up to 6 slots specifically set aside for grenade launchers to use. When all is said you'll hopefully be able to load each slot what whatever grenade (of the appropriate size) that you want. So you should be able to "mix and match" as you like. But while I've been working on all this I noticed that the GM-94 Grenade Launcher is the only 43mm launcher in the game. As such, the only 43mm "shells" that are currently in Items.xml are the equivalent of 40mm cylinders. Can someone out there create the graphics and xml entry updates needed to have each of the 5 types of 43mm grenades as single grenade items?

Report message to a moderator

First Sergeant
Re: New Attachment System Beta[message #266950] Tue, 16 November 2010 12:00 Go to previous messageGo to next message
Logisteric

 
Messages:3199
Registered:December 2008
Location: B
there are single grenades for the gm-94 (4 slots)

edith: of course i'm talking about aimNAS as well

[Updated on: Tue, 16 November 2010 12:30] by Moderator

Report message to a moderator

Captain
Re: New Attachment System Beta[message #266952] Tue, 16 November 2010 12:19 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Quote:
Can someone out there create the graphics and xml entry updates needed to have each of the 5 types of 43mm grenades as single grenade items?

You should ask smeagol, he made some for AIMNAS.

Report message to a moderator

Captain

Re: New Attachment System Beta[message #266954] Tue, 16 November 2010 12:28 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
Uhm... just grab the latest AIMNAS version and take a look if you like the stuff I made.

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266966] Tue, 16 November 2010 18:19 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Ok. I'll take a look for that. I've not seen AIMNAS yet.

BTW smeagol and wil473, I'm hoping to have "pre-beta" code ready in a day or two. I'll make it available to you guys when it's ready so you can see the changes and figure out how to make the new system work with your mods. I just need to get a couple more things finished.

Report message to a moderator

First Sergeant
Re: New Attachment System Beta[message #266969] Tue, 16 November 2010 18:40 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
BeVeR
Good Point... will download it today Very Happy

Hmmm... just ran build solution and got the JA2_EN_Debug.exe from \JA2 1.13 MP\Build\bin\VS2010\Debug\ folder and added it to the files from \JA2 1.13 MP\GameDir\

Was wondering if this is all I have to do before copying the files overtop of the latest 1.13 Stable SVN release or have I missed some other files produced by the build?


Right click on the "ja2" project -> Properties -> Configuration Properties -> Debugging -> Working Directory.
Set the "Working Directory" to the absolut path of your JA2 installation folder (e.g: C:\Games\JA2).

Then you can press F5 in Visual Studio. After compilation the Debug EXE automatically starts and you can start debugging Smile

Short Install instruction:
- Install JA2
- Get offical 1.13 GameDir files via TortoiseSVN from https://81.169.133.124/source/ja2_v1.13_data/GameDir and copy the content in your JA2 installation directory
- Get development 1.13 GameDir files via TortoiseSVN from https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP/GameDir and copy the content in your JA2 installation directory
- Compile an EXE with Visual Studio, press F5 and start playing/debugging

Any more questions? You know what to do Smile

Report message to a moderator

Sergeant Major

Re: New Attachment System Beta[message #266975] Tue, 16 November 2010 20:29 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
No need to rush Chris. I've got plans to release DL-1.13NAS sometime this weekend. I'll have time take stock of the situation afterwards. At the very least I'll be needing to actually implement that plan to quickly build OAS attachment definitions from (current) NAS slots.

From what I've seen, I'm suspecting that I won't have to throw out too much, just need to define attachment classes and assign them to the slots.

However, there is something that has been nagging me about the grenade slots discussion. Does the modder define them (as is now) or are they hard coded? I'm almost certain you said the modder still has control over creating them, but some of the recent wording has me worried.

[Updated on: Tue, 16 November 2010 20:42] by Moderator

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266981] Tue, 16 November 2010 21:07 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
There are 6 grenade slots in AttacmehtSlots.xml. You'll have full control over the display coords and size for each, just like all the other slots (though I don't recommend making the grenade slots into big slots).
All rifle grenades should be (at present) nasAttachmentClass = 1032192 which makes them valid for all 6 grenade slots.
I'm using the "GrenadeLauncher" tag in Items.xml to determine how many slots you want to activate. If it's set to 0, like most items, then you won't have any grenade slots display. If it's set to 1, like most UGLs, then you get only a single slot. You can set it as high as 6. So, as examples, the Milkor grenade launcher (item 906) has a "GrenadeLauncher" value of 6 while the AICW Grenade Launcher (item 909) has a "GrenadeLauncher" value of 3.

This brings up a concern. Some of the grenade slots overlap the external slots. For the moment so I can test, I've move the external slots so they are above the scope slots. Is that an issue or would you all prefer the grenade slots to be at the top of the interface? Here's some examples of how the interface looks.
http://img593.imageshack.us/img593/7197/interface2.jpghttp://img576.imageshack.us/img576/4324/interfacec.jpg
http://img146.imageshack.us/img146/2306/milkor.jpg
http://img842.imageshack.us/img842/7532/m16y.jpg

Report message to a moderator

First Sergeant
Re: New Attachment System Beta[message #266982] Tue, 16 November 2010 21:32 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Sorry, I think I was dancing around the issue; but if I'm reading the last bit correctly, this means at the very least with New New Attachment System I will no longer be able to define "decorative" grenade slots for "special cases."

ie. my case as already in use
1. all single shot grenade launchers use the same slot (bottom most row, immediately below the slot position always used for grenade launcher attachments) = Grenade Slot 1
2. above grenade slot plust 5 more slots for the 6 shot launchers (forming a 2x3 arrangement below the gun image) = Grenade Slots 2-6
3. OICW has its own grenade slot to indicate bullpup magazine feed (to the right of the gun image) = Grenade Slot 7
4. AICW has three more of its own grenade slots along the top, purely for decoration indicating the real world placement of the Metal storm launcher = Grenade slots 8-10
5. STK Squad Support Weapon has one more to the right of last AICW slot = Grenade slot 11


More of, "perhaps Wil is reading too much between the lines," but your technical description of adding slots seems to indicate a finite number of attachments may add slots. Granted I understand the reasoning for wanting to get one attachment adding slots working before worrying about more; but the way I seem to be reading it, its not just "nested" or "recursive" addition of slots, but total number of attachments that add slots that will be finite for technical reasons.

ie. A RIS Hand Guard and a RIS Optics adapter will take up two of the attachments that may add attachments allowance. And these two are independent of each other unlike my earlier example.

This means that my worse case example of attachments adding attachments needs to be bumped up by one. Some future modder may need more.

Note: unlike Smeagol, I am using attachments to add slots to create RIS equipped "oldie" guns. To get the equivalent of some modern "RIS-everywhere-guns" two independent attachments are needed. One for optics, and one for the handguard.

[Updated on: Tue, 16 November 2010 21:59] by Moderator

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266983] Tue, 16 November 2010 21:32 Go to previous messageGo to next message
Minty is currently offline Minty

 
Messages:110
Registered:July 2009
Location: UK
Personally, I'd prefer all slots to be modder-definable, in both x/y co-ords, attachment-capability AND number. 6 slots for grenades may seem like plenty, but what if someone wanted to make this beast ?

http://3.bp.blogspot.com/_oZaomizvY8M/S9e2-SeMMwI/AAAAAAAAHU0/plcyA8g2LPU/s1600/MM1-781323.jpg


Or even for some theoretical scifi mod, with potentially more, for grenades OR RPGs..

Edit: Ninja'd by Wil. Very Happy

[Updated on: Tue, 16 November 2010 21:36] by Moderator

Report message to a moderator

Sergeant
Re: New Attachment System Beta[message #266984] Tue, 16 November 2010 21:39 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Thanks Minty, your example is more real, rather than pure decoration like mine. Which also means that yes right now I could get away with only 6 slots, if I had to....

EDIT: for more information of what NAS features are already in place, this is an example of the current worse case scenario I have implemented:

AK-107 base slots
AK RIS Handguard = adding slots to make up a RIS quad up front
RSA Optics to RIS = adding a RIS optics slot
RIS grenade launcher (generic name) = adding a grenade slot, fits one of the slots added by the AK RIS Handguard
RIS Scope rings w/Reflex mount = adding a slot for sniper scope and a slot for a reflex sight, this one is sitting in the RIS Optics slot added by the RSA Optics to RIS attachment.

So four attachments adding slots, some of them sitting in slots added by previous attachments, others independent.

[Updated on: Tue, 16 November 2010 22:13] by Moderator

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266986] Tue, 16 November 2010 21:53 Go to previous messageGo to next message
Logisteric

 
Messages:3199
Registered:December 2008
Location: B
this is definately a gun for biff

Report message to a moderator

Captain
Re: New Attachment System Beta[message #266987] Tue, 16 November 2010 21:53 Go to previous messageGo to next message
Minty is currently offline Minty

 
Messages:110
Registered:July 2009
Location: UK
And don't forget attachments adding AND/or removing slots too.. VERY important for those that want to have uber-customisable weapons, via attachments: RIS-attachment adds RIS slots, and removes non-RIS slots, for example.

Report message to a moderator

Sergeant
Re: New Attachment System Beta[message #266989] Tue, 16 November 2010 22:48 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Let's see if I can answer everything.

You have total control over where each slot will appear. If you don't want them on the bottom row like I have them, you can change the x,y coords in the xml file.

You can't have one arrangement for one gun, and another arrangement for another gun. That is the downside of this setup. The counter to this, however, is that you don't have to build a completely new set of xml entries for every weapon that doesn't exactly conform to one of the setups already in the old system. I know this doesn't worry you guys that already have your mods, but I'm thinking it will be a bonus for people trying to write mods. Plus it takes out the concern of whether to make a mod "NAS-only" or not.
The slots in my above examples dynamically created themselves based on the allowable attachments. So in the case of the M16 graphic, if you said that the ISM-V-IR and Reflex Scope were not valid attachments for that weapon, that slot simply wouldn't appear. If you wanted the AICW to support a folding stock (bare with me, I know that weapon really can't support that Smile ) then you just add the appropriate entry to Attachments.xml and the system would automatically display the stock slot.

As I mentioned, I currently have 6 Grenade slots available. This is hardcoded because we have to tell the code what each attachment class means. That doesn't mean I can't increase that. Right now there is a 21 attachment limit. Because of how I'm handling attachment classes, we can support up to 32. I will code in the other 11 classes before I'm finished and I will alter the hard coded gl limit (currently set to 6). But there still has to be a hard coded limit so we don't try to use an attachment class that is outside of the 32bit range I'm currently using. That said, if you guys seriously think 32 different attachment classes isn't enough, I can alter the flag to a 64bit value but I figured that would be overkill.

When you attach an item, if that attachment itself can have attachments, then the item you attach to can also use those attachments. In other words, you setup a "RIS Hand Guard" that can take a reflex site and "RIS Optics Adapter", and you setup a "RIS Optics Adapter" that can take an ACOG. Then you say that the M1 Garand can fit the "RIS Hand Guard". Without the hand guard, the M1 can't use a reflex sight, ACOG or RISOA. If you fit the hand guard to the M1, you'll now be able to fit the reflex sight and the RISOA. And if you then fit the RISOA, you can fit the ACOG.

http://img705.imageshack.us/img705/6595/m11c.jpgWithout any rails
http://img708.imageshack.us/img708/2517/m12w.jpgWith "RIS Hand Guard"
http://img547.imageshack.us/img547/9408/m13e.jpgWith "RIS Hand Guard and RIS Optics Adapter"

As for removing possible attachments, I haven't figured out a way to do that. Possibly using IncompatibleAttachments.xml would work but I need to test that.

Report message to a moderator

First Sergeant
Re: New Attachment System Beta[message #266990] Tue, 16 November 2010 22:49 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
Milkor in AIMNAS

http://img713.imageshack.us/img713/6717/nasmilkor.gif


GM-04 in AIMNAS

http://img339.imageshack.us/img339/8229/nasgm94.gif

Fully tricked out M16 in AIMNAS

http://img836.imageshack.us/img836/817/trickedoutm16v4.gif



Just to show that it's not like we didn't spent some time on thinking how to place all those slots. Wink

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266991] Tue, 16 November 2010 22:55 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
I'm not suggesting otherwise. I'm simply working within the restrictions this new setup uses. Since all UGLs, plus the Milkor, plus the GM-04, plus the AICW all use "Grenade Slot 1", that slot would be in the same location for each. The one possibly work around I have would be to hard code a condition that if the "GrenadeLauncher" field from Items.xml is >1, use "Grenade Slots 2-7", thus leaving GL1 just for UGLs. It would mean adding a 7th GL slot but since there are suggestions to allow for tons of GL rounds, that isn't an impossibility.

Report message to a moderator

First Sergeant
Re: New Attachment System Beta[message #266992] Tue, 16 November 2010 23:03 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
Really don't know what's wrong with the current setup. If I feel I need to have a gun with 20 grenade slots, I can add those slots to the appropriate xml file.

I can have different slots for UGL grenades, regular GL grenades and multi-shot grenades without any problem.

Really don't get yet, what you want to achieve (btw... you could check out the IRC Channel if you want to discuss this Wink ).

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266993] Tue, 16 November 2010 23:18 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Slot layout is generated by the attachments.xml in your NAS? If true, then this is going to force a rethink of how my mod looks at least. Probably going to have to ditch multiple possible slots for an attachment. ie. that refex sight is only going to appear in one slot position on-screen regardless of if it is mounted directly to the weapon, or on a mount built into another scope/sight.

Right now: RIS Handguard - of which there is one for the AK, G3, MP5, FAL and most recently (Mini)Uzi

Adds (generally):
Top RIS slot = accepts all LAMs, RIS bipod
Side RIS slot = accepts all LAMs
Bottom RIS = accepts all LAMs, RIS bipod, RIS Grip, Grippod, FN SCAR grenade launcher, HK AG36 grenade launcher, Metal Storm underslung launcher, bipod(non-RIS), foregrip(non-RIS)

Removes:
non-RIS Grenade launcher slot (HK 79, GP-30)
standalone bipod and foregrip slot(s)

However with how I'm reading things for the new system, the RIS Handguard attachment adds a series of attachments to an items possible attachment list, adding slots as needed. This seems to imply that a standardized system of slots is mandatory.

EDIT:
ChrisL, I know you mean well, but I am still seeing a lot of work for all of us, for questionable return.

EDIT2:
Echoing Smeagol, since inclusion of the existing NAS framework into the Beta-MP code, there has been a bit of "buy-in" with it, especially as it has been very stable (not a slight against Warmsteel, really it is a big comliment that I can say that NAS is very stable, and a statement of my waryiness of "New" features over the years), and has been filled out with extra features. Nesting slots adding slots, wasn't even thought possible till later on in the project, now it is a feature. Same actually with multiple grenades.

[Updated on: Tue, 16 November 2010 23:46] by Moderator

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266994] Tue, 16 November 2010 23:40 Go to previous messageGo to next message
Logisteric

 
Messages:3199
Registered:December 2008
Location: B
well, i'm just a stupid maccie, but can anyone (probably the one who wants to change the code) tell me what this is supossed to be good for, besides freeing smeagol and wil 473 from boring weekends?

[Updated on: Tue, 16 November 2010 23:43] by Moderator

Report message to a moderator

Captain
Re: New Attachment System Beta[message #266995] Wed, 17 November 2010 00:04 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
This is probably documented somewhere in this thread, but I am suspecting that Warmsteel was only able to achieve the level of "freedom" with slot possiblilites that Smeagol, myself and others are concerned with, only because the OAS system was kept seperate (ie. not using Attachments.xml).

While your goal ChrisL of being able to maintain commonality between OAS and NAS does have benefits for beginners to JA2 v1.13; some of the old timers (those of us still active here at least) are used to the creative freedom we have right now. Quite frankly, it didn't take that much effort to get a grasp of the current NAS (notwithstanding that little gaff on my part about item control).

[Updated on: Wed, 17 November 2010 00:05] by Moderator

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266996] Wed, 17 November 2010 00:14 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
Well, I can only speak for myself here, but basically AIMNAS abandoned OAS since NAS went beta (same as OIV...). People that play mods usually want the most features available.
In my opinion NIV and NAS highly improve the possibilities of modding, I won't go back to make it OIV/OAS compatible.


Much more important is really the update for the xml editor, not only in regards to the aforementioned default attachments, but maybe even regarding attachment slots (though this probably would be a lot more work, if it is even doable at all).

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #266997] Wed, 17 November 2010 00:48 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Not to talk badly of anything WarmSteel did, but I do like the basics of his code, but the current NAS is overly redundant. As wil said, there are currently two seperate attachment systems in the code. You've got two basially identical IncompatibleAttachments.xml files, each having to be maintained seperately. You have two seperate attachment systems. If you want to add an attachment, you have to either add it to both systems (one place for OAS and potentially dozens of places for NAS) or, like you did, restrict your mod to only a single system. There are seperate functions for each system, because the way we currently look at attachments is completely different.
Yes, for "old timers" it didn't take you too long to setup using the current NAS. But it still took you longer then it should have. You had to adjust the AttachmentSlots.xml and ItemSlotAssign.xml files for each specific weapon. If you add items, you have to go through and make changes to multiple locations unless you choose to ignore one system.
Say I want to add an attachment so the game will allow a Minimi to switch between clips and belts like it should. With the current system I need to add an entry in Items.xml for the item istelf, then I need to add an entry in Attachments.xml so OAS will know which weapons can take this attachment, then I may need to update IncompatibleAttachments.xml if there are any attachments this "adapter" shouldn't go with, then I have to figure out which ItemSlotAssign entries go with the Minimi, make sure those assignments aren't used by any other weapons and possibly create new assignments, then update AttachmentSlots.xml to account for the new "adapter" and update NASIncompatibleAttachments.xml if there are any incompatibilities there. All this could take a significant amount of time, especially if you're a beginner to 1.13.
With the system I'm working on, you simply add the item to Items.xml, then update Attachments.xml and IncompatibleAttachments.xml and you're done. Less then 5 minutes of effort regardless of your experience level.

And that's from a "modders" point of view. From a a developers point of view, any time a change needs to be made to the development system, you have to make twice as many changes. Every change is a risk for a new bug.

And then there's the xml editor which would require significant work to make it compatible with the current version of NAS because we have two completely seperate systems we're trying to work with.

From a modders perspective, the system I'm working on should take less time to setup. Yes, I get it that you guys have already spent the time setting things up but I would hope you aren't the only modders that will every do stuff for 1.13.
From a players perspective, the new system should give more options because modders won't have to choose between OAS, NAS or both when designing their mods. So if a player wants to play UC with OAS, they could. As a player, I don't see why anyone would want to since both NIV and NAS add so much to the game, but the reason we didn't remove OIV (and won't remove OAS) is so that players have an option.
And from a developers standpoint there is less risk of bug fixes causing problems because NAS will sit "on top of" OAS, just like NIV sits "on top of" OIV.
The only real drawback I see so far is that you lose some of the fine control you currently have over how slots appear. I.E., you can't have a completely different layout for every single weapon.

Wil, look at your post. You've got three different "RIS Slots" that "accept all LAMs". Does that mean you'd actually mount 3 LAMs to a gun? Which you actually could do with the system I'm setting up. But other then simply doing it "because you can", would you? I don't think the code would even recognize that you had three attachments that gave the same bonuses.

Anyway, at this point the only thing I can do is finish what I'm doing and let you all look at it. From there I can either "fix" the things you all think are missing or scrap the work I've done and just leave what we currently have in place. Though I would at least hope you'd keep an open mind.

Report message to a moderator

First Sergeant
Re: New Attachment System Beta[message #266998] Wed, 17 November 2010 01:05 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Nope, at least for LAM's and bipods. One of the reasons for the nearly identical IncompatibleAttachments.xml files, is that the NAS one has definitions making LAM's incompatible with itself as well as other LAM equipped attachments. With OAS there wasn't any reason to worry abut multiples of the same attachment being attached, however with NAS.

Multiple attachments adding together is a recognized feature of Warmsteel's NAS; one that I have yet to use. I was in on the original discussions, because it related to the very example I've noted (all I wanted was multiple legal slots that one could drop a LAM into).

I've already said I will take a look at what you have to offer Chris. To be honest, I've already rebuilt the mod (now mods) to accomodate NAS changes before; however in that last case we had an idea of its benefits (its documented in the thread somewhere, an entire XML was dropped, it had something to do with adding/removing slots I think). I am sorry, but so far it seems we've only discussed loss of capability today.

[Updated on: Wed, 17 November 2010 01:55] by Moderator

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #267000] Wed, 17 November 2010 01:57 Go to previous messageGo to next message
Faithless is currently offline Faithless

 
Messages:439
Registered:October 2009
Location: The safe end of the barre...
Quote:
From a a developers point of view, any time a change needs to be made to the development system, you have to make twice as many changes. Every change is a risk for a new bug.
This is something that shouldn't be underestimated, and the main reason I think we should explore this option further.

I also think it fits 1.13 alot more, since it maintains OAS without (too much?) extra effort, ensuring it will always be around.
Your mods have dropped OAS completely, which is fine. But this is unthinkable for 1.13 itself, because it would mean all attachments would have to be defined twice.

I know currently it's a big hassle for the modders that have adapted their mods to NAS, but in the end having a more stable and possibly easier to use system will benefit us all.

It might still not work out the way we had all hoped, but we can always think about merging certain aspect of the two ways Chris and I have tried.

Quote:
The only real drawback I see so far is that you lose some of the fine control you currently have over how slots appear. I.E., you can't have a completely different layout for every single weapon.
I think this is rather a serious restriction, but maybe it can be fixed by having some xml (probably embedded into some other xml file) to be able to define slots with a different layout than the default based on the item ID (usItem).

I'm also a bit concerned about the limitation of these classes, as while only up to something like 10 will go on one separate item, I could understand there was a need to make "similair" classes for different items.

Quote:
Multiple attachments adding together is a recognized feature of Warmsteel's NAS that I have yet to use. Its there, I was in on the original discussions, because it related to the very example I've noted (all I wanted was multiple legal slots that one could go into).
Even though NAS does currently support this, it is not perfect by far, mainly because of the same reason Chris mentioned, the game does not *always* know how to handle multiple attachments of the same type.

The reason for this is:Quote:
I don't think the code would even recognize that you had three attachments that gave the same bonuses.
Some bonuses will take effect, and some won't. It really just depends. This means at the moment it's dangerous to assume everything will work.
I do think this is mainly because the functions that read data from attachments are a bit wacky and are all very specific on how to read certain attachment data.
In this light, they would need an overhaul anyway, but I figured this was another project altogether.

EDIT : one more concern

[Updated on: Wed, 17 November 2010 02:02] by Moderator

Report message to a moderator

Master Sergeant
Re: New Attachment System Beta[message #267001] Wed, 17 November 2010 02:08 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
ChrisL
If you add items, you have to go through and make changes to multiple locations unless you choose to ignore one system.


Well... I ignore OAS, but still have to check several different places when I add new items. I like using the XML editor to add new stuff, but I have to add attachments manually atm. Once you get the hang of it, this isn't such a big deal, though.

Quote:
Say I want to add an attachment so the game will allow a Minimi to switch between clips and belts like it should.


Like the idea... now if only more than one default attachment would work with the xml edior ... Wink

Quote:
All this could take a significant amount of time, especially if you're a beginner to 1.13.


Hmm... don't know if the "beginner" argument is really valid. Adding stuff was already difficult when the XML editor was still working properly (item pics spread over three sti files, etc...). For people who want to get into modding it takes quite a bit of time to get used to.

Quote:
Less then 5 minutes of effort regardless of your experience level.


Well, for adding one item maybe... but we're talking here about re-configuiring entire item mods with something around 2500 entries to items.xml. I don't say, I disaprove what you intend to do, but I'd like to explain my thoughts on this (though I actually succeeded in chasing away other people by doing this...).

Quote:
From a a developers point of view, any time a change needs to be made to the development system, you have to make twice as many changes. Every change is a risk for a new bug.


Yeah, I can see that.


Quote:
The only real drawback I see so far is that you lose some of the fine control you currently have over how slots appear. I.E., you can't have a completely different layout for every single weapon.


Exactly. And that fine control was one of the reasons I picked up on NAS rather quickly.

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #267002] Wed, 17 November 2010 02:17 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Speaking of fine control over attachment slots, and new modders, is ko5ma still active with Truly Customizable Weapons? No new updates since August, though as short as the thread is, it does look into what is possible with a NAS of some kind.

EDIT: by the way, I am finding it somewhat curious that everyone is talking about the FN Minimi dual belt/magazine feed as a new thing. I had this implemented, in a rather cumbersome manner, with OAS. The NAS exploit allows it to almost operate like a button to select mode. Then again my beta testers didn't notice it either...

[Updated on: Wed, 17 November 2010 02:20] by Moderator

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #267003] Wed, 17 November 2010 02:52 Go to previous messageGo to next message
Faithless is currently offline Faithless

 
Messages:439
Registered:October 2009
Location: The safe end of the barre...
ko5ma relied heavily on being able to place the slots independently for each item.
I believe though, that if this is fixed, his system would still be possible.

Report message to a moderator

Master Sergeant
Re: New Attachment System Beta[message #267013] Wed, 17 November 2010 11:37 Go to previous messageGo to next message
Bever is currently offline Bever

 
Messages:24
Registered:March 2009
Location: Australia
Been playing around making some attachments and weapons and love the organisation of the xml tables. You've done a great job on this system it's quick and easy to use and has added a whole new dimension to my JA2 tinkering.

Report message to a moderator

Private 1st Class
Re: New Attachment System Beta[message #267035] Wed, 17 November 2010 16:36 Go to previous messageGo to next message
Bever is currently offline Bever

 
Messages:24
Registered:March 2009
Location: Australia
Was wondering if any other tags than the ones specified in the NAS_Readme would work for the AlteringAttachments.xml

The tag I would like to use is 0 instead of 0 as WeaponType gives more specific results while still being faster and broader than typing each individual ID.

I've given it a try and it seems to not work... Any suggestions as to why... i.e. is it a limitation of the way the xmls are used when internalising the data when .exe is run? or did I just spell something wrong or define the tag incorrectly?

What I'm trying to do is create a adapter thread for the end of rifles but need different slots to be generated depending on if the rifle is a Sniper Rifle or an Assault Rifle or just an ordinary Rifle. These categories are defined in WeaponType and not WeaponClass.

Report message to a moderator

Private 1st Class
Re: New Attachment System Beta[message #267037] Wed, 17 November 2010 17:06 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
BeVeR
I've given it a try and it seems to not work... Any suggestions as to why... i.e. is it a limitation of the way the xmls are used when internalising the data when .exe is run? or did I just spell something wrong or define the tag incorrectly?


The game will only read and compare what it was told to do in the exe. If ubWeaponType is not defined as a valid tag to be used in AlteringAttachments.xml, it will be ignored. It should be possible to change that in the code though.

Report message to a moderator

Captain

Re: New Attachment System Beta[message #267041] Wed, 17 November 2010 19:28 Go to previous messageGo to next message
Bever is currently offline Bever

 
Messages:24
Registered:March 2009
Location: Australia
K thanks, had a feeling that was the case. Any clues as to where abouts in the code this would be?

Report message to a moderator

Private 1st Class
Re: New Attachment System Beta[message #267043] Wed, 17 November 2010 19:57 Go to previous messageGo to next message
Bever is currently offline Bever

 
Messages:24
Registered:March 2009
Location: Australia
Hmm... found where the code is written for passing in the info from the XML. Also found where the ubWeaponClass is checked. Now since it's been forever and a day since I've worked with C++ I'm not too keen on writing some whole new code but I'm wondering if it will cause any issues if i just change all the references to ubWeaponClass to ubWeaponType seeing as I haven't been using ubWeaponClass for any of my AlteringAttachments.xml

Any thoughts on this before I go ahead with it... Think I'll wait till I get up tomorrow before trying any actual coding seeing as it's 0430 and I'd be likely to make mistakes. :sleep:

Report message to a moderator

Private 1st Class
Re: New Attachment System Beta[message #267044] Wed, 17 November 2010 20:07 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
I'll admit that I ran with the modifications I have been working with (which resulted in the lose of fine control over slot placement for various weapons) because it is a fairly expedient method from a development point of view. Right now I'm working with a single "nasAttachmentClass" value which links slot and attachment to determine layout and compatibility. From a development standpoint that means less coding and less updating when someone (possibly me if I can figure out VB) gets around to the xml editor. But that isn't the only option.

One option would be to use the existing "ubWeaponType" in combination with the "nasAttachmentClass" so that different classes of weapons could use different layouts. This option would allow a bit more control of slot placement with a minimum of code work. If we assume that most assault rifles, for example, use pretty much identical layouts, this option would work well. You still wouldn't have the level of slot placement control you currently have, but it would be more then what I'm currently working on and may work well if the assumption is valid.

A second option would be to add a second class variable (nasLayoutClass). Similar to option one, it would grant a bit more control since you could give different weapons of the same ubWeaponType completely different layouts. It would require a 2nd field being added to Items.xml, but it's certainly possible. Again, you wouldn't have quite the level of control you potentially have now since there would still be a finite number of arrangements you could use. But there would be more then what I'm currently working on, more then in option one, and probably about as many as you guys are actually using right now.

And a third option would be to restore ItemSlotAssign.xml. This option is the most involved but would give you the ability to have a completely different layout for every weapon/item in the game. Personally I think this is overkill. There's alot more programming involved (both in the ja2 code and the xml editor) with this option. Plus, would you actually have a different layout for every AK in the system (as an example)?

In all three cases, the way the system determines what a valid attachment is, and where those attachments can be placed, remains unchanged from what I'm currently working on. All these options would change is how the system figures out the way to display the attachment slots. Also, I can't program the system to do all three options, though I am willing to work on one of them since it's apparent the slot placement is a bit more important to the modders then I had originally expected. Of the three, I'd prefer option 1 as it gives you additional control without me having to write too much extra code. Smile But if you guys think options 2 or 3 would be better, I'll try those instead. I just need to know which option you guys think would be best.

As for multiple attachments, most of the functions used to figure out weapon bonuses are designed to look through the attachments until one is found that meets the search criteria. When one is found, the code returns the value. So in the case of laser sights, if you had a standard Laser Sight in a "lower" slot number (from the codes perspective) and a LAM-200 in a "higher" slot, you'd get the bonus from the Laser Sight and the LAM would be ignored. We'd have to re-write most of those functions to search every attachment and then have the code figure out which is the "best" option. This is very problematic, especially when we compare attachments that have bonuses and penalties that counter each other. For example, if you could put an ACOG and a Battle Scope on the same weapon, the code might determine that the Battle Scope gives the best bonuses but it also has the worst penalties so we'd have to let it know to use this attachment for both calculations. Obviously that isn't impossible, but the code currently isn't designed to do this. Ultimately the code (both the original and now NAS) is designed on the assumption that you wouldn't use two similar attachments on the same weapon. Personally, though I know it's feasible that you could go mounting multiple scopes, laser sights and such, there really is no reason you would do so in the game so it's not worth the effort to rewrite functions that work. Not to mention that if we make these functions too complicated, it'll slow the game down.

Finally, for multiple attachment points, that's already possible with the code I'm working on. With or without the above options to give you guys more control over the attachment layout. I may have setup the xml files I'm currently working with so that (for example) laser sights can only go in the "Sight Attachment" slot (nasAttachmentClass = 32) but that doesn't mean you guys can't change that. If you want to make it possible for laser sights to be attached to the "Sight Attachment" or "Underbarrel Attachment" points, you just have to change the "nasAttachmentClass" of the laser sites to be a combination of both (i.e., nasAttachmentClass = 32 + 8192 = 8224) and the code will allow placement in either/both locations.
Alternatively (and probably a better solution with any of the above options) you could change the "nasAttachmentClass" of the "Underbarrel Attachment" slot (or the equivalent for a specific "ubWeaponType", "nasLayoutClass" or "usItem" depending on which layout option we program for) uses class 8224 which would then allow that slot to use both "underbarrel" and "lasersight" class attachments.

Report message to a moderator

First Sergeant
Re: New Attachment System Beta[message #267045] Wed, 17 November 2010 20:09 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
BeVeR
Hmm... found where the code is written for passing in the info from the XML. Also found where the ubWeaponClass is checked. Now since it's been forever and a day since I've worked with C++ I'm not too keen on writing some whole new code but I'm wondering if it will cause any issues if i just change all the references to ubWeaponClass to ubWeaponType seeing as I haven't been using ubWeaponClass for any of my AlteringAttachments.xml

Any thoughts on this before I go ahead with it... Think I'll wait till I get up tomorrow before trying any actual coding seeing as it's 0430 and I'd be likely to make mistakes. :sleep:

Just so you're aware, the AlteringAttachments.xml is only used in the current version of NAS. The version that I've been working on (what we've been talking about over the last few days) does away with this xml file in favor of an altering system similar to the way underslung grenade launchers currently work.

Report message to a moderator

First Sergeant
Re: New Attachment System Beta[message #267046] Wed, 17 November 2010 20:28 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Depending on how much control and flexibility is made avaialbe to the modder, nasLayoutClass could transform into a substitute for a weapon families variable that so many other ideas require (ie. weapons familarity by Mercs). So the effort to add a new tag to items.xml may find other uses.

EDIT: just off the top of my head I've recycled these slot arrangements

AK
AR-15
Bullpup Rifle
Sniper Rifle
FN FAL
G3
MP5
Oldie Pistol
Pistol w/tac rail
Heavy Revolver (sniper scope)
Heavy LMG
Desert Eagle
G36/80's fixed scope AR

Then again I probably have more examples of custom layouts vs. repeats; though overall the bulk of the weapons fit one of these.

[Updated on: Wed, 17 November 2010 20:50] by Moderator

Report message to a moderator

Lieutenant

Re: New Attachment System Beta[message #267048] Wed, 17 November 2010 20:43 Go to previous messageGo to previous message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Ok. For the moment I'll start looking at adding a nasLayoutClass option while I'm working the rest of the bugs (those that I can see, anyway) out of what I've written.

Report message to a moderator

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


Current Time: Fri Mar 29 13:33:10 GMT+2 2024

Total time taken to generate the page: 0.04714 seconds