How can I edit the base damage and description of battle axes without editing throwing axes? I should probably rely on the minimum strength required to equip these weapons....
How can I edit the base damage and description of battle axes without editing throwing axes? I should probably rely on the minimum strength required to equip these weapons....
Fortunately, it so happens that your situation exactly matches one of the examples in the WeiDu documentation:
There you go, the explanation is pretty straightforwards, but should you need more details feel free to ask!
Editing the description is trickier though. I've personnally never meddled directly with existing strings within dialog.tlk so I'll let more knowledgeable people giving you a solution. My call would be to extract the string, look for the damage part (which usually is standardized as "Damage: 1d6" for instance), replace it with what you want (say, "Damage: 1d8"), and reimplement the string, but I am not sure how to do that using WeiDU
I think that you may combine READ_LONG 0x0050 / 0x0054 with REPLACE_TEXTUALLY, but I'm just guessing and I'm probably wrong.
That's what I'd do for the first and the last steps, though I'd use READ_STRREF to directly extract the string rather than its reference. What I'm stuck on is automating the text edition once the strings are extracted. I do not know how to do that using WeiDU
Note: some axes have both melee and thrown attacks...
@Arunsun Exactly. I don't wanna edit the melee ability of throwing axes, just the melee ability of battle axes. Therefore, one possibility would be to use the minimum strength requirement (10 for battle axes):
PATCH_IF (prof = 92) && (minimum_strength = 10) BEGIN
blah blah......
END
Well this would work for most axes but some mods could implement melee axes that would have a different strength requirement so it wouldn't be the cleanest solution to use strength requirement. Here a cleaner one that will include such axes and edit every melee ability (a weapon may have multiple melee abilities):
COPY_EXISTING_REGEXP ~.*\.itm~ ~override~
READ_BYTE 0x1c "category"
READ_LONG 0x64 "abilitiesoffset"
READ_SHORT 0x68 "#abilities"
SET "ranged"=0
READ_SHORT 0x68 "#abilities2"=0 // this one serves for the second loop
WHILE ("%#abilities%" > 0) BEGIN // this loop will check every ability to see if at least one is ranged
READ_BYTE ("%abilitiesoffset%" + ("%#abilities%" - 1) * 0x38) "abilitytype"
SET "checkranged" = 0
WHILE ("%abilitytype%" = 2)
AND ("%checkranged%" = 0) BEGIN
SET "ranged"=1
SET "checkranged" = 1
END
SET "#abilities" = ("%#abilities%" - 1)
END
PATCH_IF ("%ranged%" = 0) //this patches the axe if it is was not determined to be ranged
WHILE ("%#abilities2%" > 0) BEGIN //this loop is where the modification occur
READ_BYTE ("%abilitiesoffset%" + ("%#abilities2%" - 1) * 0x38) "abilitytype"
SET "patchmelee" = 0
WHILE ("%abilitytype%" = 1)
AND ("%patchmelee%" = 0) BEGIN
//here is where you write the modification you want to make.
SET "patchmelee" = 1
END
SET "#abilities2" = ("%#abilities2%" - 1)
END
END
IF_EVAL ("%category%" = 25)
This should be functional, though possibly suboptimal as an algorithm.
Regex is a somewhat acquired skill after much use... I'll try to step you through some of the basics
"." means "match any character" "*" means "match zero or more of the previous character" "+" means "match one or more of the previous character" "\" means "treat the following special character as if it wasn't special"
So, in order to match all CREs that have cola in their name, you could do this: .*cola.*\.cre
the first ".*" being "match zero or more of any character"
"cola" being "match the character sequence cola"
the second ".*" being "match zero or more of any character"
the "\." being "match a period", notice the "\" is used here to tell the regexp to treat the period as a literal period, and not as a wildcard character
And the "cre" being "match the character sequence cre"
I would like to prevent a kit from equipping any items with one specific opcode (189). Is there a simple way to do that? The only process I can think of is checking every effect of every item one by one, and this would probably result in a super long installation. I don't want to make the kit immune to that OPcode since I am using it in the kit, I just want to make it so there is no way of stacking the OPcode with itself using items.
Alternatively, if an opcode is applied with permanent duration onto a target, and then the target becomes immune to that OPcode, does it dispel the previously applied effect?
This is just from a quick glance, I apologize if any of this is wrong.
it seems like the CLABPR0(1-4).2DA files are applying the spell CDHLYSYM at level 25 for all priest classes. The CDHLYSYM spell creates a CDHLYSYM item which is used as a placeholder.
A script in BALDUR.BCS (BALDUR25.BCS for ToB) (starts around line 1711 for SoA, 1027 for ToB) checks for the CDHLYSYM item every round for every player and then replaces it with the correct deity variant.
In order to remove this mechanism, you should remove the CDHLYSYM entries in the CLABPR0(1-4).2DA files, and then remove the corresponding lines from Baldur.BCS.
If you only remove the script in Baldur.BCS I'm pretty sure you will encounter the placeholder item still appearing, so make sure you remove the CLAB entries.
Sorry to bother again, but why the following piece of code isn't working (i.e., it doesn't update the general description of light crossbows and heavy crossbows)?
LOAD_TRA ~Weapon_Changes/components/104_unident_desc_xbows.tra~
BEGIN
STRING_SET
6875 @6875
18095 @18095
END
Note that 104_unident_desc_xbows.tra is encoded as UTF-8....
How am I supposed to restrain a kit from using plate armors? I thought about using OPcode 181 (Disallow item type) but actually every armor including plate and full plate have their category field set to "Armor".
Barbarians are restricted from plate mail, unfortunately due to some strange design choices using 0x40000000 in your kit causes a bunch of magical items to also be unusable.
How am I supposed to restrain a kit from using plate armors? I thought about using OPcode 181 (Disallow item type) but actually every armor including plate and full plate have their category field set to "Armor".
COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ PATCH_IF (SOURCE_SIZE > 0x71) BEGIN READ_BYTE 0x18 flags1 PATCH_IF ((flags1 & BIT3) = BIT3) BEGIN READ_ASCII 0x22 animation (2) PATCH_IF ("%animation%" STRING_EQUAL_CASE "4A") BEGIN LPF ~ADD_ITEM_EQEFFECT~ INT_VAR opcode = 319 target = 1 timing = 2 parameter1 = IDS_OF_SYMBOL (~Kit~ ~KitInternalName~) parameter2 = 9 special = RESOLVE_STR_REF (@Y) END END END END BUT_ONLY
The special part is optional and just makes the kit name appear on the list of those who can't wear the armor (Y = the string with the kit's name in Mixed Cases).
Comments
How can I edit the base damage and description of battle axes without editing throwing axes? I should probably rely on the minimum strength required to equip these weapons....
https://weidu.org/WeiDU/README-WeiDU.html#htoc27
There you go, the explanation is pretty straightforwards, but should you need more details feel free to ask!
Editing the description is trickier though. I've personnally never meddled directly with existing strings within dialog.tlk so I'll let more knowledgeable people giving you a solution. My call would be to extract the string, look for the damage part (which usually is standardized as "Damage: 1d6" for instance), replace it with what you want (say, "Damage: 1d8"), and reimplement the string, but I am not sure how to do that using WeiDU
Therefore, one possibility would be to use the minimum strength requirement (10 for battle axes):
COPY_EXISTING_REGEXP ~.*\.itm~ ~override~ READ_BYTE 0x1c "category" READ_LONG 0x64 "abilitiesoffset" READ_SHORT 0x68 "#abilities" SET "ranged"=0 READ_SHORT 0x68 "#abilities2"=0 // this one serves for the second loop WHILE ("%#abilities%" > 0) BEGIN // this loop will check every ability to see if at least one is ranged READ_BYTE ("%abilitiesoffset%" + ("%#abilities%" - 1) * 0x38) "abilitytype" SET "checkranged" = 0 WHILE ("%abilitytype%" = 2) AND ("%checkranged%" = 0) BEGIN SET "ranged"=1 SET "checkranged" = 1 END SET "#abilities" = ("%#abilities%" - 1) END PATCH_IF ("%ranged%" = 0) //this patches the axe if it is was not determined to be ranged WHILE ("%#abilities2%" > 0) BEGIN //this loop is where the modification occur READ_BYTE ("%abilitiesoffset%" + ("%#abilities2%" - 1) * 0x38) "abilitytype" SET "patchmelee" = 0 WHILE ("%abilitytype%" = 1) AND ("%patchmelee%" = 0) BEGIN //here is where you write the modification you want to make. SET "patchmelee" = 1 END SET "#abilities2" = ("%#abilities2%" - 1) END END IF_EVAL ("%category%" = 25)
This should be functional, though possibly suboptimal as an algorithm.
LPF ALTER_ITEM_HEADER INT_VAR header_type=4 speed=10 END
Why is the following piece of code not working (i.e., it doesn't change the speed factor)? It shouldn't be that difficult..... Where am I doing wrong?
Let's say I have the following cre files:
RAcola02.cre
PRcola01.cre
SPcola09.cre
HJcola20.cre
K!cola1.cre
R$cola4.cre
And so it goes...
How can a make the game read all these files at once using only the radical "cola"?
I'm talking about those $![..]*/^.\. shenanigans that I see on a lot of mods, but I have no idea on how it works.
Thanks!
"." means "match any character"
"*" means "match zero or more of the previous character"
"+" means "match one or more of the previous character"
"\" means "treat the following special character as if it wasn't special"
So, in order to match all CREs that have cola in their name, you could do this:
.*cola.*\.cre
the first ".*" being "match zero or more of any character"
"cola" being "match the character sequence cola"
the second ".*" being "match zero or more of any character"
the "\." being "match a period", notice the "\" is used here to tell the regexp to treat the period as a literal period, and not as a wildcard character
And the "cre" being "match the character sequence cre"
Alternatively, if an opcode is applied with permanent duration onto a target, and then the target becomes immune to that OPcode, does it dispel the previously applied effect?
But how can I make an item exclusive to X kits, being X >= 1?
Thanks!
Thanks!
At level 25, in BG2EE-ToB, Clerics automatically receive a holy symbol.
I want to remove this from the game. How do I do it? This is not related to the Clerics CLAB, is some script that runs.
Thanks!
it seems like the CLABPR0(1-4).2DA files are applying the spell CDHLYSYM at level 25 for all priest classes. The CDHLYSYM spell creates a CDHLYSYM item which is used as a placeholder.
A script in BALDUR.BCS (BALDUR25.BCS for ToB) (starts around line 1711 for SoA, 1027 for ToB) checks for the CDHLYSYM item every round for every player and then replaces it with the correct deity variant.
In order to remove this mechanism, you should remove the CDHLYSYM entries in the CLABPR0(1-4).2DA files, and then remove the corresponding lines from Baldur.BCS.
If you only remove the script in Baldur.BCS I'm pretty sure you will encounter the placeholder item still appearing, so make sure you remove the CLAB entries.
Thanks!
How do I remove lines from a script without allowing Satan to walk on Earth and burn us all?
Just to give you a feedback, I was able to fix it using:
Barbarians are restricted from plate mail, unfortunately due to some strange design choices using 0x40000000 in your kit causes a bunch of magical items to also be unusable.
"4A" is the animation for plate/full plate.
That should do the trick.