Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Regarding non-removable character-specific items

GodGod Member Posts: 1,150
I was wondering if any of you could assist me in an endeavour I have recently undertaken.
I am interested in utilizing the mechanic certain items bound to NPCs use (e.g. Minsc's Boo, Edwin's Amulet, Alora's Rabbit Foot etc.), namely the displaying of a non-standard string within the space meant for it on the inventory screen and playing a sound when the player attempts to remove the item. The mechanic used by Xan's moonblade, blocking use by other characters and also displaying the respective string, is also of some minor interest to me.
What I am working on is a joinable NPC who has a few personal items which I'd like him to comment on, if the player tries touching them. If I could make use of the mechanic I speak of, that would greatly enhance the overall experience of interacting with this character. I have the strings and voice acting connected to them in place, all I need is the method of attaching that to particular items.

Any insights on that matter are most welcome.

booinyoureyes

Comments

  • CoM_SolaufeinCoM_Solaufein Member Posts: 2,599
    Make the item undroppable like Boo who's item file is MISC84.

    Now if you want a comment to go along with a personal item, it would have to be flagged droppable and you would have that NPC take their item back through their script file along with their comment. The only example that I can think of that uses this is the Yasraena mod.

    IF
    !HasItem("FIREFLOW",Myself)
    OR(6)
    HasItem("FIREFLOW",Player1)
    HasItem("FIREFLOW",Player2)
    HasItem("FIREFLOW",Player3)
    HasItem("FIREFLOW",Player4)
    HasItem("FIREFLOW",Player5)
    HasItem("FIREFLOW",Player6)
    THEN
    RESPONSE #100
    ActionOverride(Player1,GiveItem("FIREFLOW","Yasraena"))
    ActionOverride(Player2,GiveItem("FIREFLOW","Yasraena"))
    ActionOverride(Player3,GiveItem("FIREFLOW","Yasraena"))
    ActionOverride(Player4,GiveItem("FIREFLOW","Yasraena"))
    ActionOverride(Player5,GiveItem("FIREFLOW","Yasraena"))
    ActionOverride(Player6,GiveItem("FIREFLOW","Yasraena"))
    DisplayStringHead(Myself,99990)
    END

  • GodGod Member Posts: 1,150
    @CoM_Solaufein
    What I essentially intend to do is to override the phrase 'This item cannot be removed.' with a different string, as it is done in the examples below:
    image
    The question is how to assign a string to display when 'This item cannot be removed.' would normally be displayed. I just haven't had the time to look into it very thoroughly yet, hence my inquiry. And since I never really modded items all that much, my major concern being difficulty enhancement, spells and dialogues, I might be missing something very basic here. What I know is that I know nothing, as a toga-clad colleague of mine used to say :)

  • CoM_SolaufeinCoM_Solaufein Member Posts: 2,599
    For that you need to add a new string in the dialog.tlk and then edit the item_use.2da file to add in your custom item along with the new string.

  • GodGod Member Posts: 1,150

    For that you need to add a new string in the dialog.tlk and then edit the item_use.2da file to add in your custom item along with the new string.

    Ah. I knew it would be something as simple as that.
    Though there doesn't seem to be any item_use.2da in my override folder, and I'm quite sure I did extract all 2das. But I'll look into it later, so thank you anyway.

  • ArasHUNArasHUN Member Posts: 6
    Hey guys, I'm pretty much new to this whole modding thing (not new to BG of course) and I was wondering if someone could walk me through the steps of how to do, well, the same thing that the OP wanted.

    My main questions/issues are:
    - How do I add a new string to dialog.tlk? I've done as an item description with SAY and that was rather easy of course but how do I add something like this?
    - When I do have the correct string added, how do I refer to it in the item_use.2da file? Since I don't know the exact string reference number and it is different depending on what else is installed, how do I tell WeiDU to go and look for that certain line of text that I just added and use its string reference number. Since in the item_use.2da file it's only a number that refers to it and forced string references are a big no no, I'm kinda puzzled.

    Thanks in advance for any help!

  • WispWisp Member Posts: 1,102
    @ArasHUN
    You'd use RESOLVE_STR_REF. E.g.,

    OUTER_SET strref = RESOLVE_STR_REF (~your text here~)
    APPEND item_use.2da ~some_resref some_npc %strref% some_flag~

    ArasHUNGodGreener
  • ArasHUNArasHUN Member Posts: 6
    @Wisp

    Thanks so much! (It worked of course.)

  • GreenerGreener Member Posts: 372
    Wisp said:

    @ArasHUN
    You'd use RESOLVE_STR_REF. E.g.,


    OUTER_SET strref = RESOLVE_STR_REF (~your text here~)
    APPEND item_use.2da ~some_resref some_npc %strref% some_flag~
    What do you mean by "some_flag"?

Sign In or Register to comment.