Conventional object targets are locked in until a reeval has been triggered by chase code, (chasing for ReevaluationPeriod), or the target died / got removed from the game.
Object selectors constantly reevaluate the target, not being affected by the ReevaluationPeriod at all.
What about 'LastSeenBy(Myself)'? Is it always considered as a conventional object target (regardless if it refers to an object selector like 'NearestEnemyOfType()' or a conventional object like 'NearestEnemyOf(Myself)')?
@Luke93: Nested objects are also treated as conventional. Straight object selectors are the only type of object that is constantly reevaluated by AttackReevaluate().
Straight object selectors are the only type of object that is constantly reevaluated by AttackReevaluate().
Can you confirm that 'NearestEnemyOfType()' with no filter (i.e., 'NearestEnemyOfType([0.0])') behaves like 'NearestEnemyOf(Myself)' => i.e., it's not an object selector? That's pretty bad ...
I also tried putting a dummy non-zero EA value (i.e., 'NearestEnemyOfType([ANYTHING])'), but it's not working as expected (it's not constantly reevaluated by 'AttackReevaluate()' / 'AttackOneRound()' ...)
After further testing, it seems 'NearestEnemyOfType()' is not considered as an object selector...
For best understanding I will try my best to explain in details.
My question is intended for combat scripts of your enemies in game (as I'm working on advanced AI).
For example, STATS.IDS, ARMORCLASS, it properly recognise current effective AC, no matter is AC changed for any item bonuses, ability bonuses, spell bonuses (like Entropy shield +6AC or Aura of Flaming Death +4AC), etc.
But for Thac0, there is no same thing, or at least, I'm not aware of it.
- Just STAT Thac0 will look into creature (your players for example, because it is scripts for your enemies) BASE Thac0 + bonuses from item like gloves, bracers, or helm which gives Thac0 bonus. Bonuses from weapons are not included there. Penalities which comes from Slow or Blind for example, also set here (and as far as I know, just here).
-STAT TOHITBONUS will check "ability bonuses", and such ones are Kensai bonuses (or Swashbuckler bonus if no RR are installed I think, and if RR are installed than Swashbuckler do not use bonus like kensai TOHITBONUS but use MELEE_THAC0_BONUS).
-STAT THAC0BONUSRIGHT, as I tested, check for main hand bonuses, including bonus from Strenght, including MELEE_THAC0_BONUS, including bonuses or penalities from proficiency, and include weapon bonus itself (meaning if sword have +5 to hit it will be added here).
So far, I used combinations of there.
But, if there is any other way to use real effective Thac0 your creatures have, it would be nice.
Or if anything can be done to make it work, please let me know.
A question about the dialog.tlk. Is it possible to edit the .tlk by adding strings directly with NIon pc then transfer it over to Android replacing the original dialog.tlk without Weidu having to be used?
For example, STATS.IDS, ARMORCLASS, it properly recognise current effective AC, no matter is AC changed for any item bonuses, ability bonuses, spell bonuses (like Entropy shield +6AC or Aura of Flaming Death +4AC), etc.
It still misses Specific AC modifiers (crush/slash/pierce/missile), so it's not much different than THAC0.
For THAC0, it is indeed split into 4 of 6 different stats:
7|THAC0
84|THAC0BONUSRIGHT or 85|THAC0BONUSLEFT
170|FIST_THACO_BONUS (if using fists)
166|MELEE_THACO_BONUS or 72|MISSILETHAC0BONUS
As well as STATE_BERSERK (+2 THAC0, not included elsewhere)
@Bubb An investigation request, when you've got the time:
Creatures have no trouble with "See()"ing a Door or Region, but fail with Containers.
Is there any way to make a Container visible to creatures?
Additionally, named creatures, (those with script names), can be looked up independently of these lists via their script name.
See() only checks for objects in m_lVertSort, and containers are put into m_lVertSortBack. I believe the only way to See() a container is to reference it by its script name.
@Bubb Thanks, disappointing, but appreciated.
I've been using "Scriptname" without issue, was hoping for a generic approach.
I've also been using "Myself", in the Container's own script, but it is of limited usefulness.
Hi again. Does anyone know of a way to stop custom music from playing once a conversation is over?
When the conversation starts, PlaySong(0) will clear the playlist so to speak, but since my custom music is a sound not a song, that command doesn't seem to work at the end.
There may not be a way to do this since it seems like every romance just has the music go until it's done, but it annoys me. Especially with shorter conversations, so any ideas would be appreciated. I haven't been able to find a command listed in the IESDP index.
For example, STATS.IDS, ARMORCLASS, it properly recognise current effective AC, no matter is AC changed for any item bonuses, ability bonuses, spell bonuses (like Entropy shield +6AC or Aura of Flaming Death +4AC), etc.
It still misses Specific AC modifiers (crush/slash/pierce/missile), so it's not much different than THAC0.
For THAC0, it is indeed split into 4 of 6 different stats:
7|THAC0
84|THAC0BONUSRIGHT or 85|THAC0BONUSLEFT
170|FIST_THACO_BONUS (if using fists)
166|MELEE_THACO_BONUS or 72|MISSILETHAC0BONUS
As well as STATE_BERSERK (+2 THAC0, not included elsewhere)
Yes, AC miss specific modifiers.
I improvised one solution in script, to "get" final Thac0 of creatures around, and in practice it works really well. And similar can be used for AC + modifiers.
THAC0BONUSRIGHT include MELEE_THACO_BONUS.
There is also HITBONUS, which works separate. It is used for Kensai, Swashbuckler (non RR, as RR adds MELEE_THACO_BONUS for Swashbuckler, not HITBONUS), and Berserker Enrage.
I did not know for STATE_BERSERK, but I will test more about it. So far I tested with Minsc, but when he goes Berserk indeed Thac0 is improved by 2. Still I have to check is that due to BERSERK state or it comes from his ability directly.
Correct, it also includes FIST_THAC0_BONUS, I had some leftover modifications corrupting my tests.
HITBONUS is separate, your initial three were correct: THAC0, THACOBONUSRIGHT/LEFT, and HITBONUS.
I did not know for STATE_BERSERK, but I will test more about it. So far I tested with Minsc, but when he goes Berserk indeed Thac0 is improved by 2. Still I have to check is that due to BERSERK state or it comes from his ability directly.
It comes from STATE_BERSERK itself. It grants a +2 to hit and damage separate from any granted by the spell/ability. The bonus from STATE_BERSERK is not displayed in the inventory, only in the combat log.
So, any creature, if goes to berserk (btw., what exactly cause Berserk in first place? I don't remember I seen it ever, every time some creature goes to PANIC but not BERSERK), state, will get +2 Thac0? Not only Minsc which is activated by "witch" death or you activate it? If that is case, it take me 5 minutes to update my improvisation in scripts so BERSERK_STATE add to real Thac0 which creature "see".
For everyone else, I will share exactly what I learned and tested.
All this is from STATS.IDS
- THAC0 is your base Thac0, but is modified by items which give bonus Thac0, like gauntlets for example (in EET I also get some "War Helm, something like that, which give +1 bonus).
It is also modified by Doom, Slow, Blind (and maybe some more spells which I'm not aware of). It is NOT modified from your weapon Thac0 bonus nor enhancment.
- THAC0BONUSRIGHT, for your right hand (main hand), calculate FIST_THAC0_BONUS or MELEE_THAC0_BONUS, your bonus from weapon proficiency, bonus from Strenght, and bonus from weapon itself.
It can be pretty big. In RR maxed out Swashbuckler will have 10 MELEE_THAC0_BONUS, now if you somehow get 3 pips in weapon specialisation, you get also +3, having 25 Strenght will give you +7, and weapon can go up to +6. Total of 26 bonus.
-HITBONUS, as I already posted, as you can see in inventory is displayed as "ability bonuses", use Kensai or non-RR Swashbuckler, or Berserker Enrage. Maybe there is more kits which I did not play/tested, but that is HITBONUS and it is complete separated from THAC0BONUSRIGHT.
Of course, there are various abilities, maybe Offensive spin, it grants Thac0 bonus, right? I did not test it but my guess is it must falls under THAC0BONUSRIGHT or HITBONUS.
So, any creature, if goes to berserk (btw., what exactly cause Berserk in first place? I don't remember I seen it ever, every time some creature goes to PANIC but not BERSERK), state, will get +2 Thac0? Not only Minsc which is activated by "witch" death or you activate it? If that is case, it take me 5 minutes to update my improvisation in scripts so BERSERK_STATE add to real Thac0 which creature "see".
Anything detected with StateCheck(*Object,STATE_BERSERK) will grant the extra +2 to hit and damage. If it doesn't set that state, then it won't get the bonus.
There aren't many sources of berserk, but to name a few:
"Cursed Berserking Sword +3", Blood Rage (spell/IWDEE), Animal Rage (spell/IWDEE).
Morale Failure:Berserk does NOT set this state, you get no combat bonus from it.
Kjeron, you were 100% right for BERSERK_STATE. It is not included in THAC0, nor THAC0BONUSRIGHT, nor HITBONUS. I made one detailed testing. And I will now patch my part in scripts for that.
You do not see any Thac0 change in game in Inventory, but in Record you can see that Thac0 indeed are improved for 2.
So, Minsc get +3 Thaco (assuming he is on 18/93 Strenght), because of +2 Strenght bonus, and because of this Berserk state. GO FOR THE EYES BOO
I've been trying to have a spell scale with level, but I'm not sure doing it the right way.
I want to modify the Dark Moon Monk's Blindness spell, to give a reduction in saving throws every ten levels. It's one of the few tricks he's got, seems only reasonable he would get better at making it stick.
Anyway, I thought I would take the Spook spell as an example, so I opened that spell in NI. I found that there are a couple of spell abilities that trigger at different levels that govern the scaling with level behavior.
I tried to copy this structure in the DMM's Blindness spell, but I'm not quite able to get it the same.
Specifically, I can copy the original ability, and change the saving throw bonus and the level at which this should become the new behaviour. But I can't change the spell ability designation. So they are all "Spell ability 0". Or just plain "Spell ability", if I add a new ability and manually recreate the original.
Does it matter that the abilities aren't called "Spell ability 0", "Spell ability 1", etc?
If it does, how do change the designation?
Straight object selectors are the only type of object that is constantly reevaluated by AttackReevaluate().
Can you confirm that 'NearestEnemyOfType()' with no filter (i.e., 'NearestEnemyOfType([0.0])') behaves like 'NearestEnemyOf(Myself)' => i.e., it's not an object selector? That's pretty bad ...
I also tried putting a dummy non-zero EA value (i.e., 'NearestEnemyOfType([ANYTHING])'), but it's not working as expected (it's not constantly reevaluated by 'AttackReevaluate()' / 'AttackOneRound()' ...)
After further testing, it seems 'NearestEnemyOfType()' is not considered as an object selector...
Please, could you list all those objects that are flagged as Straight object selectors?
Apparently, 'NearestEnemyOfType()' is not one of them even if it can take object selectors as argument...
@Luke93: By "straight" I mean that literally only object selectors work this way. Nesting them inside conventional objects, (anything in OBJECT.IDS), doesn't constantly reevaluate. I'm starting to question whether this object selector behavior was even intentional, or if it's just an unintended side effect of how AttackReevaluate() processes the object internally.
@Luke93: By "straight" I mean that literally only object selectors work this way. Nesting them inside conventional objects, (anything in OBJECT.IDS), doesn't constantly reevaluate. I'm starting to question whether this object selector behavior was even intentional, or if it's just an unintended side effect of how AttackReevaluate() processes the object internally.
I've run across a glitch that I can't seem to fix and I'm hoping someone can help.
I have a conversation with one NPC that has a few interjections from other NPCs. I used the standard Inparty and cdstate checks for the interjections and they mostly work fine. However, if CN and the main NPC are in one building and the others who were supposed to interject are in a different building or outside, the conversation just cuts out when it hits their interjection points. It seems to be because they can talk but they're not in the area.
I've tried adjusting the interjection triggers to include See(NPC), Detect, and Isvalidforpartydialogue and none of them stop this issue. Any ideas? It doesn't come up very often, but it's annoying.
@Ratatoskr
See("npc"), Detect("npc"), or InMyArea("npc") all work (in combination with InParty("npc") and !StateCheck("npc",CD_STATE_NOTVALID)) and prevent the stopping of the dialogue because the NPC wasn't in the same area.
In the EE, using Isvalidforpartydialogue should also be enough.
@jastey Thanks. I've tried both see and detect to no avail, but I will try InMyArea and see if that works. I don't know why my game is having issues with the first two.
Edit: ...and that works, thank you very much. I'm gonna go adjust some code.
Hi, again. I have a question about Opcode 319 - restrict items. The opcode reads as such:
#319 (0x13F) Usability: Item Usability
Parameter #1: IDS Entry
Parameter #2: IDS File
Special: Description note
Description:
When 'Power' is set to 1, this effect restricts the item to creature(s) matching the object identifiers. When 'Power' is set to 0, creature(s) matching the object identifiers cannot use the item. The string to display when an invalid creature attempts to use the item is held in 0x2c.
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids
10 Actor's name
11 Actor's scripting name (8 maximum in resource field)
The message defined in 'Description note' will be displayed whenever this effect is triggered.
I've been using #11, Actor's script name since that's the easiest way to restrict an item to one character. However, the "usable by" description that is shown on the item in game is linked to dialog.tlk and doesn't show any text if I add this opcode in new (or shows the previous person if I copied and changed it). Does anyone know if/how I can change the 'Description Note' via WEIDU so that the Usable By text actually lists the correct person?
@AionZ Thank you. Do I need to make sure that my item doesn't already have that Opcode first? So delete the existing effect in Near Infinity and then add it back in on the Weidu Install?
If I want to append an existing NPC's conversation options, how do I go about doing that? I've been working on a quest pack for BG1 and I've made good progress but it's been a while and this method escapes me. Specifically, I want to alter the Grand Shadow Druids files.
Hello. I have another weird opcode question that I'm hoping someone can help be with.
Is opcode 71, change gender, incompatible with halflings? I'm trying to make an item like the old belt of gender changing, but if I allow halflings to use it, my game crashes as soon as I click the item in my inventory. If I restrict the item so that halflings can't use it, it works fine.
Does anyone know what the heck is going on and how I can fix it? I need this item to be halfling-only, not the other way around.
One more question that hopefully someone knows the answer to. Is it possible to move an NPC from one area to another while they are not in your party? Neither MoveBetweenAreas or Escapeareamove appear to work even when they're in the bbaldur script.
One more question that hopefully someone knows the answer to. Is it possible to move an NPC from one area to another while they are not in your party? Neither MoveBetweenAreas or Escapeareamove appear to work even when they're in the bbaldur script.
What exactly did you use? At least EscapeAreaMove should work for non-joinable characters.
Comments
One more question about
- Conventional object targets are locked in until a reeval has been triggered by chase code, (chasing for ReevaluationPeriod), or the target died / got removed from the game.
- Object selectors constantly reevaluate the target, not being affected by the ReevaluationPeriod at all.
What about 'LastSeenBy(Myself)'? Is it always considered as a conventional object target (regardless if it refers to an object selector like 'NearestEnemyOfType()' or a conventional object like 'NearestEnemyOf(Myself)')?Can you confirm that 'NearestEnemyOfType()' with no filter (i.e., 'NearestEnemyOfType([0.0])') behaves like 'NearestEnemyOf(Myself)' => i.e., it's not an object selector? That's pretty bad ...
I also tried putting a dummy non-zero EA value (i.e., 'NearestEnemyOfType([ANYTHING])'), but it's not working as expected (it's not constantly reevaluated by 'AttackReevaluate()' / 'AttackOneRound()' ...)
After further testing, it seems 'NearestEnemyOfType()' is not considered as an object selector...
For best understanding I will try my best to explain in details.
My question is intended for combat scripts of your enemies in game (as I'm working on advanced AI).
For example, STATS.IDS, ARMORCLASS, it properly recognise current effective AC, no matter is AC changed for any item bonuses, ability bonuses, spell bonuses (like Entropy shield +6AC or Aura of Flaming Death +4AC), etc.
But for Thac0, there is no same thing, or at least, I'm not aware of it.
- Just STAT Thac0 will look into creature (your players for example, because it is scripts for your enemies) BASE Thac0 + bonuses from item like gloves, bracers, or helm which gives Thac0 bonus. Bonuses from weapons are not included there. Penalities which comes from Slow or Blind for example, also set here (and as far as I know, just here).
-STAT TOHITBONUS will check "ability bonuses", and such ones are Kensai bonuses (or Swashbuckler bonus if no RR are installed I think, and if RR are installed than Swashbuckler do not use bonus like kensai TOHITBONUS but use MELEE_THAC0_BONUS).
-STAT THAC0BONUSRIGHT, as I tested, check for main hand bonuses, including bonus from Strenght, including MELEE_THAC0_BONUS, including bonuses or penalities from proficiency, and include weapon bonus itself (meaning if sword have +5 to hit it will be added here).
So far, I used combinations of there.
But, if there is any other way to use real effective Thac0 your creatures have, it would be nice.
Or if anything can be done to make it work, please let me know.
For THAC0, it is indeed split into 4 of 6 different stats: As well as STATE_BERSERK (+2 THAC0, not included elsewhere)
@Bubb An investigation request, when you've got the time:
Creatures have no trouble with "See()"ing a Door or Region, but fail with Containers.
Is there any way to make a Container visible to creatures?
1) m_lVertSort
2) m_lVertSortBack
3) m_lVertSortFlight
4) m_lVertSortUnder
5) m_lTiledObjects
6) m_lGameTextObjects
7) m_lVertSortTransition
Additionally, named creatures, (those with script names), can be looked up independently of these lists via their script name.
See() only checks for objects in m_lVertSort, and containers are put into m_lVertSortBack. I believe the only way to See() a container is to reference it by its script name.
I've been using "Scriptname" without issue, was hoping for a generic approach.
I've also been using "Myself", in the Container's own script, but it is of limited usefulness.
When the conversation starts, PlaySong(0) will clear the playlist so to speak, but since my custom music is a sound not a song, that command doesn't seem to work at the end.
There may not be a way to do this since it seems like every romance just has the music go until it's done, but it annoys me. Especially with shorter conversations, so any ideas would be appreciated. I haven't been able to find a command listed in the IESDP index.
Yes, AC miss specific modifiers.
I improvised one solution in script, to "get" final Thac0 of creatures around, and in practice it works really well. And similar can be used for AC + modifiers.
THAC0BONUSRIGHT include MELEE_THACO_BONUS.
There is also HITBONUS, which works separate. It is used for Kensai, Swashbuckler (non RR, as RR adds MELEE_THACO_BONUS for Swashbuckler, not HITBONUS), and Berserker Enrage.
I did not know for STATE_BERSERK, but I will test more about it. So far I tested with Minsc, but when he goes Berserk indeed Thac0 is improved by 2. Still I have to check is that due to BERSERK state or it comes from his ability directly.
HITBONUS is separate, your initial three were correct: THAC0, THACOBONUSRIGHT/LEFT, and HITBONUS. It comes from STATE_BERSERK itself. It grants a +2 to hit and damage separate from any granted by the spell/ability. The bonus from STATE_BERSERK is not displayed in the inventory, only in the combat log.
For everyone else, I will share exactly what I learned and tested.
All this is from STATS.IDS
- THAC0 is your base Thac0, but is modified by items which give bonus Thac0, like gauntlets for example (in EET I also get some "War Helm, something like that, which give +1 bonus).
It is also modified by Doom, Slow, Blind (and maybe some more spells which I'm not aware of). It is NOT modified from your weapon Thac0 bonus nor enhancment.
- THAC0BONUSRIGHT, for your right hand (main hand), calculate FIST_THAC0_BONUS or MELEE_THAC0_BONUS, your bonus from weapon proficiency, bonus from Strenght, and bonus from weapon itself.
It can be pretty big. In RR maxed out Swashbuckler will have 10 MELEE_THAC0_BONUS, now if you somehow get 3 pips in weapon specialisation, you get also +3, having 25 Strenght will give you +7, and weapon can go up to +6. Total of 26 bonus.
-HITBONUS, as I already posted, as you can see in inventory is displayed as "ability bonuses", use Kensai or non-RR Swashbuckler, or Berserker Enrage. Maybe there is more kits which I did not play/tested, but that is HITBONUS and it is complete separated from THAC0BONUSRIGHT.
Of course, there are various abilities, maybe Offensive spin, it grants Thac0 bonus, right? I did not test it but my guess is it must falls under THAC0BONUSRIGHT or HITBONUS.
There aren't many sources of berserk, but to name a few:
"Cursed Berserking Sword +3", Blood Rage (spell/IWDEE), Animal Rage (spell/IWDEE).
Morale Failure:Berserk does NOT set this state, you get no combat bonus from it.
You do not see any Thac0 change in game in Inventory, but in Record you can see that Thac0 indeed are improved for 2.
So, Minsc get +3 Thaco (assuming he is on 18/93 Strenght), because of +2 Strenght bonus, and because of this Berserk state. GO FOR THE EYES BOO
I want to modify the Dark Moon Monk's Blindness spell, to give a reduction in saving throws every ten levels. It's one of the few tricks he's got, seems only reasonable he would get better at making it stick.
Anyway, I thought I would take the Spook spell as an example, so I opened that spell in NI. I found that there are a couple of spell abilities that trigger at different levels that govern the scaling with level behavior.
I tried to copy this structure in the DMM's Blindness spell, but I'm not quite able to get it the same.
Specifically, I can copy the original ability, and change the saving throw bonus and the level at which this should become the new behaviour. But I can't change the spell ability designation. So they are all "Spell ability 0". Or just plain "Spell ability", if I add a new ability and manually recreate the original.
Does it matter that the abilities aren't called "Spell ability 0", "Spell ability 1", etc?
If it does, how do change the designation?
@Bubb
Please, could you list all those objects that are flagged as Straight object selectors?
Apparently, 'NearestEnemyOfType()' is not one of them even if it can take object selectors as argument...
OK, so basically only the following objects:
I do like this behavior because it prevents the player from kiting the enemy...
I have a conversation with one NPC that has a few interjections from other NPCs. I used the standard Inparty and cdstate checks for the interjections and they mostly work fine. However, if CN and the main NPC are in one building and the others who were supposed to interject are in a different building or outside, the conversation just cuts out when it hits their interjection points. It seems to be because they can talk but they're not in the area.
I've tried adjusting the interjection triggers to include See(NPC), Detect, and Isvalidforpartydialogue and none of them stop this issue. Any ideas? It doesn't come up very often, but it's annoying.
See("npc"), Detect("npc"), or InMyArea("npc") all work (in combination with InParty("npc") and !StateCheck("npc",CD_STATE_NOTVALID)) and prevent the stopping of the dialogue because the NPC wasn't in the same area.
In the EE, using Isvalidforpartydialogue should also be enough.
Edit: ...and that works, thank you very much. I'm gonna go adjust some code.
#319 (0x13F) Usability: Item Usability
Parameter #1: IDS Entry
Parameter #2: IDS File
Special: Description note
Description:
When 'Power' is set to 1, this effect restricts the item to creature(s) matching the object identifiers. When 'Power' is set to 0, creature(s) matching the object identifiers cannot use the item. The string to display when an invalid creature attempts to use the item is held in 0x2c.
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids
10 Actor's name
11 Actor's scripting name (8 maximum in resource field)
The message defined in 'Description note' will be displayed whenever this effect is triggered.
I've been using #11, Actor's script name since that's the easiest way to restrict an item to one character. However, the "usable by" description that is shown on the item in game is linked to dialog.tlk and doesn't show any text if I add this opcode in new (or shows the previous person if I copied and changed it). Does anyone know if/how I can change the 'Description Note' via WEIDU so that the Usable By text actually lists the correct person?
Fortunately I make use of this opcode a lot. This goes under the copy item command in the .tp2:
LPF ADD_ITEM_EQEFFECT
INT_VAR
opcode = 319
target = 1
timing = 2
parameter2 = 11
power = 1
special = RESOLVE_STR_REF (~Name~)
STR_VAR
resource = scriptname
END
You never need to add the opcode manually to the item so long as you use the above code.
Is opcode 71, change gender, incompatible with halflings? I'm trying to make an item like the old belt of gender changing, but if I allow halflings to use it, my game crashes as soon as I click the item in my inventory. If I restrict the item so that halflings can't use it, it works fine.
Does anyone know what the heck is going on and how I can fix it? I need this item to be halfling-only, not the other way around.
What exactly did you use? At least EscapeAreaMove should work for non-joinable characters.