Skip to content

General mod Questions thread

1575860626370

Comments

  • AllbrotherAllbrother Member Posts: 261
    edited June 2019
    @Bubb

    Thanks for the reply and suggestion. But the default autopause (e.g. end of round) doesn't cancel queued actions, if the script is just firing it off, why would it behave differently?

    Also
    Bubb wrote: »
    @Allbrother: I've just had a look inside the PauseGame() assembly.

    How do you do that? Are the auto-pause options themselves moddable? Is it possible to take the end of round option, change the frequency and make it trigger really only once per round as opposed to once per round per character, as it currently does, which is what prompted me to look for alternatives in the first place?
  • BubbBubb Member Posts: 1,001
    @Allbrother: It's not the autopause that's canceling the queued actions, it's the fact that the creature is executing an action, (the PauseGame(), in this case).

    Basically I use a disassembler to view the raw x86 assembly instructions of the .exe, and figure out what it is doing from there. Very hard, wouldn't recommend it if you value your sanity :p

    But anyway - no, the auto-pause options are not moddable without directly modifying the .exe via some sort of hack like TobEx or EEex.
  • AllbrotherAllbrother Member Posts: 261
    Bubb wrote: »
    @Allbrother: It's not the autopause that's canceling the queued actions, it's the fact that the creature is executing an action, (the PauseGame(), in this case).

    Basically I use a disassembler to view the raw x86 assembly instructions of the .exe, and figure out what it is doing from there. Very hard, wouldn't recommend it if you value your sanity :p

    But anyway - no, the auto-pause options are not moddable without directly modifying the .exe via some sort of hack like TobEx or EEex.

    I see, thanks again. I'll try the invisible summon after I get some sleep
  • DavidWDavidW Member Posts: 823
    Stormfin wrote: »
    Hello!

    Question from a complete amateur - If I want to make a spell mod using pre-existing files in the game, do I need to do anything specific to make them compatible with mods like SCS, TnB and SR?

    If I install these mods first and then make my own files, is that the easiest way of ensuring compatibility?

    Cheers

    It depends how you define 'compatible'.

    Generally for compatibility, if you want to put your spells into the general namespace so they can be used by clerics, learned by sorcerers etc, you need to use WEIDU's ADD_SPELL to add them.

    SCS will be fine with new spells, though it might get confused if you edit existing spells. Its AI won't use your new spells, though. SCS is generally best installed late in the install order.

    SR doesn't add spells in a very compatibility-friendly way, so it's best to install SR *before* installing your spell mod.
  • StormfinStormfin Member Posts: 28
    Ok, that's good to know. Cheers!
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    The IESDP states that the old weapon proficiency system (i.e., offsets 0x006e – 0x0075 of a CRE file) is functional only in BG1 (original). That's outdated info since it seems to work fine on EEs. @Bubb Could you confirm?
  • BubbBubb Member Posts: 1,001
    @Luke93: It appears they still function. The weapon's item category must match the old proficiency type in the .ITM at offset 0x1C ->

    (Old prof to .ITM categories):
    Large swords = 20
    Small sword = 16 or 19
    Bow = 15
    Spear = 29 or 30
    Blunt = 17 or 21 or 26
    Spiked = 22 or 23
    Axe = 25
    Missile = 18 or 24 or 27

    The proficiency triggers can target them by using the 0-7 range:
    0 - Large sword
    1 - Small sword
    2 - Bow
    3 - Spear
    4 - Blunt
    5 - Spiked
    6 - Axe
    7 - Missile

    It doesn't appear that Opcode #233 can alter them. I don't know if they can be restored to character gen / level up.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @Bubb

    Thanks! Also, they're functional for every CLASS (offset 0x273), including the non-playable ones right (e.g., GENIE_DAO)?
  • AlonsoAlonso Member Posts: 806
    edited June 2019
    I want to learn how to use control structures in WeiDU, i. e., loops, conditional statements, etc. (Just in case, that's statements like IF, WHILE, FOR, and so on). Is that explained somewhere?
  •  TheArtisan TheArtisan Member Posts: 3,277
    Why on earth is the LastSummonerOf data not kept after reloading? Is there any way to fix this? I’m tired of having to key persistent summoned creatures to specific NPCs in their scripts in roundabout methods.
  • OlvynChuruOlvynChuru Member Posts: 3,076
    @Alonso Loops and conditional statements looks like this.

    If you're patching a file:
    FOR (i = 0; i < 50; ++i) BEGIN
    	PATCH_IF i > 10 BEGIN
    		PATCH_PRINT ~%i% is greater than 10~
    	END
    END
    

    If you're not patching a file:
    OUTER_FOR (i = 0; i < 50; ++i) BEGIN
    	ACTION_IF i > 10 BEGIN
    		PRINT ~%i% is greater than 10~
    	END
    END
    
  • AlonsoAlonso Member Posts: 806
    Thank you, @OlvynChuru!
  • AlonsoAlonso Member Posts: 806
    How do you escape ~ (tilde) characters in tra files?

    I have this string in a tra file:

    @115614 = ~Dradeel's Recipe:
    MONKEY BALLS (makes ~40)
    [More text]~

    WeiDU gives an error when it reads this string because of the ~ character before the number 40.
  • kjeronkjeron Member Posts: 2,367
    edited July 2019
    @Alonso There is no escape character in weidu, but it does have 4 different delimiters that you can use, so that you can use the others within:
    ~
    "
    %
    ~~~~~ (5x)
    ~~~~~Dradeel's Recipe:
    MONKEY BALLS (makes ~40)
    [More text]~~~~~
    
    Post edited by kjeron on
  • AlonsoAlonso Member Posts: 806
    edited July 2019
    Thank you, @kjeron!

    FYI: For whatever reason ~~~~~ (5x) didn't work in my mod, and I couldn't use " because it's also used in the same string, but % did the trick.
  • AlonsoAlonso Member Posts: 806
    What operators are available in WeiDU? Right now I need to use the "not equals" operator, but I'd also like to know what other operators are available. For "not equals" I've tried != but it doesn't seem to work.

    The code is:
    // Only write the identified name and description
    // if they actually exist
    PATCH_IF (~%identifiedName%~ STRING_MATCHES_REGEXP ~~ != 0) BEGIN
    	SAY NAME2 (AT identifiedName)
    	SAY DESC (AT identifiedDescription)
    END
    
  • kjeronkjeron Member Posts: 2,367
    This:
    ~string~ STRING_MATCHES_REGEXP ~~
    
    is always true (which for STRING_MATCHES_REGEXP true = 0).
    If you want to match an empty string, use:
    ~string~ STR_EQ ~~
    
    If you are reading these strings from in-game files, know that weidu doesn't read invalid string references as an empty string, but as this string (not including the ~'s):
    ~<Invalid Strref -1>~
    
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    Is it possible to prevent a ranger kit from getting vanilla spells? I'd like to give it my own spells........
  • The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @subtledoctor

    I see, it doesn't sound like a good implementation.... Moreover, it's not compatible with mods that add new spells (e.g., IWDification or SCS).
  • The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    What are exactly STATs #150 SUMMONDISABLE and #188 SUMMON_DISABLE_ACTION?
  •  TheArtisan TheArtisan Member Posts: 3,277
    Can someone show me a code to read the mxbrdspl.2da and check what the maximum spell level they get slots for is? Tweaks Anthology grants up to 7 and Rogue Rebalancing grants up to 8, and I want a more accurate check than just checking for those two mods.
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    edited July 2019
    Luke93 wrote: »
    What are exactly STATs #150 SUMMONDISABLE and #188 SUMMON_DISABLE_ACTION?
    When a creature is summoned, it is "disabled" until the summoning animation finishes playing. It exists, and can be hit by AoE spells, but is otherwise invisible, unselectable, and untargetable.
  • AlonsoAlonso Member Posts: 806
    edited July 2019
    kjeron wrote: »
    If you want to match an empty string, use:
    ~string~ STR_EQ ~~
    
    If you are reading these strings from in-game files, know that weidu doesn't read invalid string references as an empty string, but as this string (not including the ~'s):
    ~<Invalid Strref -1>~
    
    I had guessed that invalid string references would be read as something funny, so I created a tra file in which all the invalid string references are empty strings. So what I want to match are not empty strings, but rather the opposite: Non empty strings. That's why I need the operator "doesn't equal". What's that operator (or something equivalent) in WeiDU?
  • kjeronkjeron Member Posts: 2,367
    Alonso wrote: »
    I had guessed that invalid string references would be read as something funny, so I created a tra file in which all the invalid string references are empty strings. So what I want to match are not empty strings, but rather the opposite: Non empty strings. That's why I need the operator "doesn't equal". What's that operator (or something equivalent) in WeiDU?
    You had the correct operator "!=", just the wrong comparison before it.
    This:
    PATCH_IF (~%identifiedName%~ STRING_MATCHES_REGEXP ~~ != 0) BEGIN
    
    is always false, because the first arguement:
    ~%identifiedName%~ STRING_MATCHES_REGEXP ~~
    
    is always true, and for STRING_MATCHES_REGEXP, true = 0, so you end up with:
    PATCH_IF (0 != 0) BEGIN
    
    If you want to match non-empty strings:
    PATCH_IF (~string~ STR_EQ ~~) = 0 BEGIN
    // or 
    PATCH_IF (~string~ STR_EQ ~~) != 1 BEGIN
    // or
    PATCH_IF !(~string~ STR_EQ ~~) BEGIN
    
  • AlonsoAlonso Member Posts: 806
    @kjeron: Nice, that worked :)
  • RatatoskrRatatoskr Member Posts: 713
    Can anyone tell me if there's some trick to using PartyRested()?
    Nothing in my mod involving that trigger seems to be working.
  • BCaesarBCaesar Member Posts: 456
    Ratatoskr wrote: »
    Can anyone tell me if there's some trick to using PartyRested()?
    Nothing in my mod involving that trigger seems to be working.

    Yeah I've tried using that trigger several times and always gave up. I never could get it to work. The annoying thing is that the game seems to use it just fine as do other mods.
Sign In or Register to comment.