Skip to content

On Restricting Items?

NoloirNoloir Member, Mobile Tester Posts: 380
edited January 2019 in General Modding
Using the "Restrict Item" op code what text or script is used for making an item exclusively usuable by the main character alone? Examples: Valygar's Katana; Haer'Dalis's Short swords, Keldorn's Armour, Boo.

Comments

  • lolienlolien Member, Moderator, Translator (NDA) Posts: 3,108
    Cpied from here:


    #319 (0x13F) Usability: Item Usability
    Parameter #1: IDS Entry
    Parameter #2: IDS File
    Special: Description note
    Description:
    This effect restricts the item to creature(s) matching the object identifiers. The string to display when an invalid creature attempts to use the item is held in 0x2c.
    Known values for 'IDS File' are:
    2 EA.ids
    3 General.ids
    4 Race.ids
    5 Class.ids
    6 Specific.ids
    7 Gender.ids
    8 Align.ids
    9 Kit.ids
    10 Actor's name
    11 Actor's scripting name (8 maximum in resource field)
    If 'IDS File' is set to 10, the item is restricted to characters with the name specified by the strref held in parameter1.
    If 'IDS File' is set to 11, the item is restricted to characters with the death variable specified by the resource field.

    The message defined in 'Description note' will be displayed whenever this effect is triggered.


    Hope it helps.
    StummvonBordwehrNoloir
  • NoloirNoloir Member, Mobile Tester Posts: 380
    edited January 2019
    lolien said:

    Cpied from here:


    #319 (0x13F) Usability: Item Usability
    Parameter #1: IDS Entry
    Parameter #2: IDS File
    Special: Description note
    Description:
    This effect restricts the item to creature(s) matching the object identifiers. The string to display when an invalid creature attempts to use the item is held in 0x2c.
    Known values for 'IDS File' are:
    2 EA.ids
    3 General.ids
    4 Race.ids
    5 Class.ids
    6 Specific.ids
    7 Gender.ids
    8 Align.ids
    9 Kit.ids
    10 Actor's name
    11 Actor's scripting name (8 maximum in resource field)
    If 'IDS File' is set to 10, the item is restricted to characters with the name specified by the strref held in parameter1.
    If 'IDS File' is set to 11, the item is restricted to characters with the death variable specified by the resource field.

    The message defined in 'Description note' will be displayed whenever this effect is triggered.


    Hope it helps.

    It kind of does. Particularly with 11 or 12 I'm searching for the script name that's a general reference to the main protagonist.

    For instance, Keldorn's Firecam Armour is set to KELDORN while Valygar's item is set to VALYGAR. Charname doesn't seem to have it's own index for the same purposes.
    lolien
  • RaduzielRaduziel Member Posts: 4,714
    IIRC it uses parameter 11 with the Actor's death variable and there's also a 2da file that handles it.

    Sorry for not being more useful, kind of in a hurry.
    Noloir
  • The user and all related content has been deleted.
  • OlvynChuruOlvynChuru Member Posts: 3,075
    One thing you could do is give the main character a unique Specifics number (by adding something to BALDUR.BCS that changes the main character's Specifics number) and only allow the item to be used by creatures of that Specifics number.
    NoloirRaduziellolien
  • NoloirNoloir Member, Mobile Tester Posts: 380

    One thing you could do is give the main character a unique Specifics number (by adding something to BALDUR.BCS that changes the main character's Specifics number) and only allow the item to be used by creatures of that Specifics number.

    Yes, this might just do it! I notice that Haer'Dalis's items are restricted to "Tiefling" and his item works.

    Thing is I'm aiming to make this "mod-friendly" when I reach that level of awesomenes/experience with WeiDu. If a new Baldur.BCS were created for could that be transfered via WeiDu or have any adverse impact on Gameplay mechanics in terms of .Ids targeting/modifiers?

    Noticed that "Human/Elf/Half-Elf-etc have their own unique .IDS categories. If charname were made anything beyond a standard race would it impact monsters with something like +2 to +2 damage rolls Attack hand-to-hand weapon vs Humanoids? Are AI attacks even that specific?

  • NoloirNoloir Member, Mobile Tester Posts: 380
    Raduziel said:

    IIRC it uses parameter 11 with the Actor's death variable and there's also a 2da file that handles it.

    Sorry for not being more useful, kind of in a hurry.

    Unfortunately charname has no such refstring in the .2da for death...but...I did manage to learn something useful. Particularly that .bam files can be identified by .m2das that refer to their correponding monster images.

    With this I can make a unique .cre summon using a non-used "Wild Boar" .bam file in a future project. This as well as import .bams that doesn't exist in bgee into the game. Thank you!
    Raduziel
  • NoloirNoloir Member, Mobile Tester Posts: 380

    Noloir said:

    It kind of does. Particularly with 11 or 12 I'm searching for the script name that's a general reference to the main protagonist.

    I don't think there is any such thing. Maybe try param2 = 11 and param1 = blank? Worth a try but this may be impossible.
    Let you know how it goes.
  • [Deleted User][Deleted User] Posts: 0
    edited January 2019
    The user and all related content has been deleted.
    Noloirlolien
  • NoloirNoloir Member, Mobile Tester Posts: 380
    edited January 2019
    argent77 said:

    Noloir said:

    It kind of does. Particularly with 11 or 12 I'm searching for the script name that's a general reference to the main protagonist.

    I don't think there is any such thing. Maybe try param2 = 11 and param1 = blank? Worth a try but this may be impossible.
    Both options, param2 = 10, param1 = -1 as well as param2 = 11, resource = "None" (without the quotes), can be used to restrict items to player-created characters (which is usually just the protagonist). I don't think there are better options available (without introducing unwanted side effects).
    @Argent77 @subtledoctor Brilliantly simple! Makes sense particularly with #11 (param2 = 11, param1 None) . Since the game ends once dies stands to reason that it's the only PC without a Death Script! The item works perfectly now.

    The item is a necklace fashioned after the unused "Sword Medallion" .bam from BG2EE. Combined with some interesting codes from the Rod of Lordly Might and the effect .bam from IWDEE for Mordakainen's Sword (A personal favorite) I created an Amulet that gives +10 hp, +1 Dex, +2 Save vs. Breath that can change into Mordakainnen's Sword from IWDEE once per day as an inventory weapon. The sword can change back into the amulet anytime the player sees fit 1/per day as well.

    The weapon has no PIP but hits like Varscona with +1 magic dmg instead of ice and +1 fire damage against trolls, werewolves, and undead that hits anywhere within 100ft like a spirit sword/range weapon. This item beyond being restricted to Charname at the moment is restricted to Ranger as I thought that it'd be a great bonus item along Cerebus (a spirit dog) from Mielikki at the end of the Ranger stronghold but it might serve as an interesting item that parallels Blackrazor but for a Good Aligned Charname in hell. I'd personally hate to see Minsc or Valygar use something so uniquely God-like so the idea of restricting this item to Charname came to mind. As Valygar has both armour and a katana and Minsc has Boo they need nothing else as Rangers.

    I'd appreciate any feedback on this especially in terms of damage output. At some point I hope to become skilled at WeiDu enough to bundle item concepts like this into fitting Mod add-ins.


    Gusindalolien
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    argent77 said:


    Both options, param2 = 10, param1 = -1 as well as param2 = 11, resource = "None" (without the quotes), can be used to restrict items to player-created characters (which is usually just the protagonist). I don't think there are better options available (without introducing unwanted side effects).

    Interesting, good to know.

    I guess you also need to set the power attribute to 1, right?
  • NoloirNoloir Member, Mobile Tester Posts: 380
    Luke93 said:

    argent77 said:


    Both options, param2 = 10, param1 = -1 as well as param2 = 11, resource = "None" (without the quotes), can be used to restrict items to player-created characters (which is usually just the protagonist). I don't think there are better options available (without introducing unwanted side effects).

    Interesting, good to know.

    I guess you also need to set the power attribute to 1, right?
    I'm away from my computer but I'm sure so. Use either Valygar's or Keldorn's NPCGear as a reference and search for "Restrict Item". Copy and past into whatever you had in mind making and tweak the parameters as desired while deleting the resource names of VALYGAR or KELDORN respectively.
Sign In or Register to comment.