Home » MODDING HQ 1.13 » v1.13 Coding Talk » Self-Transforming Items (Pre-Project Discussion)
Re: Self-Transforming Items (Pre-Project Discussion)[message #293611] Tue, 15 November 2011 15:00 Go to previous messageGo to previous message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Headrock
I could easily change an item into a new one, and there are functions that automatically check attachments and make sure that the new item can still hold all its attachments (invalid ones are automatically removed as far as I can tell).


ChrisL is still around, though not as frequent as he was when NAS and NCTH were being introduced (see pages of discussion between him, myself and Smeagol re: conversion to NAS 0.7). The automatic check/add/removal is needed to prevent incorrect default inseparable attachment issues. In practice, removable attachments are just dumped to inventory, the merc's or to the map if no room. Inseparable attachments are the problem, hence code you see there. When an item is created via a merger, inseparable default attachments (and only inseparable default attachments are produced and removed as needed. Removable attachments do not pop-up on creation due to the exploitation potential. This and the expanded 12 default attachment limit allow all the "fake" built in attachments of original JA2 to be replaced by real integral attachments (inseparable attachments), as has been done in my projects.

The pop-up inseparable default attachment NAS feature I'm actually using as part of a work around for an unresolved map editor issue (unlike NAS, the Map Editor doesn't always supply the correct default attachments). Mergers have been setup with all guns that have default inseparable attachments, so that a non-destructive USE Merger of a Tool Kit into these guns will produce the same gun, but because this "new" gun is the product of a merger, it has all inseparable attachments.

Another example of this code's use is the pop-up foregrip on some machine pistols in my mods. When the stock is collapsed, the weapon does not have an integral grip (no entry in attachments.xml and not listed as a default). When one of these M.Pistols is converted to its extended stock form (different item index), the integral grip appears due to this NAS feature (and the grip being fully setup as a default attachment). On conversion back to its collapsed stock form, the grip goes away as it is not a default attachment, nor on the attachment list.

One thing is that there is still a potential for a crash if the produced item has an inseparable default attachment listed in items.XML, that is not on its attachment list. I've made that mistake several times.


Not sure if the above helps, but from the practical in-use side of modding that's how this NAS feature functions. Actually, a long time ago when I was thinking about a "transformational" capability, I aways thought of it as being a new merger type defined in the merger XML's. Instead of an entirely new feature, with new XML(s), would it be possible to leverage off of the existing merger infrastructure?
- add 2 new merger type(s) - solo item merger easy and hard, just as other mergers come in easy and hard flavours
- new code to trigger the merger without the need of a 2nd item, ie. the whole interface in-game for this capability
- no need to worry about the NAS end of things as it is already there, and presumably doesn't care about which specific merger type is creating the change in item index, ie. a new merger type would be treated just like the existing ones

The only problem would be that right now merger operations cannot be done on attached attachments. Ie. the scope has to be removed from the base weapon before you can merge something into the scope. A Self-Transforming Items should be able to transform while it is attached to another item, but then there would be a need to check if the resultant item is still a valid attachment for the base gun. This is the opposite of right now where the base weapon/item changes, and the status of attachments legality in-game has to be checked.

[Updated on: Tue, 15 November 2011 15:07] by Moderator

Report message to a moderator

Lieutenant

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to build the russian language version in VC2010 ?
Next Topic: Lower bullet damage with distance
Goto Forum:
  


Current Time: Sat Feb 15 21:40:22 GMT+2 2025

Total time taken to generate the page: 0.01201 seconds