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.
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
@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: 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
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.
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.
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.
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
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.
@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).
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?
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.
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.
@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.
@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.
Comments
@Wisp I think you should include these 3 new functions into the next release of WeiDU.......
Where's the error here?
@Raduziel
@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
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!
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!
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.
Once per second? Per round? Per frame?
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
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.
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?
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.
Check the PORTRAIT.2DA file. I've never used it but it seems to be what determines the replacement portrait.
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.
But I'll do my best, thanks!
is it even a table? what file does it?