Jump to content

Opcode 100: Protection from Creature Type


Salk

Recommended Posts

Alternatively, you could just protect against the projectile used for the basilisk gaze. But I think basilisks are scripted to only ever attack with their gaze attacks, so they just keep pointlessly trying to turn an immune creature to stone (or maybe that's only the case in BGT games - it'd be nice if their AI could be fixed to actually use their melee attack!).

Edited by Bartimaeus
Link to comment

Depends on what you're specifically looking for. Op100 will cause the targeted creatures to flat out ignore you and pretend like you don't exist.

You could block the petrification projectile, but the projectile is also used by other creatures so you might be extending protection beyond what you're looking for.

Alternatively, all of the basilisk attacks are done via ~five weapons (lesser have claw and gaze, greater also have a poison bite). Adding protections against those items through op 318/324 would do it. For the originals, you could route those items through a spell and use 206. The drawback here is if another mod adds basilisks with alternative weapons.

Link to comment

Thanks for all the advice, folks.

My preference would be for opcode 100 for the Item. But the problem here is that I suspect that the protected creature can attack the basilisk and still be ignored.

Instead I'd like for the attacked basilisk to attack back if that happens.

Link to comment
4 hours ago, subtledoctor said:

If an enemy has op100 against everything, can players manually target and attack that enemy?

Nope.  A creature also cannot target itself if it has an op100 matching its own IDS value.  This even includes actions like drinking a potion.

Link to comment

I was thinking about adding this block (JA#ARKHS.ITM uses opcode 100) to the Basilisk's script. I just don't know if the attacking command will be carried out.

IF
	HasItemEquiped("JA#ARKHS", LastAttackerOf())
	Range(LastAttackerOf(),5)
	See(LastAttackerOf())
THEN
	RESPONSE #50
		SelectWeaponAbility(SLOT_WEAPON0,0)
		AttackReevaluate(LastAttackerOf(), 15)
	RESPONSE #50
		RunAwayFrom(LastAttackerOf(), 45)
END

 

Edited by Salk
Link to comment
On 8/18/2023 at 4:33 PM, Bartimaeus said:

But I think basilisks are scripted to only ever attack with their gaze attacks, so they just keep pointlessly trying to turn an immune creature to stone (or maybe that's only the case in BGT games - it'd be nice if their AI could be fixed to actually use their melee attack!).

They use their BG1 script and they do have a chance to use melee attacks. They even have a chance to go melee berserk when the target isn't in close range and they won't stop until they reach the target.

IF
    See(NearestEnemyOf(Myself))
    Range(NearestEnemyOf(Myself),5)
    Delay(12)
    !StateCheck(NearestEnemyOf(Myself),STATE_STONE_DEATH)
THEN
    RESPONSE #30
        SelectWeaponAbility(SLOT_WEAPON0,0)
        RunAwayFrom(NearestEnemyOf(Myself),45)
        AttackReevaluate(NearestEnemyOf(Myself),15)
    RESPONSE #70
        SelectWeaponAbility(SLOT_WEAPON1,0)
        AttackReevaluate(NearestEnemyOf(Myself),15)
END

IF
    See(NearestEnemyOf(Myself))
    Delay(12)
    !StateCheck(NearestEnemyOf(Myself),STATE_STONE_DEATH)
THEN
    RESPONSE #70
        SelectWeaponAbility(SLOT_WEAPON0,0)
        AttackReevaluate(NearestEnemyOf(Myself),15)
    RESPONSE #30
        SelectWeaponAbility(SLOT_WEAPON1,0)
        AttackReevaluate(NearestEnemyOf(Myself),15)
END

The problem is the long Delay(12) which makes them very unresponsive. This delay is consistent with all BG1 creatures which were designed to swap weapons during combat:

  • lesser basilisk
  • greater basilisk
  • ankheg
  • ettercap
  • wyvern
  • winter wolf

Reducing the delay to, e.g., six seconds makes reevaluation snappier. Would that be considered acceptable short of overhauling the script?

Link to comment

I think the delay(12) in the case of basilisk has been introduced to mitigate the damages that their gaze could do to a player that meets 2-3 of them.

But out of curiosity, what part of their script makes them berserk?

Link to comment
Just now, Salk said:

I think the delay(12) in the case of basilisk has been introduced to mitigate the damages that their gaze could do to a player that meets 2-3 of them.

But out of curiosity, what part of their script makes them berserk?

The delay is only for re-evaluating whether they should switch weapons (gaze or melee), nothing to do with how frequently or who they're attacking.

@skellytz That might be best. I think another issue with basilisks is that they move very slow, which combined with their preference for gaze attacks when targets are at range, means...well, honestly, everything about basilisks is just kind of bad for players who know that a single Protection from Petrification makes the Sharp Teeth Plain a veritable fountain of free XP. But what can you do?

Link to comment
12 hours ago, Bartimaeus said:

The delay is only for re-evaluating whether they should switch weapons (gaze or melee), nothing to do with how frequently or who they're attacking.

Oh good to know!

I didn't know they'd need two rounds two choose between melee and range attack. 🙄

My 2 cents is for not making any change to the Delay(12) because there are other creatures that would have to follow suit, including some introduced in BG2 and I think it would be outside of BGT's scope to do so. As part of my own tweaks though I have decided to cut the delay in half for the Greater Basilisks (but not the lesser ones).

Edited by Salk
Link to comment
16 hours ago, Salk said:

But out of curiosity, what part of their script makes them berserk?

 

    RESPONSE #30
        SelectWeaponAbility(SLOT_WEAPON1,0)
        AttackReevaluate(NearestEnemyOf(Myself),15)
END

This has a low chance of happening, but when it does, and as long as the nearest enemy keeps kiting, schnappi won't switch to ranged attacks. The first block with Range(NearestEnemyOf(Myself),5) will return false and the second one true, which for AttackReevaluate means continue the attack action. There would have to be additional blocks which, e.g., give it a chance to swap weapons if the bassie gets hit. But perhaps then we'd be going too far with tweaks.

If more players are in favor, I could reduce the delay for basilisks, ankhegs, winter wolves, wyverns, ettercaps and wyverns, i.e., BG1 creatures that should swap weapons but feel too sluggish BG2 combat. On the other hand, it won't really affect the player's approach and the scripts will still feel lackluster. BGEE also doesn't change the delay. We have SCS for making combat more interesting, after all.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...