Icewind Dale 2 - so I wonder

Discussion in 'Icewind Dale Total Conversion' started by anatoliy, Aug 24, 2021.

Remove all ads!
  1. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    Last edited: Apr 23, 2022
  2. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,744
    Likes Received:
    375
    Keep in mind (since the effort to add multicolour variants of armour is ecessive) that we added many colours of cloaks and hats, and in KotB (possibly ToEE as well) you can buy them in party-sized groups, so you can pretty much outfit your party in matching gear very quickly.

    EDIT: You said distinguish, as in tell them apart? Heh, maybe I am the only one who goes for a uniform look.... never mind :) But the cloaks and hats and boots and such we added can all do that job nicely.
     
    Last edited: Apr 23, 2022
  3. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Awesome!
    As always, I recommend not to sweat the small stuff and concentrate on getting it playable from start to finish as 1st priority.
     
    Oleg Ben Loleg and anatoliy like this.
  4. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    255
    If Dash is as important as you claim it to be... just give those NPC's an extra 5' movement speed, job done.
     
  5. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    You suggested a workaround, which will work, sure :)

    But correct fix is not so hard to make. So it's better to have a feat :)
     
  6. Endarire

    Endarire Ronald Rynnwrathi

    Joined:
    Jan 7, 2004
    Messages:
    986
    Likes Received:
    121
    Fleet of Foot is an official 3.5 feat (by RAW available only at level 1 and only to certain races) that gives +10' move speed.
     
    anatoliy likes this.
  7. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    Automated more folks:
    2022-03-24.jpg

    So far scripts are generated by my pyproduce script.

    Funny thing, if they want to add some ability or condition they create invisible item with these conditions and place on the NPC. So Wolf has at slot Weapon1 invisible natural attack item.
     
    Shiningted and Buffed Rabbit like this.
  8. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    Had a lot of fun with dialogs, made good progress in the Infinity to Temple scripting conversion.

    Essentially I decided to use almost one-to-one scripts from IWD2.

    Dialog start example:
    Code:
        def script_dialog(self, attachee, triggerer):
            print("script_dialog 10HEDRON")
            assert isinstance(attachee, toee.PyObjHandle)
            assert isinstance(triggerer, toee.PyObjHandle)
           
            attachee.turn_towards(triggerer)
           
            line_id = -1
            while True:
                print("STATE 0")
                # NumTimesTalkedTo(0)
                if self.iNumTimesTalkedTo(0):
                    line_id = 10 # Well, here ye are, straight from Bremen to the scenic shore of Targos herself.  Now that ye be seeing the skeleton of the town ye'll be defendin', ye sure ye don't want me to take ye back?
                    print("STATE 0: line_id = 10")
                    break
               
                print("STATE 21")
                # GlobalGT("Reig_Quest", "GLOBAL", 0)
                # Global("Dock_Goblin_Quest", "GLOBAL", 0)
                # Global("Hedron_Know_Attack", "GLOBAL", 0)
                if self.iGlobalGT("Reig_Quest", "GLOBAL", 0) \
                     and self.iGlobal("Dock_Goblin_Quest", "GLOBAL", 0) \
                     and self.iGlobal("Hedron_Know_Attack", "GLOBAL", 0):
                    line_id = 220 # I was hoping ye might come back - what's the word from the docks?  Not even Magdar's come out to shake me down yet, and he usually sends some half-drunk stumblers to help unload my supplies.
                    print("STATE 21: line_id = 220")
                    break
               
                print("STATE 30")
                # GlobalGT("Reig_Quest", "GLOBAL", 0)
                # GlobalLT("Hedron_Know_Attack", "GLOBAL", 2)
                if self.iGlobalGT("Reig_Quest", "GLOBAL", 0) \
                     and self.iGlobalLT("Hedron_Know_Attack", "GLOBAL", 2):
                    line_id = 310 # What's going on along the shore?  I heard something about an attack on the docks, but no one can tell me anything for certain.
                    print("STATE 30: line_id = 310")
                    break
    Dialog response condition example:
    Code:
        def dialog_test_do(self, npc, pc, index):
            assert isinstance(npc, toee.PyObjHandle)
            assert isinstance(pc, toee.PyObjHandle)
            assert isinstance(index, int)
           
            if index == 0:
                # Global("Firtha_Dead", "GLOBAL", 0)
                if self.iGlobal("Firtha_Dead", "GLOBAL", 0):
                    return True # 42: Mostly decent folk?
               
            elif index == 1:
                # GlobalLT("Hedron_Quest", "GLOBAL", 4)
                if self.iGlobalLT("Hedron_Quest", "GLOBAL", 4):
                    return True # 171: If your mother lives in Targos, why are you staying on the ship?
               
            elif index == 3:
                # Global("Firtha_Dead", "GLOBAL", 0)
                if self.iGlobal("Firtha_Dead", "GLOBAL", 0):
                    return True # 191: You named your ship after your mother?
    Dialog action example:
    Code:
        def dialog_action_do(self, npc, pc, index):
            assert isinstance(npc, toee.PyObjHandle)
            assert isinstance(pc, toee.PyObjHandle)
            assert isinstance(index, int)
           
            if index == 0:
                # SetGlobal("Know_Hedron", "GLOBAL", 1)
                self.iSetGlobal("Know_Hedron", "GLOBAL", 1)
                # 141: We'll be careful.  Farewell, Hedron.
               
            elif index == 1:
                # SetGlobal("Hedron_Know_Attack", "GLOBAL", 1)
                self.iSetGlobal("Hedron_Know_Attack", "GLOBAL", 1)
                # 221: The town's been attacked by goblins.  You'd best stay on the ship.
               
            elif index == 2:
                # SetGlobal("Hedron_Know_Attack", "GLOBAL", 1)
                self.iSetGlobal("Hedron_Know_Attack", "GLOBAL", 1)
                # 222: There's been an attack on the docks, and Targos has gained a number of bloodthirsty goblin citizens.
               
            elif index == 3:
                # SetGlobal("Hedron_Quest", "GLOBAL", 5)
                self.iSetGlobal("Hedron_Quest", "GLOBAL", 5)
                # 241: I'm afraid she didn't make it, Hedron... she, uh, was killed by goblins in her home.
               
            elif index == 4:
                # AddXpVar("Level_1_Easy",2578)
                self.iAddXpVar("Level_1_Easy", 2578)
                # SetGlobal("Hedron_Quest", "GLOBAL", 4)
                self.iSetGlobal("Hedron_Quest", "GLOBAL", 4)
                # 242: We already checked on her, Hedron.  Some goblins had broken into her house, but we took them out and rescued her.
    Full example: https://github.com/anatoliy-savchak...2_core/scr/py01001_targos_docks_encounters.py
    Dialog: https://github.com/anatoliy-savchak...d2_core/dlg/01001_targos_docks_encounters.dlg

    Dialog response example:
    Code:
    {263}{She's certainly got a tongue on her, no doubt.}{}{1} {ctrl(npc).dialog_test(npc, pc, 15)}{280}{ctrl(npc).dialog_action(npc, pc, 11)} # resp: 10HEDRON 57
    Implementation of scripting here: https://github.com/anatoliy-savchak/toee.zmod.iwd2/blob/main/src/zmod_iwd2_core/scr/inf_scripting.py

    Also speech is also working.

    Bottom line: dialog creation is going to be streamlined and automated.
     
    Sitra Achara, Shiningted and Allyx like this.
  9. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    You're probably anticipating the question :) why use item + condition instead of directly applying the condition or giving natural attacks in index field?
     
  10. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    I already thought this out )) But good catch here :)

    Instead of making some sort of direct mapping "00HELM01" -> "const_proto_cloth.PROTO_CLOTH_HELM_DRUIDIC" I use factory class pattern. So each item or item category has own factory class, which is called by npc producer in various places. One place would be in npc_char creation function where the factory class will produce natural attack settings.

    See ItemMiscMeleeNatural1d3 in (at the end now) here https://github.com/anatoliy-savchak/toee.zmod.iwd2/blob/main/utils/pyproduce/produce_items.py

    Similar way I do in IE script functions processing, for example GiveItemCreate function arguments replace:
    GiveItemCreate("Misc07", Protagonist, 73, 0, 0) =>
    utils_pc.pc_party_receive_money_and_print(73 * const_toee.gp)

    Another factory pattern is used in Animations.

    The issue of Animations is that NPC could look like it has a weapon and a shield (first Goblins) but in fact they have no these items. So factory of that particular animation will create non lootable items and equip them there.
     
  11. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    PORTRAITS

    Can anyone advise what to do with NPC portraits? Or for non existing in Temple monsters?

    For now there are no portraits (default black) as IWD2 does not have portraits for NPCs.

    My ideas are following:
    1) Create typical portrait for Animation + distinct characteristics like blond hair.
    2) Screen shot from IWD2 game or even draw snapshot in the Temple's dialog like in Inventory.
    3) Ask some enthusiast to create distinct portraits for this port.
     
  12. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    255
    For NPC's, take a look through the hundreds of portrait files already added to ToEE in Co8 portrait packs and use something that looks similar to what you're after.

    For Monsters, search around the internet for images of the creature you want, avoid art owned by corporations (WotC/Paizo etc.), there is usually fan art created by the community that is both good and free (legally and monetarily).

    If you need something specific that you can't find, ask the community here if anyone is able/capable/willing to make that something for you? Poke @maggit until they surrender time and effort to please your artistic desires.
     
    anatoliy likes this.
  13. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    Journal and quests issues

    2022-03-26.jpg

    As you can see, any journal text had to be splitted by 132 characters max in one record in the rumor window. I believe Logbook (Rumors) should be rewritten to support much longer text. @_doug_ ?

    Quests
    There are no specifically outlined quests in the IWD2. Although some globals look like "Hedron_Quest" they still need to be defined as separate text and script points.

    At this point I'm inclined to skip quest entries altogether and leave Journal mechanics as in IWD2.
     
  14. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    318
    Likes Received:
    143
    I took a brief look at the code and didn't see anything obvious that was causing the issue. The fix may be to replace that section of the GUI code which would take me a little while to do.

    BTW: I added Dash to temple+.

     
    anatoliy likes this.
  15. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    Yes, it would be grand! I would gladly assist you on that.

    That's awesome, thank you very much Sir!!
     
Our Host!