Skip to content

General mod Questions thread

1212224262770

Comments

  • BubbBubb Member Posts: 1,001
    edited May 2018
    I've been using Near Infinity's BAM editor to extract single-frames of certain GUI elements in order to use them as icons in UI.MENU. I've noticed, though, that apparently some of these GUI elements have "junk" transparency in them that aren't rendered in the BAM mode, but are in the icon mode (inside UI.MENU). Here's what I'm talking about:

    Correct Icon:

    Broken Transparency (notice the transparent pixels in the middle of the 2):

    Those pictures are a little small; I'm sorry if they are hard to see. The only way I've found of eliminating the junk transparency from a frame of a BAM is to literally take a screenshot of the Near Infinity window with "Enable transparency" unchecked, crop the image, then re-import it into Near Infinity. There certainly must be a better way, and thus I am posting this. Does anyone know of a way to remove the transparency from a BAM? Any help would be greatly appreciated!
  • argent77argent77 Member Posts: 3,434
    You could try to export BAM frames as BMP files (which ignore transparency information). Select BMP file type from the filter list in the export dialog. You might have to turn the images into truecolor mode afterwards with a graphics converter before reimporting them back into NI's BAM converter, or original transparency may be restored.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    How do you decompile a dialog into a readable .d file? I'm looking at the WeiDu documentation and I just can't see what the code is supposed to look like.
  • GwendolyneGwendolyne Member Posts: 461
    edited May 2018
    NI : Edit > Export > as WeiDU dialog file ;)

    WeiDU :
    weidu --transitive yourdialog.DLG --out "yourfolder"
    Post edited by Gwendolyne on
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Gwendolyne: All I get is a parsing error. I exported the file and put it in the IWD2 folder, override folder, and my mod folder, then added this code to my WeiDu file:

    BEGIN "shawford"

    weidu --transitive 12SHAWFO.DLG --out "testWeiDu"
  • GwendolyneGwendolyne Member Posts: 461
    Don't use a tp2 file to decompile it: either a command line, or a bat file.
  • The user and all related content has been deleted.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Gwendolyne: How do I use a command line? How do I use a bat file?

    @subtledoctor: Do you know what the DECOMPILE command looks like? I've looked for examples and I haven't been able to find the exact syntax.
  • GwendolyneGwendolyne Member Posts: 461
    edited May 2018
    Windows OS:

    1. Create a weidu_decompile.txt file in your game folder and be sure you have a WeiDU.exe.

    2. Copy paste

    weidu --transitive 12SHAWFO.DLG --out "absolute_path\testWeiDu"

    with absolute_path being for example "C:\path of your modding dev folder\"

    3. Then, rename weidu_decompile.txt as weidu_decompile.bat

    4. Double-click weidu_decompile.bat : 12SHAWFO.D will be created in C:\path of your modding dev folder\testWeiDu.



    in a tp2 file:
    COPY_EXISTING - ~12SHAWFO.dlg~ ~override~
        DECOMPILE_DLG_TO_D
    
    should create 12SHAWFO.d ("should" because never tested as DECOMPILE_DLG_TO_D is a deprecated command :))
    Post edited by Gwendolyne on
  • The user and all related content has been deleted.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @subtledoctor: The decompile code runs fine...

    COPY_EXISTING - ~12SHAWFO.dlg~ ~override~
    DECOMPILE_DLG_TO_D

    ...but it doesn't do anything. There is no .d file anywhere. I've searched the whole game directory for any file called 12SHAWFO, and the only ones there are .dlg files.

    @Gwendolyne: I'm still not sure I get what I need to do. I created a blank text file and an empty WeiDU.exe by copying a WeiDU setup file (Setup-testWeiDu.exe, from my test mod)...



    ...then booted up the .exe and tried to type in the command you gave me and pressed Enter. This is all I get.



    I've also tried pasting "weidu --transitive 12SHAWFO.DLG --out "C:\GOG Games\Icewind Dale 2\testWeiDu"" into the weidu_decompile.txt file, then renaming it to weidu_decompile.bat. But it doesn't become a .bat file; it's just a .txt file that has .bat at the end of the name. Double-clicking it does nothing.



    I've also tried running the WeiDU.exe in between each of these steps, but all it does is display the same messages it normally does. What am I missing here?
  • BubbBubb Member Posts: 1,001
    @semiticgod
    Regarding DECOMPILE_DLG_TO_D, it has a weird quirk where it doesn't rename the file. The DLG files it is spitting out are indeed .d files, it just doesn't change the file extension.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Bubb: I renamed the 12SHAWFO.dlg file in my override folder to 12SHAWFO.d. I can view the text, but the first half of the document is gibberish and the second half is disconnected triggers.

    DLG V1.0/ 0 h
    p > ` 2 -* 1* ÿÿÿÿ4* ÿÿÿÿ<* ÿÿÿÿ>* ÿÿÿÿ?* ÿÿÿÿA* ÿÿÿÿC* ÿÿÿÿD*
    ÿÿÿÿF* *, ÿÿÿÿ+, ÿÿÿÿ., ÿÿÿÿ6, ÿÿÿÿ}, ÿÿÿÿƒ, ÿÿÿÿ†, •, ÿÿÿÿ–, ÿÿÿÿŸ, ÿÿÿÿ , ÿÿÿÿ£, " ÿÿÿÿ¥, # ­, * ÿÿÿÿ°, + ÿÿÿÿµ, / ÿÿÿÿ¶, 3 ÿÿÿÿ·, 7 ÿÿÿÿ¸, 8 ÿÿÿÿ», : ÿÿÿÿ¾, < ÿÿÿÿ¿, = ÿÿÿÿÀ, ? Hs D Is E ÿÿÿÿLs H F K G N ÿÿÿÿH R ÿÿÿÿJ S ÿÿÿÿK T ÿÿÿÿL U ÿÿÿÿM Y ÿÿÿÿO Z P _ Ëœ f ÿÿÿÿÌœ g ÿÿÿÿ /* ÿÿÿÿÿÿÿÿ12Shawfo 0* ÿÿÿÿ 12Shawfo ÿÿÿÿ 12Shawfo ÿÿÿÿÿÿÿÿ12Shawfo =* =* ÿÿÿÿÿÿÿÿ12Shawfo. @* ÿÿÿÿÿÿÿÿ12Shawfo ÿÿÿÿÿÿÿÿ12Shawfo ÿÿÿÿÿÿÿÿ12Shawfo
    E* ÿÿÿÿ &, " 12Shawfo ', * 12Shawfo (, ÿÿÿÿ12Shawfo
    ), ÿÿÿÿ E* ÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿ12Shawfo
    ÿÿÿÿÿÿÿÿ12Shawfo
    ÿÿÿÿ 12Shawfo ~, ÿÿÿÿÿÿÿÿ12Shawfo ‚, ÿÿÿÿÿÿÿÿ …, ÿÿÿÿÿÿÿÿ ‰, ÿÿÿÿ12Shawfo , * 12Shawfo , * 12Shawfo ”, ÿÿÿÿ ÿÿÿÿÿÿÿÿ12Shawfo —,

    12Shawfo œ, 12Shawfo , * 12Shawfo ž, *

    12Shawfo * ÿÿÿÿÿÿÿÿ12Shawfo ¡, ÿÿÿÿ12Shawfo ¢, ÿÿÿÿ ¤, ÿÿÿÿÿÿÿÿ ¦, * ÿÿÿÿ12Shawfo ž, * ÿÿÿÿ12Shawfo §, * 12Shawfo ¨, * 12Shawfo ª, * 12Shawfo «, ÿÿÿÿ12Shawfo ¬, ÿÿÿÿ ¯, * ÿÿÿÿ 12Shawfo ±, ÿÿÿÿ12Shawfo ², ÿÿÿÿ12Shawfo ³, 12Shawfo ´, 12Shawfo ±, ÿÿÿÿ12Shawfo ², ÿÿÿÿ12Shawfo ³, 12Shawfo ´, 12Shawfo ±, ÿÿÿÿ12Shawfo ², ÿÿÿÿ12Shawfo ³, ! 12Shawfo ´, " 12Shawfo ÿÿÿÿÿÿÿÿ12Shawfo ¹, ÿÿÿÿÿÿÿÿ12Shawfo º, ÿÿÿÿÿÿÿÿ12Shawfo ¼, ÿÿÿÿ 12Shawfo ½, ÿÿÿÿ 12Shawfo- ½, ÿÿÿÿÿÿÿÿ12Shawfo- =* # =* $ $- * % 12Shawfo %- * & 12Shawfo '- * ' 12Shawfo (- ( ÿÿÿÿ12Shawfo )- ) ÿÿÿÿ12Shawfo- ÿÿÿÿÿÿÿÿ12Shawfo" D * 12Shawfo% E + 12Shawfo%
    Js ÿÿÿÿ! D , " 12Shawfo% E - # 12Shawfo% Js ÿÿÿÿÿÿÿÿ S . $ 12Shawfo% T / % 12Shawfo% U ÿÿÿÿÿÿÿÿ V 0 & 12Shawfo& W 1 ÿÿÿÿ X 2 ' 12Shawfo& X 3 ÿÿÿÿ ÿÿÿÿÿÿÿÿ12Shawfo' ÿÿÿÿÿÿÿÿ12Shawfo( ÿÿÿÿÿÿÿÿ12Shawfo) Z ÿÿÿÿÿÿÿÿ12Shawfo* [ ÿÿÿÿÿÿÿÿ12Shawfo* \ ÿÿÿÿÿÿÿÿ12Shawfo* ] ÿÿÿÿÿÿÿÿ12Shawfo* ^ ÿÿÿÿÿÿÿÿ _ 4 ( 12Shawfo% b 5 ) 12Shawfo% a 6 * 12Shawfo% c 7 + 12Shawfo% d ÿÿÿÿÿÿÿÿ e 8 , 12Shawfo% e 9 - 12Shawfo% e : . 12Shawfo% h ; / 12Shawfo% h < 0 12Shawfo% h = 1 12Shawfo% k ÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿ12Shawfo ð H K M ˜ \ ô g [ Š å Š o ' –  $ 9 # \ #  P Ï + ú N h " Š " ¬ " Î $ ò G 9 I ‚ " ¤ " Æ " è "
    M W M ¤ ( Ì ( ô ( ( D ( l S ¿ R M ^ M « S þ R P M  M ê S = R  M Ü M ) # L # o * ™ \ õ \ Q ^ ¯ ^
    ! U b! U ·! U " U a" U ¶" U # +# K# k# ‹# q ü# q m$ q Þ$ q O%  Ü%  i&  ö&  ƒ'  (  ( 0 Í( 0 ý( ^ [) ^ ¹) & ß) # * "* % G* # j* # * + ¸* + ã* + + + 9+ K „+ K Ï+ N , K h, 4 œ, 4 Ð, 4 - 4 8- 4 l- 4  - 4 Ô- 4 . ^ f. ^ Ä. W / W r/ w é/ P 90 P ‰0 / ¸0 P 1 P X1 P ¨1 P ø1 # 2 # >2 P Ž2 o ý2 P M3 o ¼3  L4 o »4 P 5  ›5 o
    6 P NumTimesTalkedTo(0)GlobalGT("Lumber_Quest", "GLOBAL", 0)
    Global("Arrow_Quest", "GLOBAL", 0)GlobalGT("Arrow_Quest", "GLOBAL", 0)
    Global("Dead_Goblin_Quest", "GLOBAL", 0)GlobalGT("Dead_Goblin_Quest", "GLOBAL", 0)
    Global("Palisade_Iron_Collar_Quest", "GLOBAL", 0)GlobalGT("Palisade_Iron_Collar_Quest", "GLOBAL", 0)
    GlobalLT("Palisade_Iron_Collar_Quest", "GLOBAL", 3)GlobalGT("Palisade_Iron_Collar_Quest", "GLOBAL", 2)
    Global("Shawford_Has_No_Pants", "GLOBAL", 0)
    Global("Shaengarne_Quest", "GLOBAL", 0)GlobalGT("Palisade_Iron_Collar_Quest", "GLOBAL", 2)
    Global("Shawford_Has_No_Pants", "GLOBAL", 1)
    Global("Shaengarne_Quest", "GLOBAL", 0)Global("Shaengarne_Quest", "GLOBAL", 1)GlobalGT("Shaengarne_Quest", "GLOBAL", 1)
    Global("Shaengarne_Bridge_Cleared", "GLOBAL", 1)Global("31bugGut_Dead", "GLOBAL", 0)Global("31bugGut_Dead", "GLOBAL", 1)Global("10Swift_Dead", "GLOBAL", 0)Global("10Swift_Dead", "GLOBAL", 1)GlobalGT("Crane_Wheel", "GLOBAL", 0)
    Global("Lumber_Quest_Aborted", "GLOBAL", 0)Global("Lumber_Quest_Aborted", "GLOBAL", 1)Global("Know_Olap", "GLOBAL", 0)Global("Crane_Wheel", "GLOBAL", 0)
    Global("Lumber_Quest_Aborted", "GLOBAL", 0)Global("Arrow_Quest", "GLOBAL", 1)Global("Arrow_Quest", "GLOBAL", 3)Global("Arrow_Quest", "GLOBAL", 4)GlobalLT("Arrow_Quest", "GLOBAL", 3)!Global("Koluhm_Dead", "GLOBAL", 1)
    Global("Know_Koluhm", "GLOBAL", 0)!Global("Koluhm_Dead", "GLOBAL", 1)
    GlobalGT("Know_Koluhm", "GLOBAL", 0)Global("Koluhm_Dead", "GLOBAL", 1)Global("Koluhm_Dead", "GLOBAL", 1)Global("Know_Koluhm", "GLOBAL", 0)Global("Know_Koluhm", "GLOBAL", 1)Global("Koluhm_Dead", "GLOBAL", 1)
    GlobalLT("Dead_Goblin_Quest", "GLOBAL", 2)Global("Koluhm_Dead", "GLOBAL", 1)
    GlobalLT("Dead_Goblin_Quest", "GLOBAL", 2)Global("Dead_Goblin_Quest", "GLOBAL", 2)Global("Dead_Goblin_Quest", "GLOBAL", 5)Global("Dead_Goblin_Quest", "GLOBAL", 4)Global("Dead_Goblin_Quest", "GLOBAL", 3)Global("Dead_Goblin_Quest", "GLOBAL", 1)Global("Know_Iron_Collar", "GLOBAL", 0)
    Global("Black_Geoffrey_Dead", "GLOBAL", 0)Global("Know_Iron_Collar", "GLOBAL", 1)
    Global("Black_Geoffrey_Dead", "GLOBAL", 0)Global("Black_Geoffrey_Dead", "GLOBAL", 1)
    Global("Koluhm_Dead", "GLOBAL", 1)Global("Black_Geoffrey_Dead", "GLOBAL", 1)
    Global("Koluhm_Dead", "GLOBAL", 0)Global("Know_Iron_Collar", "GLOBAL", 0)
    Global("Black_Geoffrey_Dead", "GLOBAL", 0)Global("Know_Iron_Collar", "GLOBAL", 1)
    Global("Black_Geoffrey_Dead", "GLOBAL", 0)Global("Black_Geoffrey_Dead", "GLOBAL", 1)
    Global("Koluhm_Dead", "GLOBAL", 1)Global("Black_Geoffrey_Dead", "GLOBAL", 1)
    Global("Koluhm_Dead", "GLOBAL", 0)Global("Know_Iron_Collar", "GLOBAL", 0)
    Global("Black_Geoffrey_Dead", "GLOBAL", 0)Global("Know_Iron_Collar", "GLOBAL", 1)
    Global("Black_Geoffrey_Dead", "GLOBAL", 0)Global("Black_Geoffrey_Dead", "GLOBAL", 1)
    Global("Koluhm_Dead", "GLOBAL", 1)Global("Black_Geoffrey_Dead", "GLOBAL", 1)
    Global("Koluhm_Dead", "GLOBAL", 0)Global("10Swift_Dead", "GLOBAL", 0)Global("10Swift_Dead", "GLOBAL", 1)Global("Black_Geoffrey_Dead", "GLOBAL", 1)Global("Palisade_Iron_Collar_Quest", "GLOBAL", 2)
    Global("Black_Geoffrey_Dead", "GLOBAL", 1)Global("Palisade_Iron_Collar_Quest", "GLOBAL", 2)
    Global("Black_Geoffrey_Dead", "GLOBAL", 0)Global("Black_Geoffrey_Dead", "GLOBAL", 0)
    GlobalLT("Palisade_Iron_Collar_Quest", "GLOBAL", 2)Global("Black_Geoffrey_Dead", "GLOBAL", 0)
    GlobalLT("Palisade_Iron_Collar_Quest", "GLOBAL", 2)Global("S_R_1", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("SC_Speech", "GLOBAL", 0)Global("SC_Speech", "GLOBAL", 1)Global("SC_Speech", "GLOBAL", 0)Global("SC_Speech", "GLOBAL", 1)Global("S_R_1", "GLOBAL", 1)Global("S_R_2", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)Global("S_R_2", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 1)Global("S_R_2", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)Global("S_R_2", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)Global("S_R_2", "GLOBAL", 0)Global("S_R_3", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 1)Global("S_R_2", "GLOBAL", 0)Global("S_R_3", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 1)Global("S_R_2", "GLOBAL", 1)Global("S_R_3", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 0)Global("S_R_2", "GLOBAL", 0)Global("S_R_3", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 1)Global("S_R_2", "GLOBAL", 0)Global("S_R_3", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)Global("S_R_1", "GLOBAL", 1)Global("S_R_2", "GLOBAL", 1)Global("S_R_3", "GLOBAL", 0)!ClassEx(Protagonist, Paladin)!ClassEx(Protagonist, Monk)GiveItemCreate("Misc07", Protagonist, 250, 0, 0)GiveItemCreate("Misc07", Protagonist, 250, 0, 0)SetGlobal("Goblins_Attack_Palisade", "GLOBAL", 1)
    StartCutSceneMode()
    StartCutScene("12cWar2")SetGlobal("Goblins_Attack_Palisade", "GLOBAL", 1)
    StartCutSceneMode()
    StartCutScene("12cWar0")SetGlobal("Lumber_Quest", "GLOBAL", 1)AddXpVar("Level_2_Average",10785)
    AddXpVar("Level_2_Easy",10794)
    SetGlobal("Arrow_Quest", "GLOBAL", 1)AddXpVar("Level_2_Average",10785)
    AddXpVar("Level_2_Average",10785)
    SetGlobal("Dead_Goblin_Quest", "GLOBAL", 1)SetGlobal("Dead_Goblin_Quest", "GLOBAL", 1)SetGlobal("Dead_Goblin_Quest", "GLOBAL", 1)SetGlobal("Dead_Goblin_Quest", "GLOBAL", 1)AddXpVar("Level_2_Easy",10785)
    SetGlobal("Dead_Goblin_Quest", "GLOBAL", 6)AddXpVar("Level_2_Easy",10785)
    SetGlobal("Dead_Goblin_Quest", "GLOBAL", 6)AddXpVar("Level_2_Average",10785)
    SetGlobal("Dead_Goblin_Quest", "GLOBAL", 6)AddXpVar("Level_2_Hard",10795)
    SetGlobal("Dead_Goblin_Quest", "GLOBAL", 6)SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 3)SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 3)SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 3)SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 3)SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 3)SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 3)SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 1)SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 1)SetGlobal("Goblins_Attack_Palisade", "GLOBAL", 1)
    StartCutSceneMode()
    StartCutScene("12cWar2")SetGlobal("Goblins_Attack_Palisade", "GLOBAL", 1)
    StartCutSceneMode()
    StartCutScene("12cWar0")AddXpVar("Level_2_Average",10785)
    SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 4)AddXpVar("Level_2_Average",10785)
    SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 3)AddXpVar("Level_2_Hard",10796)
    SetGlobal("Palisade_Iron_Collar_Quest", "GLOBAL", 3)
    SetGlobal("IC_Good", "GLOBAL", 1)SetGlobal("S_R_1", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 1000, 0, 0)SetGlobal("S_R_1", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 1000, 0, 0)SetGlobal("Shawford_Has_No_Pants", "GLOBAL", 1)SetGlobal("S_R_1", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 1000, 0, 0)SetGlobal("S_R_1", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 1000, 0, 0)SetGlobal("S_R_1", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 1000, 0, 0)SetGlobal("S_R_1", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 1000, 0, 0)SetGlobal("SC_Speech", "GLOBAL", 1)SetGlobal("SC_Speech", "GLOBAL", 1)SetGlobal("S_R_2", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 3000, 0, 0)SetGlobal("S_R_1", "GLOBAL", 1)SetGlobal("S_R_2", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 4000, 0, 0)SetGlobal("S_R_2", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 3000, 0, 0)SetGlobal("S_R_1", "GLOBAL", 1)SetGlobal("S_R_2", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 4000, 0, 0)SetGlobal("S_R_1", "GLOBAL", 1) SetGlobal("S_R_2", "GLOBAL", 1)SetGlobal("S_R_3", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 10000, 0, 0)SetGlobal("S_R_2", "GLOBAL", 1)SetGlobal("S_R_3", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 9000, 0, 0)SetGlobal("S_R_3", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 6000, 0, 0)SetGlobal("S_R_1", "GLOBAL", 1) SetGlobal("S_R_2", "GLOBAL", 1)SetGlobal("S_R_3", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 10000, 0, 0)SetGlobal("S_R_2", "GLOBAL", 1)SetGlobal("S_R_3", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 9000, 0, 0)SetGlobal("S_R_3", "GLOBAL", 1)GiveItemCreate("Misc07", Protagonist, 6000, 0, 0)

    Any ideas what went wrong?
  • BubbBubb Member Posts: 1,001
    @semiticgod
    OK, that's weird; that's definitely a DLG file (see the DLG v1 header). I'm using this, and it spits out the .d file (named as a .DLG file, mind you):
    COPY_EXISTING ~12SHAWFO.DLG~ ~override~ DECOMPILE_DLG_TO_D BUT_ONLY_IF_IT_CHANGES
    Maybe your "when" condition isn't succeeding on your copy operation? Are you using BUT_ONLY_IF_IT_CHANGES, or something different?
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Bubb: It worked! Adding "BUT_ONLY_IF_IT_CHANGES" got me a .dlg file that I could rename into a functioning .d file. The file had no paragraph breaks, but by copying the text over into Word and then copying it back, I got a 17-page list of all of Shawford's lines with the triggers and conditions, spread out in a way that I could easily view them.

    The only drawback is that all of Shawford's lines are rendered as string references, like #12345, so reading the file's text is a bit tricky. But if I poke around enough, I should be able to insert my own lines, then recompile it into a new .dlg file for the game. I notice that all of the BEGIN references in the .d file have the same number as the STATE references in Near Infinity, so I can read it more easily if Near Infinity is open in a separate window.

    I don't suppose anyone knows how to convert those #12345 string references into actual text?
  • BubbBubb Member Posts: 1,001
    edited May 2018
    @semiticgod
    So I played with this some more... and it appears that WeiDU only adds the comments in using the command-line mode of decompiling the .DLG files. It's really strange that your computer doesn't have the file association with .bat files set up, so we have to do this through the console, I guess (if you don't want to screw around in the registry to fix your .bat files).

    The easiest way to open the console in Windows is to search for CMD in the start menu. Right click the "Command Prompt" entry, press "Run as administrator." Now, (in File Explorer), navigate to the folder where weidu.exe and the DLG files are, click on the file path near the top of File Explorer, and copy the text. Type "cd " (note the space) into your CMD window, and then right click (this should paste the file-path you copied earlier into the CMD window). Press enter, and you should be in the directory you need to be in. Finally, type this command, and WeiDU should decompile the .DLG file for you:
    weidu --transitive 12SHAWFO.DLGYou can even use a * to tell WeiDU to decompile ALL the DLG files in the current directory:
    weidu --transitive *.DLG
  • argent77argent77 Member Posts: 3,434
    Or simply use Near Infinity to export DLG files as WeiDU D scripts. ;)
  • GwendolyneGwendolyne Member Posts: 461
    It was my first option: ;)

    NI : Edit > Export > as WeiDU dialog file ;)

    WeiDU :
    weidu --transitive yourdialog.DLG --out "yourfolder"

  • semiticgoddesssemiticgoddess Member Posts: 14,903
    How do I replace a string that's not being used by anything?

    My problem is that in IWD2, there are two different strings for, say, the description of the fighter class. One of them shows up in a .2da. In-game, that shows up in the Information screen. But the other string reference doesn't show up in any .2da or dialogue or anything like that. But in-game, it shows up on the level-up and character creation screens.

    Now, I've already successfully changed the first string. So, I've tweaked the .2da and the in-game Information screen shows the description I want. But the second string remains unchanged.

    Is it possible to use WeiDU to simply alter an existing string instead of creating a new string to replace it? Because the string reference I want to edit does not show up in any .itm, .spl, .dlg, .bcs, or .2da file.
  • BubbBubb Member Posts: 1,001
    @semiticgod
    STRING_SET will do the trick. Example syntax:
    STRING_SET 1 ~Hello World~
    If you want to evaluate any WeiDU variables that are inside your replacing string, use STRING_SET_EVALUATE instead.
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367

    Anyone know how to tell if a thief is stealth? Do they get STATE_INVISIBLE or something like that? (Specifically, can I use SPLPROT.2da to check whether a thief is hidden at any given moment?)

    You can detect if they are hidden with STATE_INVISIBLE, but cannot distinguish between stealth and invisibility, a successful Stealth check just applies the Invisibility opcode(20) for 20 seconds for "Normal" invisibility.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    edited May 2018
    Here's a question I answered myself, in case anyone has the same problem: if you want part of a script to only trigger once, you'll need to add a global variable to control it. Previously, I relied on killing the character with the script, but that didn't stop the script from firing again and again.

    IF
    HPPercentLT(Myself,10)
    Global("SCRIPT_HAS_ALREADY_FIRED_ONCE","GLOBAL",0)
    THEN
    RESPONSE #100

    SetGlobal("SCRIPT_HAS_ALREADY_FIRED_ONCE","GLOBAL",1)
    ScreenShake(30,25,25)
    SetGlobal("DO_SOMETHING_SCRIPTY","GLOBAL",1)
    OpenDoor("DOOR_TO_SOMEPLACE")
    END

    I also tried

    !Global("SCRIPT_HAS_ALREADY_FIRED_ONCE","GLOBAL",1)

    as a condition (that is, the variable has to NOT be 1, instead of having to be zero), but that ended up not working because another part of the script set that variable to 2, which also satisfied the above condition, triggering the same loop for a different reason.
  • BubbBubb Member Posts: 1,001
    edited May 2018
    Bubb said:

    I've been using Near Infinity's BAM editor to extract single-frames of certain GUI elements in order to use them as icons in UI.MENU. I've noticed, though, that apparently some of these GUI elements have "junk" transparency in them that aren't rendered in the BAM mode, but are in the icon mode (inside UI.MENU). Here's what I'm talking about:
    ...

    For anyone who was interested in a fix, I've finally found one. I tried everything I could imagine to alter these BAMs, including argent's suggestion, but nothing worked quite right. Finally I saw a connection between all of the broken BAMs - they were V2 instead of V1. Using Near Infinity, Export -> as BAM V1 fixed everything. I don't know *why* this fixes it.. but it does; so, yay!

    As an aside, @argent77, is there any reason for me to save my BAMs uncompressed as opposed to compressed? It seems that most vanilla BAMs are compressed, I just don't know if there is any downsides to doing so. Thanks!

    Edit: ARGH, I thought I had it, but turns out this method still produces some visual artifacts. If anyone can figure out a way of turning V2 BAMs into V1 BAMs without distortions, (especially GUIPRTC.BAM), I would very much appreciate it!
    Post edited by Bubb on
  • ArunsunArunsun Member Posts: 1,592
    edited May 2018
    Hello, I would like to make a quest mod that takes place in makes use of the Dragonspear map (The actual map, with a few modifications graphic modifications, namely removing most of the crusader things that remained there, but lore-wise it's where part of the quest happens, not a copy of it someplace else.).

    I would like to make it EET-compatible and to required the Worldmap mod, and there are things I am not sure how to do:

    From what I get, I need to make separate tpas, one for EET and one for BG2 installs, and in the global TP2 file it'll look like that:


    BEGIN ~Quest Mod (requires Worldmap or EET)~
    REQUIRE_PREDICATE (GAME_IS ~bg2ee eet~) ~Baldur's Gate Enhanced Edition / EET could not be detected.~
    ACTION_IF (GAME_IS ~bg2ee~) BEGIN
    INCLUDE ~filepath/QuestmodBG2EE.tpa~
    END ELSE ACTION_IF (GAME_IS ~eet~) BEGIN
    INCLUDE ~filepath/QuestmodEET.tpa~
    END


    with QuestmodEET.tpa and QuestmodBG2EE containing the instructions for EET and BG2EE respectively.

    Now, I believe EET can be installed with or without SoD content so my QuestmodEET.tpa file will look like that:


    ACTION_IF (GAME_INCLUDES ~sod~) BEGIN
    INCLUDE ~filepath/QuestmodEETwithSoD.tpa~
    END ELSE BEGIN
    INCLUDE ~filepath/QuestmodEETwithoutSoD.tpa~
    END


    With these two tpa files being respectively for EET with and without SoD.

    Then I need to make it require Worldmap and I am not sure at what point Worldmap is installed but I would guess it's to be installed last, so the following code won't work, right?:

    ACTION_IF (MOD_IS_INSTALLED Worldmap Worldmap)
    //here will go everything that needs to be done

    How do I proceed, then? Is the rest of this post correct?

    Also, in dialogs, when I use EXTERN filename labelname to a new dialog, how does it work? Do I have to put the entire filepath to the d file as filename? Or do I need to write both dialogs within one same d file, using multiple begins?
    Post edited by Arunsun on
  • argent77argent77 Member Posts: 3,434
    Bubb said:

    As an aside, @argent77, is there any reason for me to save my BAMs uncompressed as opposed to compressed? It seems that most vanilla BAMs are compressed, I just don't know if there is any downsides to doing so. Thanks!

    Uncompressed BAM were only really needed for some of the classic games (BG1 and possibly IWD) which didn't support compression. I think it's safe to enable compression for all your BAM files in EE.
  • BubbBubb Member Posts: 1,001
    How would I go about decompressing a PVRZ into a PVR file using WeiDU? I believe I need to use DECOMPRESS_REPLACE_FILE, but I am having trouble figuring out how I get the uncompressedlength which I need to pass in. Thanks!
  • argent77argent77 Member Posts: 3,434
    Bubb said:

    How would I go about decompressing a PVRZ into a PVR file using WeiDU? I believe I need to use DECOMPRESS_REPLACE_FILE, but I am having trouble figuring out how I get the uncompressedlength which I need to pass in. Thanks!

    Read uncompressed size from offset 0 of the PVRZ file. I haven't tested it, but this code should work:
    COPY_EXISTING ~example.pvrz~ ~override/example.pvr~ READ_LONG 0 uncSize DECOMPRESS_REPLACE_FILE 4 (BUFFER_LENGTH - 4) uncSize
  • BubbBubb Member Posts: 1,001
    edited May 2018
    Thank you argent, that worked perfectly.

    And, OK, it feels like i am starting to spam this thread now, but I have *truly* found a way to fix the distortions when exporting V2 BAMs, and I think it would be useful for others to know. It requires a program called ffmpeg; simply run these commands on the desired exported frame, and the exported frame will import correctly back into Near Infinity:
    ffmpeg -i source_frame.png -vf palettegen palette.png ffmpeg -i source_frame.png -i palette.png -filter_complex paletteuse source_frame.pngYou can delete palette.png when you are done, it serves no purpose after the conversion.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Bubb: Don't worry about spamming this thread; all of these questions are helpful to more than just one person.

    Besides, half of the last two pages were my posts, and the end result was several major improvements to the semiOverhaul mod. This discussion is productive; there should be lots of posts here.
Sign In or Register to comment.