Home » MODDING HQ 1.13 » v1.13 Coding Talk » New Attachment System Beta
Re: New Attachment System Beta[message #276479] Wed, 23 March 2011 20:16 Go to previous messageGo to next message
ctiberious

 
Messages:607
Registered:March 2007
@Smeagol: I can't duplicate the issue you're describing. I take an FN FAL Carbine, which can take the laser sight and the ISM-V-IR. Attach either item into the appropriate slot, then try to attach the other and I get the notice that the two items aren't compatible and the attachment process fails.

Re: New Attachment System Beta[message #276481] Wed, 23 March 2011 20:28 Go to previous messageGo to next message
smeagol

 
Messages:2714
Registered:June 2008
Location: Bremen, Germany
Ok... I don't get that notifier in game, although everything seems to be set up correctly... weird.


Edit:
Okay, fixed!

Somehow an entry with itemindex 0 snuck into the incompatible attachments, which led to offsetting the incompatible attachments altogether. Dunno how that line got in there, but after deleting the line everything is back to normal again.

[Updated on: Wed, 23 March 2011 20:41] by Moderator



Re: New Attachment System Beta[message #276493] Wed, 23 March 2011 22:19 Go to previous messageGo to next message
ctiberious

 
Messages:607
Registered:March 2007
glad to hear it's working again. Smile

Re: New Attachment System Beta[message #276585] Thu, 24 March 2011 23:45 Go to previous messageGo to next message
ctiberious

 
Messages:607
Registered:March 2007
wil473
Found what looks like an issue with how NAS displays slot information. One of the UC-1.13v3 testers ran into a bug where under Restricted items mode attempting to view the details of some guns would CTD the game. I found that I could replicate it, the same gun would CTD the game only in restricted items mode when I cycled to it with the cheat codes, but would not crash the game in Tons of Guns mode.

Earlier today I found a case where a grenade set as a hidden attachment, but not a hidden addon (the slot lights up, but the grenade is not specifically named as an attachment) resulted in a CTD whenever if tried to bring up the launcher's description display. The launcher's description was working just fine before I started messing with the hidden attachment setting of the only grenade that fits it. Oddly the other slot the grenade fit into, on the weapon, appeared just fine and displayed the slot's label which I was using as an ad hoc tooltip. I fixed this by creating a dummy attachment that would be listed as a possible attachment for the launcher.

Thinking that the two CTD's may be related I quickly cleared the Tons of Guns Only flag on all attachments and tried to replicate the Restricted Items CTD, I couldn't, and was even able to open up the details display for the problem guns in the save game the original reporter of the bug supplied.

I am suspecting this CTD has something to do with NAS, specifically, how NAS deals with slots (slots appearance, or the list of possible attachment, or both) on a gun's layout where the attachments are illegal based on game mode. ie. the CTD went away when I made all attachments legal under Restricted items mode.

Or I could be seeing two separate NAS slot related CTD's (the one for game mode and attachment availability, plus the one I stumbled on while tweaking Bun's pseudo rifle grenade system to display tool tips).


I tried to recreate this issue using the current revision but I'm not able to. I don't know if it's a specific gun that is causing the problem but I tried in all four combinations: SciFi-off/ToG-Off, SciFi-On/ToG-Off, SciFi-Off/ToG-On, and SciFi-On/Tog-On. Cycled through the first 200 items without any problems.

I also tried labeling the 40mm HE grenade as a hidden attachment, then pulled up a couple different GLs that support that grenade. No crashes and in all cases the grenade was attachable but didn't display in the attachment tooltip.

If you can recreate either of these bugs using the Beta 2011 data, let me know which specific weapon or combination resulted in the CTD. If it's only happening in UC113, let me know that too. I may have to see about properly installing UC113 and see if I can recreate the error there. But even if that is the case, I will need a specific case to test with.

Of course, the other possibility is that the bug(s) has been fixed since the release you're using. There have been at least 45 upates since the last NCTH build was released, and I think over 100 since the last official beta release from RoWa.

Re: New Attachment System Beta[message #276680] Sat, 26 March 2011 22:06 Go to previous messageGo to next message
Wil473

 
Messages:2820
Registered:September 2004
Location: Canada
Well, I'm a bit ahead of schedule with testing the CTD's I've been complaining about. Inadvertently caused the CTD in the normal (Tons of Guns/Sci-fi/no Crepitus) mode, when I was modifying the MP5SD to no longer have sound suppressor attachments except for the integral one. I had a case of this weapon in the test game, and when I cleared the last attachment, it started to CTD on viewing item description. It must be something about the slot label.

EDIT: truncating the label fixed it.

Old: "Missing Muzzle Default Attachment - USE toolbox on this slot, if nothing appears please report bug."
New: "Missing Muzzle Default Attachment - USE toolbox to fix, otherwise please report bug."

EDIT2: truncating all of them to be safe: Default Attachment - USE toolbox on slot should fix, otherwise please report bug

[Updated on: Sat, 26 March 2011 22:27] by Moderator



Re: New Attachment System Beta[message #276779] Mon, 28 March 2011 18:29 Go to previous messageGo to next message
ctiberious

 
Messages:607
Registered:March 2007
Found the problem. For some reason the variable used to display the description was set to 100 characters while the variable used to store the description was set to 200 characters. This has been corrected as of revision 4289.

Re: New Attachment System Beta[message #276786] Mon, 28 March 2011 23:30 Go to previous messageGo to next message
Wil473

 
Messages:2820
Registered:September 2004
Location: Canada
Good to hear, however the origins of this bug (Reduced Items game mode) has highlighted a problem with how slots are selected for display. With the truncated slot labels (and the fixed code in future), the muzzle slot related CTD is gone, and I am now noticing the appearance of slots inappropriate to the game mode. The game, being able to recognize that an attachment is not valid for the game mode, does not list it as a possible attachment - for many attachment slots, this is leaving no valid attachments, and results in displaying the slot label. As I am trying to use slot labels as ad hoc tool tips, reduced Item mode is displaying a lot of unnecessary and inappropriate warnings.

ie. CAR-15 in Reduced items mode is showing "warnings" for missing default optics and muzzle devices, due to all muzzle devices and optics that would fit being tagged as Tons-of-guns only.

I am wondering if the NAS slot code can differentiate between:

- there being no valid attachments of any kind for an item controlling game mode (Tons of Guns vs. Reduced, and Sci-fi), leading to it not displaying a slot

and

- there being valid but hidden attachments only, leading it to display a slot along with the slot label.

Note: the Gun Barrel Extender would fit into the later, but for me I've set this as a sci-fi mode item that should fit on guns that have a flash hider or other attachment. Otherwise I would need a "dummy" attachment to make the muzzle slot appear without the slot label. Indeed, right now I am needing to allow extra attachments into Reduced items mode so the slot has something to display instead of the slot label.

[Updated on: Mon, 28 March 2011 23:36] by Moderator



Re: New Attachment System Beta[message #276798] Tue, 29 March 2011 01:52 Go to previous messageGo to next message
ctiberious

 
Messages:607
Registered:March 2007
Getting NAS to only display slots for legal items is easy enough to resolve. The fix is in revision 4290.

However, I'm not exactly sure how your note relates to this concern. If both the extender and flash suppressor are "legal" for your game settings (have correct SciFi and BigGunList flags), and assuming the Extender is only supposed to attach to weapons with a flash suppressor, then the extender should not appear on the valid tooltip list without the supressor being attached first if you've setup your attachments.xml correctly. If you don't want the Extender to be attached to a particular weapon without some other attachment as a prerequisite, then the weapon in question should not include the Extender as a legal attachment. Instead, the prerequisite attachment should have the Extender listed as a legal attachment. Example:
M4 CAN attach Flash Suppressor
M4 CANNOT attach Extender
Flash Suppressor CAN attach Extender
Looking at the tooltip for the M4 w/o a flash suppressor will NOT display the Extender as a valid option. But if you attach the flash suppressor to the M4 (and assuming you had another barrel slot available) then the Extender should become an option.
This has nothing to do with item legality or hidden flags. It's strictly to do with the way you've setup your attachments.xml file.

Re: New Attachment System Beta[message #276800] Tue, 29 March 2011 02:39 Go to previous messageGo to next message
Wil473

 
Messages:2820
Registered:September 2004
Location: Canada
Excellent. Yeah, the note was specifically concerning the gun barrel extender in UC-1.13; though I did have a concern someone would bring up the extender in v1.13. Thought I'd pre-empt by confusing myself and everyone else.


Re: New Attachment System Beta[message #289713] Tue, 23 August 2011 20:47 Go to previous messageGo to next message
Cell

 
Messages:669
Registered:February 2011
User deleted
Re: New Attachment System Beta[message #289715] Tue, 23 August 2011 21:21 Go to previous messageGo to next message
ctiberious

 
Messages:607
Registered:March 2007
If you're using the most current version of NAS, itemslotassign.xml is no longer used. NAS 0.7 deals with all attachments using the existing Attachments.xml file.

If the bipod is integral it means it shouldn't be a valid attachment for the weapon. If the weapon in question is supporting a bipod, that means your attachments.xml file says the weapon can attach a bipod which should mean the bipod should no longer be integral. I'd check that first. Also, by the default xml files, the underslung slot can support bipods, foregrips, grippod and underslung GLs. If the slot is appearing for a particular weapon, it means one of those items is listed as a valid attachment in attachments.xml.

If you're using the older version of NAS which still uses itemslotassign.xml, then I can't really help you. Upgrade to the latest build which includes the latest version of NAS.

Re: New Attachment System Beta[message #289726] Tue, 23 August 2011 22:55 Go to previous messageGo to next message
Cell

 
Messages:669
Registered:February 2011
User deleted
Re: New Attachment System Beta[message #289759] Wed, 24 August 2011 18:55 Go to previous messageGo to next message
ctiberious

 
Messages:607
Registered:March 2007
You might need to look at the incompatibleattachments.xml to make sure that bipod and foregrip aren't listed as incompatible with each other. Then in NAS you'd simply need to add a 2nd underbarrel slot in attachmentslots.xml. The only concern is that having two underbarrel slots gives you the ability to mount two underbarrel attachments. Not just a bipod and foregrip. So you'd make it possible for a bipod and UGL, for example. You'd have to setup your incompatibleattachments.xml appropriately (assuming it isn't already). Also, you probably wouldn't want all weapons able to support both attachments. For instance, an M16 might not be suitable for both a bipod and foregrip at the same time but an M60 might (just random examples based on size of weapon). So you'd probably want to create a new layout class specifically for weapons that could support two underbarrel attachments.

Re: New Attachment System Beta[message #290117] Wed, 31 August 2011 13:45 Go to previous messageGo to next message
Cell

 
Messages:669
Registered:February 2011
User deleted
Re: New Attachment System Beta[message #290153] Wed, 31 August 2011 19:01 Go to previous messageGo to next message
ctiberious

 
Messages:607
Registered:March 2007
You can't make a 2nd underbarrel slot appear only when the first is used unless you create a new layout class and assign the underbarrel attachments to this class. THEN you'd have to also say that a foregrip could attach to a bipod and vice versa. The code would then see that a new slot needed to be added because the foregrip/bipod had it available. HOWEVER, this will have the undesired effect of allowing you to attach a bipod directly to a foregrip.

If only certain weapons should be allowed to use multiple underbarrel slots, the best way to do this is create a new layout class that includes just the two underbarrel slots. THEN assign the specific weapons to that new attachment class. This will allow that weapon to get both underbarrel slots (because they are part of the weapons primary layout class) and all the remaining default slots will be automatically selected as appropriate.

Re: New Attachment System Beta[message #293792] Fri, 18 November 2011 05:18 Go to previous messageGo to next message
Cell

 
Messages:669
Registered:February 2011
User deleted
Re: New Attachment System Beta[message #294002] Mon, 21 November 2011 19:28 Go to previous message
ctiberious

 
Messages:607
Registered:March 2007
It's working as intended. There really isn't a way to force the system to display no attachment slots. We need at least one slot so that merges can function. I suppose you could create a special layout class that includes just one slot, then set the X/Y coords for that slot so it appeared under the item graphic. I never tested that setup, though, so I don't know if the item graphic would appear on top of the attachment slot (thereby making it appear that no attachment slot existed) or beneath it.

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


Current Time: Wed Jan 17 08:34:06 EET 2018

Total time taken to generate the page: 0.03217 seconds