Skip to content

2da For Weapon Top, Middle, and Bottom Models?

Wondering which .2da I'd reference for top, middle, and bottom parts for weapons. Need to find the maximum for each weapon type/part. Can't seem to find the one I need for this.

Comments

  • 4BOLTMAIN4BOLTMAIN Member Posts: 90
    This was taken from "x2_inc_itemprop" It lists the 2da's for the armor functions but not for weapons.

    I know its not the answer you are looking for but if needed you could use this function along with some player tells to get the information you need.

    While looking in a source folder I can clearly see the ones for armor but not for weapons. I remember working on a crafting option for weapons in 1.69 but I cant remember what file(s) I was looking at.
    // ----------------------------------------------------------------------------
    // Returns a new armor based of oArmor with nPartModified
    // nPart - ITEM_APPR_WEAPON_MODEL_* constant of the part to be changed
    // nMode -
    //          X2_IP_WEAPONTYPE_NEXT    - next valid appearance
    //          X2_IP_WEAPONTYPE_PREV    - previous valid apperance;
    //          X2_IP_WEAPONTYPE_RANDOM  - random valid appearance (torso is never changed);
    // bDestroyOldOnSuccess - Destroy oArmor in process?
    // Uses Get2DAstring, so do not use in loops
    // ----------------------------------------------------------------------------
    object IPGetModifiedWeapon(object oWeapon, int nPart, int nMode, int bDestroyOldOnSuccess)
    {
        int nNewApp = IPGetWeaponAppearanceType(oWeapon, nPart,  nMode );
        //SpeakString("old: " + IntToString(GetItemAppearance(oWeapon,ITEM_APPR_TYPE_WEAPON_MODEL,nPart)));
        //SpeakString("new: " + IntToString(nNewApp));
        object oNew = CopyItemAndModify(oWeapon,ITEM_APPR_TYPE_WEAPON_MODEL, nPart, nNewApp,TRUE);
        if (oNew != OBJECT_INVALID)
        {
            if( bDestroyOldOnSuccess )
            {
                DestroyObject(oWeapon);
            }
            return oNew;
        }
        // Safety fallback, return old weapon on failures
           return oWeapon;
    }
    

  • ProlericProleric Member Posts: 1,281
    edited June 2022
    Scripting is the way to go.

    baseitems.2da tells you which item types have 3 parts, and the model name prefix, but no 2da tells you how many variants actually exist (the maximum in baseitems.2da is often set to an arbitrary high value, so that it isn't a constraint).

    The Lexicon entry for CopyItemAndModify points out that ResManGetAliasFor will tell you which models exist.
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    Aaaah. Thank you both for the feedback. Back on track.
  • KamirynKamiryn Member Posts: 74
    Proleric wrote: »
    The Lexicon entry for CopyItemAndModify points out that ResManGetAliasFor will tell you which models exist.
    Thanks for pointing this out. I had read about ResManGetAliasFor() some time ago in the patch notes but had forgotten about it in the meantime. But this function is so incredibly usefull. It's literally making a blind man see.

Sign In or Register to comment.