Skip to content

Hiring a mercenary NPC?

GreenerGreener Member Posts: 430
I'm attempting to build a mercenary fighter NPC, one who changes a fee upon joining and then every week demands more money to stay or leaves.

I presume I can do this via dialog, any assistance would be appreciated...
Cheers!

Comments

  • elminsterelminster Member, Developer Posts: 16,315
    edited April 2017
    It would require a combination of dialogs and scripts but yes it sounds doable.

    I don't have the time unfortunately to get involved in any other modding projects, but once you get the gist of understanding how to write dialogs these two links should be of some help.

    http://gibberlings3.net/iesdp/scripting/triggers/bgeetriggers.htm

    (Here you would be looking to use "PartyGoldGT" , "GlobalTimerExpired" and "Global" )

    http://gibberlings3.net/iesdp/scripting/actions/bgeeactions.htm

    Here you would be using "SetGlobal", "TakePartyGold" and "SetGlobalTimer"

    I've taken the liberty of attaching "FARMBR", which is a dialog from BG1 that should give you some idea on how to format the dialog file to check/take party gold. Any text editor should be able to open it.

    The other file in there is Kivan's dialog, which should help make it a bit easier to figure out how to set up a timer (SetGlobalTimer).

    As far as the script goes, that requires you to use the "GlobalTimerExpired" trigger in order to get the dialogs to trigger. The following example comes from Kivan's script.


    IF
    GlobalTimerExpired("Kivan","GLOBAL")
    InParty(Myself)
    GlobalLT("Chapter","GLOBAL",4)
    Global("FindBandits","GLOBAL",1)
    THEN
    RESPONSE #100
    ActionOverride("KIVAN",StartDialogueNoSetInterrupt(Player1))
    END

    Hopefully this at least puts you a bit on the right track. Going through existing game files with Near Infinity can be really helpful sometimes for stuff like this.
  • GreenerGreener Member Posts: 430
    elminster said:

    It would require a combination of dialogs and scripts but yes it sounds doable.

    I don't have the time unfortunately to get involved in any other modding projects, but once you get the gist of understanding how to write dialogs these two links should be of some help.

    http://gibberlings3.net/iesdp/scripting/triggers/bgeetriggers.htm

    (Here you would be looking to use "PartyGoldGT" , "GlobalTimerExpired" and "Global" )

    http://gibberlings3.net/iesdp/scripting/actions/bgeeactions.htm

    Here you would be using "SetGlobal", "TakePartyGold" and "SetGlobalTimer"

    I've taken the liberty of attaching "FARMBR", which is a dialog from BG1 that should give you some idea on how to format the dialog file to check/take party gold. Any text editor should be able to open it.

    The other file in there is Kivan's dialog, which should help make it a bit easier to figure out how to set up a timer (SetGlobalTimer).

    As far as the script goes, that requires you to use the "GlobalTimerExpired" trigger in order to get the dialogs to trigger. The following example comes from Kivan's script.


    IF
    GlobalTimerExpired("Kivan","GLOBAL")
    InParty(Myself)
    GlobalLT("Chapter","GLOBAL",4)
    Global("FindBandits","GLOBAL",1)
    THEN
    RESPONSE #100
    ActionOverride("KIVAN",StartDialogueNoSetInterrupt(Player1))
    END

    Hopefully this at least puts you a bit on the right track. Going through existing game files with Near Infinity can be really helpful sometimes for stuff like this.

    Thank you! I'll take a look and see what I can do...
  • ZaghoulZaghoul Member, Moderator Posts: 3,938
    @Greener That is an interesting idea. Back in PnP days we often hired a mercenary fighter NPC or two when only one or two PC's were involved. Essentially hirelings as opposed to the standard companions offered in the game. Every group needs a 'Red shirt' or two, hehheh.

    As a DM ,once long ago, I gave the party the the chance to hire Fred n Charley from the Finieous Fingers comics from early Dragon magazine days. They were a hilarious pair to roleplay for a DM.
  • Contemplative_HamsterContemplative_Hamster Member Posts: 844
    Hey, just like in Pool of Radiance back in the 1980s! You could hire up to two Heroes and they'd come along, fight, and take some of the spoils of war as payment.
  • WarChiefZekeWarChiefZeke Member Posts: 2,651
    edited April 2017
    If you still need help, there's a dialogue in my own BG:EE mod at the bottom in the INTERJECT lines that takes gold from the party as well as timer initiated dialogues, you can pick those apart and get what you're looking for quite easily methinks

    in fact i added comments and organized it in such a way as to make it relatively easy for other modders to use.

    I leaned heavily on the BG2 Branwen mod to learn npc modding 101 myself, they were kind enough to intentionally design it for such a thing after all :)
  • Contemplative_HamsterContemplative_Hamster Member Posts: 844
    Zeke: you're paying it forward, then, good job.
  • Contemplative_HamsterContemplative_Hamster Member Posts: 844
    edited April 2017
    OP @Greener : But you'd be up against the hardcoded limit of six five companions and Charname unless the mercenary is beyond your complete control, like a familiar or @Artemius_I 's djinni companion and golem mods (no access to their inventory), or the blue-circle soldiers fighting on your side in SOD. Unless what you're proposing is a new NPC wjo simply charges for his service in your party?
    Post edited by Contemplative_Hamster on
  •  TheArtisan TheArtisan Member Posts: 3,277
    edited April 2017
    @rrchristensen Ahaha... while I've played around with familiar-like party members in my spare time and have a grasp on how they work, my specialty is in standard party NPCs. The credit for Afaaq and Golem Construction goes to @argent77, I'll assume you made a typo there ;)
  • Contemplative_HamsterContemplative_Hamster Member Posts: 844
    Sorry! I was on my phone and didn't double-check, now there's egg on my face. Apologies to the incredibly talented @argent77 as well!
Sign In or Register to comment.