Skip to content

General mod Questions thread

1313234363770

Comments

  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @argent77 Thanks for your help!

    @Wisp I think you should include these 3 new functions into the next release of WeiDU.......
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited August 2018
    How can I delete multiple copies of the same opcode but with different resources via DELETE_EFFECT?
    Where's the error here?
    LPF DELETE_EFFECT
      INT_VAR
        match_opcode = 171
        verbose = 1
        check_globals = 0
      STR_VAR
        match_resource = ~A~
        match_resource = ~B~
        match_resource = ~C~
        // and so forth.....
    END
  • kjeronkjeron Member Posts: 2,367
    Luke93 said:

    How can I delete multiple copies of the same opcode but with different resources via DELETE_EFFECT?

    The function only allows one matched resource per call.
    LPF DELETE_EFFECT
      INT_VAR
        match_opcode = 171
        verbose = 1
        check_globals = 0
      STR_VAR
        match_resource = ~A~
    END
    LPF DELETE_EFFECT
      INT_VAR
        match_opcode = 171
        verbose = 1
        check_globals = 0
      STR_VAR
        match_resource = ~B~
    END
    LPF DELETE_EFFECT
      INT_VAR
        match_opcode = 171
        verbose = 1
        check_globals = 0
      STR_VAR
        match_resource = ~C~
    END
    Depending on how many resources you need to match, it may be more efficient to manually loop through the effects rather than use the DELETE_EFFECT function.
  • GwendolyneGwendolyne Member Posts: 461
    Luke93 said:

    How can I delete multiple copies of the same opcode but with different resources via DELETE_EFFECT?
    Where's the error here?

    LPF DELETE_EFFECT
      INT_VAR
        match_opcode = 171
        verbose = 1
        check_globals = 0
      STR_VAR
        match_resource = ~A~
        match_resource = ~B~
        match_resource = ~C~
        // and so forth.....
    END
    PATCH_FOR_EACH resource IN A B C BEGIN
    	LPF DELETE_EFFECT INT_VAR check_globals = 0 match_opcode = 171 verbose = 1 STR_VAR match_resource = EVAL "%resource%" END
    END
  • RaduzielRaduziel Member Posts: 4,714
    What this "verbose" does? Never saw it in any code.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited August 2018
    @kjeron @Gwendolyne Thanks! But then what multi_match is for? If I set it to, say, 3, it means that the function will delete 3 opcode #171 with those resources?

    @Raduziel
    INT_VAR verbose to whether the function should provide some rudimentary information on how many effects were deleted (default is 0).
  • GwendolyneGwendolyne Member Posts: 461
    edited August 2018
    @Raduziel: using silent allows to avoid warning messages if the matched parameters do not exist in your file. It is very useful when you use automatic processes, or home made functions, to patch many files on the go. verbose is mostly used for debugging purpose when you write your code.

    @Luke93: yes. In your case, the function will delete the 3 first effects found matching opcode #171 and resource = A, then, the 3 first effects matching opcode #171 and resource = B... But if you want to delete all opcode #171, regardless of their resource name, simply use
    DELETE_ITEM_EFFECT INT_VAR opcode_to_delete = 171 END
    DELETE_SPELL_EFFECT INT_VAR opcode_to_delete = 171 END
    DELETE_CRE_EFFECT INT_VAR opcode_to_delete = 171 END
    Post edited by Gwendolyne on
  • The user and all related content has been deleted.
  • BubbBubb Member Posts: 1,000
    Is there any way to escape characters in WeiDU strings? For example, in Java and other languages if you wanted into include a quotation mark in a string you would do this: "\"Hello World\"".

    I know that you can use different characters to denote strings in WeiDU, such as %, ~, and ~~~~~. The problem is that I am generating strings via an external program, and I cannot guarantee that these string denoting sequences do not appear. I thought the five tilde marks would be good enough, but even that appears in my strings.

    So, is there any way I could represent either ", %, or ~ in my strings without literally writing them? I think I could use a variable to inline quotes and such, but that seems like an awfully round-about way of handling this.

    Thanks in advance!
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018
    Question:

    I want to build a script that when a character with a given kit starts BG2EE or ToB his/her kit will be automatically changed to another one and a "traified" string is displayed.

    This should only happen if the new kit is installed, by the way. My plan for doing this is adding the extend bottom command in the tpa of the second kit, so if it not installed there will be no script to run. I don't know if it is the optimal approach.

    Any insights?

    Thanks!
  • GwendolyneGwendolyne Member Posts: 461
    edited August 2018
    I wrote a script that modifies the character's kit if you tried to create a male Unicorn Rider: it is forbidden!
    You have the choice to revert your PC to a plain paladin, or a kitted one.
    I will PM it this afternoon, once back home. ;)
    Post edited by Gwendolyne on
  • RaduzielRaduziel Member Posts: 4,714
    @Gwendolyne thanks! I appreciate it :)
  • ArunsunArunsun Member Posts: 1,592
    How often is baldur.bcs processed?
    Once per second? Per round? Per frame?
  • fluke13fluke13 Member Posts: 399
    Hi all, I had a couple of modding questions. Two mechanics I use when modding are... Invisible creature and random treasure. I've seen these implemented in many different ways, but what do people think is the best way? Simplest, most effective.

    For invisible creatures... Use a ring item, deactivate script, state invisible in cre file etc...
    For random treasure... Scripting- in cre script, area script, item effects, spells etc...

    All thoughts welcome from the obvious to out of the box thinking. Cheers :)
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    edited August 2018
    Arunsun said:

    How often is baldur.bcs processed?
    Once per second? Per round? Per frame?

    twice per second
  • ArunsunArunsun Member Posts: 1,592
    kjeron said:

    Arunsun said:

    How often is baldur.bcs processed?
    Once per second? Per round? Per frame?

    twice per second
    So let's say I want to make an out-of-combat movement speed bonus, I could add that to Baldur.BCS?
    
      IF
        !ActuallyInCombat()
      THEN
        RESPONSE #100
            ApplySpellRES(Player1,"ZKMSBON")
     	ApplySpellRES(Player2,"ZKMSBON")
     	ApplySpellRES(Player3,"ZKMSBON")
    	ApplySpellRES(Player4,"ZKMSBON")
     	ApplySpellRES(Player5,"ZKMSBON")
     	ApplySpellRES(Player6,"ZKMSBON")
    
      END
    With ZKMSBON being a self-targeted spell that grants bonus movespeed for a second (and removes its previous applications).
    Would that cause any lag? I know that in the past, an overloaded baldur.bcs has caused my game to get slow, especially in inventory.
  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    @Arunsun - You would need a Continue() command in the script block. Otherwise this block will prevent everything below it in BALDUR.BCS from firing (except during combat).
  • fluke13fluke13 Member Posts: 399
    I think my invisible creature works ok - I have the animation set to the one with no bams, I have the invulnerability ring and added the no foot circle to it.

    Random treasure - a code in the area file that does a one time random GiveItemCreate("xxx","xxx",1,1,0) to all the creatures that are barrels. For containers - I'm really not sure... I assume the only way is by adding a item that you cant see or touch, which randomly adds more items? Or is there a game mechanic/op code that can be utilised?
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited September 2018
    When using WRITE_ASCII, is it important to specify a requiredSize ?
  • GwendolyneGwendolyne Member Posts: 461
    edited September 2018
    Luke93 said:

    When using WRITE_ASCII, is it important to specify a requiredSize ?

    Yes.

    1) If you overwrite an existing data. For example, changing inventory icon from IAMUL02 to MYAMUL without specifying #8, the result will be MYAMUL2 and won't display your icon in game.

    2) If you write a data whose length is longer than the field size, it will overlap the next offset and may (mostly will) either modify other data or corrupt your file.
  • fluke13fluke13 Member Posts: 399
    Does anyone know how the game recognises which portrait you have? Like in bg1, if you choose Edwin's portrait for your pc, then Edwin gets his alternative portrait. I've given some iwd2 characters some portraits, but I'd like them to change if the pc is using the same one. I can't find anything in IESDP.
  •  TheArtisan TheArtisan Member Posts: 3,277
    @fluke13

    Check the PORTRAIT.2DA file. I've never used it but it seems to be what determines the replacement portrait.
  • RaduzielRaduziel Member Posts: 4,714
    edited September 2018
    Is there a way to alter a release on GitHub (using the site as I'm too dumb to know how to use Git programs)?

    I have some minor changes that I would like to add to a current release (DoF 1.9.0) instead of starting a new one.

    Thanks.
  • The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714

    @Raduziel i don't know the definitive answer but I do know that Releases seem finicky on Github. Why not make a small new release? 1.9.1 or 1.9.0.1 or 1.9.0a or whatever

    Because OCD is a b*tch, especially combined with PTSD.

    But I'll do my best, thanks!
  • SirBatinceSirBatince Member Posts: 882
    Which 2DA controls the AC progress of monk class?

    is it even a table? what file does it?
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @SirBatince: It should show up in CLABMO.2da. One of the recurring spell files applied via the AP_ line is a leveled AC spell (I forget the code). Every few levels, the spell is re-applied, and the higher level versions of the spell will set the monk's base AC to a lower value. Change the spell and/or the AP_ entries of that spell in the CLABMO.2da and you can change the progression.
  • [Deleted User][Deleted User] Posts: 0
    edited September 2018
    The user and all related content has been deleted.
  • lefreutlefreut Member Posts: 1,462
    Raduziel said:

    Is there a way to alter a release on GitHub (using the site as I'm too dumb to know how to use Git programs)?

    I have some minor changes that I would like to add to a current release (DoF 1.9.0) instead of starting a new one.

    Thanks.

    I think you need to use git to be able to do that. You can either change the tag or create a new tag and then edit the release on Github.
Sign In or Register to comment.