Skip to content

How to make the dialog for an Item Forge?

WithinAmnesiaWithinAmnesia Member Posts: 961
edited August 2018 in General Modding
Hello I am trying to replicate the item forge system of Taerom Thunderhammer but for a new smithy in the City of Baldur's Gate. I am having no luck in reproducing a new bug free item forge dialog in Baldur's Gate Arms and Armour Emporium; see for more information: https://forums.beamdog.com/discussion/71447/baldurs-gate-arms-and-armour-emporium/p1


I have a whole bunch of item upgrades created but now I am trying to get a working dialog to forge these item upgrades. For example I have an upgraded Longsword +2 'Varscona' SW1H06 via Longsword +3 'Varscona' OSW1H06+ which requires gold and some other valuable items to upgrade from the original +2 version.

I have not done custom dialogs mostly outside of Item Descriptions so this area is a bit new to myself and any help and or guide would be greatly appreciated. I am looking for any help and or guide to make a proper item forge dialog; the item files are ready to go it is just I am stalling in how to construct the dialog.

Comments

  • ArunsunArunsun Member Posts: 1,592
    edited August 2018
    Taking your example, let's say you need Varscona+2 and 5k gold to make Varscona +3:
    You need to create a something.d file and write your code in that file. Everything after the // on each lines is a comment I had to help you understand.
    
    BEGIN filename
    
    IF ~TRUE()~ craft  //This is the line where you decide when this dialog state will be available. Here, since it's the initial dialog that should always happen when you talk to the guy, the condition must always be verified, hence the TRUE(), which is a trigger that always returns TRUE. craft is the name of the state. I will use it later
    
    
    SAY ~Choose an item to craft~ // This is the line where you decide what the NPC you're talking to will say
    
    +~PartyHasItem("SW1H06") PartyGoldGT(5000)~+~Craft Varscona+3~ + varscona
            //This is an answer line, the format is "~condition for the answer to appear~ + ~What will be said~ DO ~Action that will be triggered upon choosing the answer. Here, there is nothing to do so just don't put anything.~+nameofthenextstate".
           // If you want to add options just copy this line, and change the conditions, the line that's displayed and the state name at the end of the line
    
    +~TRUE()~+~Quit crafting~+ EXIT           //This line is just like the one above, except it will always appear, and allows you to leave the dialog. 
    //When building a dialog, you should be careful to always have at least one option that appears in every situation to avoid errors.
    
    END //At the end of a state, there must always be a END
    
    
    //This will be the template for the confirmation 
    IF ~~ varscona //Same as the line with IF above, except here there is no condition to arrive to that state, meaning you can only ever get there if a previous step of the dialog led you here.
    SAY ~Using Varscona +2 and a 5000 gold, you may craft Varscona +3~
    
    +~PartyHasItem("SW1H06") PartyGoldGT(5000)~ +~Craft Varscona+3~ 
    	DO ~TakePartyItemNum("SW1H06",1) //Takes 1 Varscona+2 from the party
    		TakePartyGold(5000) //Takes 5k gold from the party
     		GiveItemCreate("OSW1H06+",LastTalkedToBy,1,0,0) //Gives the new Varscona to the one talking to the NPC
    		DestroyItem("SW1H06")~ //Destroys Varscona +2 from the NPC inventory. This prevents looting the item if you kill the NPC or if its inventory is full
    	+craft //returns to the list of crafts
    
    
    +~TRUE()~+~Craft something else~+craft
    
    END
    The code with no comments and a couple of other items to give you an idea what a final dialog would look like:

    BEGIN filename IF ~TRUE()~ craft SAY ~Choose an item to craft~ +~PartyHasItem("SW1H06") PartyGoldGT(5000)~+~Craft Varscona+3~ + varscona +~PartyHasItem("CHAN03") PartyGoldGT(5000)~+~Craft Mail of the Dead +3~ + deadmail +~TRUE()~+~Quit crafting~+ EXIT END IF ~~ varscona SAY ~Using Varscona +2 and a 5000 gold, you may craft Varscona +3~ +~PartyHasItem("SW1H06") PartyGoldGT(5000)~ +~Craft Varscona+3~ DO ~TakePartyItemNum("SW1H06",1) TakePartyGold(5000) GiveItemCreate("OSW1H06+",LastTalkedToBy,1,0,0) DestroyItem("SW1H06")~ +craft +~TRUE()~+~Craft something else~+craft IF ~~ deadmail SAY ~Using Mail of the Dead+2 and a 5000 gold, you may craft Mail of the Dead +3~ +~PartyHasItem("CHAN03") PartyGoldGT(5000)~ +~Craft Mail of the Dead+3~ DO ~TakePartyItemNum("CHAN03",1) TakePartyGold(5000) GiveItemCreate("ZKCHAN03",LastTalkedToBy,1,0,0) DestroyItem("CHAN03")~ +craft +~TRUE()~+~Craft something else~+craft END

    Feel free to ask if you have any question.
  • RaduzielRaduziel Member Posts: 4,714
    Arunsun's walkthrough is very detailed, but you can try to reverse-engineer the Talanthyr's Items Upgrade mod.
  • WithinAmnesiaWithinAmnesia Member Posts: 961
    edited August 2018
    @Arunsun the NPC is called Michael and is OLMICHAEL.CRE. I am thinking that I should properly go about this and bite the bullet and do a good WeiDU install file to update the dialog anyway for a proper release; also to avoid bugs. Is there a preexisting WieDU template out there or could one be created where one can input something like this around the proper code framework? Example:

    Base Item: SW1H06
    Upgraded Item: OSW1H06+
    Upgrade Requirement: 6000 Gold, Potion of Power POTN41, Potion of Frost Giant Strength POTN04, Potion of Invulnerability POTN11, Potion of Magic Protection POTN34, Longsword +2 'Varscona' SW1H06
    Upgrade Time -Days-: 1

    I know that there are globals and journal entries in there somewhere but a template of sorts could really empower myself for this is a bit outside of my skill zone.

    Also I have another module for upgrading armour at temples that would utilize the same dialog mechanics to upgrade items. Of which covers every magic armour in the game split into three variants with more powerful blessing scaling with more powerful enchantments from +1 to +5. Once blessed the suit of armour requires either Good, Neutral or Evil depending on the temple the armour was blessed at. All of the blessed items are already mostly finished and the bottle neck is again my lack of skills with dialog; thus I have come seeking aid.

    I am looking for help with how to put the dialogs and the installer together for a few polished chucks of content that I am pushing to get released. Usually there is a team of people but I find bundling issues in areas of my weaknesses to have specialized people solve with their strengths works reliably to get a good result.

    The community could have a bunch of high quality content but I realize that I cannot do everything myself; the dialog and installer are my biggest weaknesses. If I can get help in these areas where I am weak at to round out the content pipeline I can release a whole bunch of content that I have been working on for years, encounters, item upgrades to new areas and Non-Player Characters. If I had more money to spend on happiness other than building a house currently I would look to commission people for templates but I can currently only do so much at a time.
  • ArunsunArunsun Member Posts: 1,592
    I am not sure at what step you are blocked at exactly.
    Is it the dialog file itself?
    Or the creation of an install file that will incorporate the items, the NPC and its dialog to the game?
    Concerning the upgrade time, it takes some extra scripting, I don't have the time to detail it right now but I'll make sure to explain the process as soon as I can
  • WithinAmnesiaWithinAmnesia Member Posts: 961
    edited August 2018
    @Arunsun Well don't you have to add new strings for new lines of dialog and to do that and play nice with other mods don't you have to compile WieDU so that during install new lines from other mods can be added on top of it and there are not problems?

    Anyway I want to get the module to have a standard WieDU installer. I am not very good with compiling the WieDU installer. I have added items with a WieDU installer with great difficultly (this is not my element) that can be installed and uninstalled without error. I have not done this for Dialog trees and other related areas and I am blind in these areas yet I must find solutions to complete these bundles of content to release to the community.

    I speculate that it would be inevitable for the dialog and the items and other related files to be within the same WieDU installer. I am not knowing as to how the dialog files and adding string references are made to be compatible to installing and uninstalling the mod. I am looking for help in this area.

    What I am looking for is a way to complete Michael's dialog tree in such a way that the working bits with the item upgrades can be copied and have the related files and details swapped out for additional item upgrades to empower the content to have a lot of content in areas where I have little skill but must complete in order to launch the module to the community.

    I am also looking to copy Michael's dialog upgrade mechanics and swap out Michael's dialog lines with those that suit members of Good, Neutral and Evil temples in the game to also have working item upgrade mechanics for another module that I also am working on.

    I am just trying to communicate in an area that I have little skill in. The the bottleneck with myself is the whole process with how to create working dialog trees and WieDU installers. I am looking for help in these areas where I have little to no skill in order to release the content that I am am pressing to get launched to the community.
  • ArunsunArunsun Member Posts: 1,592
    Well, what you have to do is:
    -Make a copy of the latest version of WeiDu (the .exe file) and name it the same name as your mod
    -Make a folder with the same name as your mod


    Within the folder, you must add:
    -Subfolders for the different types of files (dialog, cre, itm,...). And put the files in the appropriate folder. Putting it in the right folder is not mandatory, but it is better if you want to find everything easily.
    -A .tp2 file that will handle the instructions for the install.

    Let's pretend your mod will be called WeaponForge and it includes only one blacksmith with one dialog and a few items. The TP2 will look like that:
    
    AUTHOR ~WithinAmnesia~
    
    VERSION ~1.0~
    
    BEGIN ~Weapon Forge~
    
    COPY ~WeaponForge/itm~ ~override~ //this line will copy everything in the itm folder to the override folder where the mods are installed.
    COPY ~WeaponForge/cre~ ~override~ //Same thing, with the files within the cre folder. You should have put only the blacksmith file here.
    COMPILE ~WeaponForge/dlg/filename.d~ //This will compile the .d file I wrote above. compiling the d file will ensure formating the d file into a dlg file which and attributing the right string reference to each of the strings of the dialog, by adding them to the dialog.tlk file.
    
    
    
    You should register your own modding prefix there:
    http://forums.blackwyrmlair.net/index.php?showtopic=113

    Prefixes usually are 2 characters used to identify files from mods, so that your items will not have the same name as items from other mods.


    Concerning the other question about how to handle different alignments, I invite you to take a look at the different script/dialog triggers:
    https://gibberlings3.github.io/iesdp/scripting/triggers/bgeetriggers.htm
    And more specifically the alignment one. If you want a dialog that is different for an evil and a good/neutral guy, you may alter the dialog like that:

    BEGIN filename IF ~OR(2) Alignment(LastTalkedToBy,0x01) Alignment(LastTalkedToBy,0x02)~ craft //the alignment hexadecimal values can be found here https://gibberlings3.github.io/iesdp/files/ids/bgee/align.htm. This dialog state will trigger if the one talking to the blacksmith is either good or neutral. SAY ~Greetings, my friend. What can I do for you today?~ +~PartyHasItem("SW1H06") PartyGoldGT(5000)~+~Craft Varscona+3~ + varscona +~PartyHasItem("CHAN03") PartyGoldGT(5000)~+~Craft Mail of the Dead +3~ + deadmail +~TRUE()~+~Quit crafting~+ EXIT END IF ~Alignment(LastTalkedToBy,0x03)~ //This one will trigger if the character is Evil SAY ~Get away from here. We do not serve evil monsters here.~ EXIT END IF ~~ varscona SAY ~Using Varscona +2 and a 5000 gold, you may craft Varscona +3~ +~PartyHasItem("SW1H06") PartyGoldGT(5000)~ +~Craft Varscona+3~ DO ~TakePartyItemNum("SW1H06",1) TakePartyGold(5000) GiveItemCreate("OSW1H06+",LastTalkedToBy,1,0,0) DestroyItem("SW1H06")~ +craft +~TRUE()~+~Craft something else~+craft IF ~~ deadmail SAY ~Using Mail of the Dead+2 and a 5000 gold, you may craft Mail of the Dead +3~ +~PartyHasItem("CHAN03") PartyGoldGT(5000)~ +~Craft Mail of the Dead+3~ DO ~TakePartyItemNum("CHAN03",1) TakePartyGold(5000) GiveItemCreate("ZKCHAN03",LastTalkedToBy,1,0,0) DestroyItem("CHAN03")~ +craft +~TRUE()~+~Craft something else~+craft END
  • GwendolyneGwendolyne Member Posts: 461
    Or a more "readable" way:
    IF ~Alignment(LastTalkedToBy,MASK_GOOD)~ ...
    IF ~Alignment(LastTalkedToBy,MASK_EVIL)~ ...
    IF ~Alignment(LastTalkedToBy,MASK_NEUTRAL)~ ...
    IF ~Alignment(LastTalkedToBy,CHAOTIC_NEUTRAL)~ ...
    IF ~Alignment(LastTalkedToBy,LAWFUL_GOOD)~ ...
    IF ~Alignment(LastTalkedToBy,NEUTRAL_EVIL)~ ...
    Note that IF ~condition~ THEN ... and + ~condition~ + ... produce the same code.
  • WithinAmnesiaWithinAmnesia Member Posts: 961
    @Arunsun @Gwendolyne Ah sorry for the long delay, I have been working pretty steady since the 10th. I greatly appreciate the help in this area of Baldur's Gate content creation. The issue I have now is time, I need to get my house built and real life is eating up my time right now. I will get more time, I just need to juggle a few things at once right now.

    Basically House -> Make Video Games is the order where all of my time is currently going. Also I do not know if you guys play World of Warcraft but I am also Raiding Classic Naxxramas so that happens on the weekends. Good times with raid potion farm x.x.

    I want to press this content to release sometime (hopefully) Q4 of this year or Q1 of 2019. I have too many irons in the fire and I feel that I must bang a few out into proper content; bla bla bla etc. etc. etc. It is happening one way or another but I got to cleave out some bumps in the road first before I get more time to spend on happiness. Hopefully on the weekend I can plunge into this some more;-).
  • WithinAmnesiaWithinAmnesia Member Posts: 961
    I am not dead, I am taking a break from work for a while and recovering from a cold. I almost have my foundation ready for my house. I think that I should take another crack at the item forge mechanics.
  • WithinAmnesiaWithinAmnesia Member Posts: 961
    I should try and set up a Pay Pal account or something and just pay people perhaps who are really talented in areas where I am not. I do not think most big modules are made by one person. Also this project keeps haunting myself.

    I would rather just pay a person like 500 bucks (or what ever is reasonable) and get a template down to add content into to streamline this end of the content pipeline where I am really more struggling than anything else.

    It seems that I have myself in a deadlock where I will only produce high quality content yet I need to get the dialog and guts of the module made and I am very low in quality in terms to manufacture in such areas.

    So I end up having one area of the content overflowing and having one big bottle neck slowing everything down for I am not great at translating my content into a downloadable file and making proper dialog trees.

    Honestly I would rather just pay a person to get the guts of the module made while I work on the areas I am strong at instead of being an eccentric wheel and kind of just thunking along almost like a square wheel; grinding out progress.

    I pay professional construction / machine / lumber / house building material people to help build my house so this is really no different; it is just that I cannot ram handfuls of cash through a computer screen.

    I do not really spend money on leisure (no drinking, being stupid, lazy etc.) everything I do is work, work, work (too hungry, I got the fire) so really the money is better spent on this project for people can enjoy it. I do not overly know why I enjoy making things for people, it is just my nature; it makes myself happy.

    I do not know if anyone would be interested in taking such a commission (it is kind of a small creative community after all) although once I get my bank information sorted out (I had to re-do my ID etc.) I can get my Pay Pal account working properly.

    Really all of this would be a good prototype to hiring people and doing more commission work online for my original video games anyway. So all of it is kind of like practical education and hands on experience in the industry. So I win as well. Really it is a win, win.
  • WithinAmnesiaWithinAmnesia Member Posts: 961
    Oh also I built an office and got my super computer up and going so I can make kick ass video games, my small house is being built as well in the meantime to never waist time. So now I am after making video games moreso now. Any help would be nice although I am pushing to get to a spot where I can properly pay people to do something they are talented at and make high quality projects become reality from fantasy.
Sign In or Register to comment.