Jump to content

Spell System Changes


Recommended Posts

I've got some questions about entropy_shield_abjuration.tpa.

  1. Why do you flag it as "Wizard Spell Immunity" (via op#282 – line 29) and "SPELL_IMMUNITY_ABJURATION" (via op#328 – line 37)? I mean, it doesn't protect you against all  Abjuration spells, so I can't understand... Also, you might want to avoid adding unnecessary entries to "SPLSTATE.IDS" (f.i., use existing "SI_ABJURATION – 56" instead of adding "SPELL_IMMUNITY_ABJURATION"...). To sum up: you should flag it as "ENTROPY_SHIELD – 30" and that's it.
  2. Why do you flag it as "PRIORITY_DISPEL" here (line 37)? I mean, shouldn't that be done when "Smarter Mages", "Smarter Priests" and the like are installed? Guess the same holds for "detectable items"...
Edited by Luke
Link to comment

1. It's being flagged as equivalent to Spell Immunity: Abjuration because from a combat AI point of view, it's very nearly equivalent, and I don't want to needlessly use up real estate in splstate.ids. But it's a bug that it's labelled with SPELL_IMMUNITY_ABJURATION, not SI_ABJURATION. I must have misremembered the name, and a downside of ds_resolve_stat is that it can't warn you if the spellstate doesn't exist. (I should probably have a must_exist variable in it.)

2. I'm not sure I understand. The point of the initialise component is (inter alia) to install the detectability system that all other AI components rely on. Why wouldn't PRIORITY_DISPEL be set here?

Link to comment
12 hours ago, DavidW said:

1. ... and I don't want to needlessly use up real estate in splstate.ids.

You don't need to. As I've already told you, what about using the existing entry "ENTROPY_SHIELD – 30" (at least on EE games)? You might want to use op#282 just on classic games since they're not compatible with op#328...

12 hours ago, DavidW said:

Why wouldn't PRIORITY_DISPEL be set here?

What if I just install "Smarter General AI"? Guess PRIORITY_DISPEL and the like aren't used at all in this case...?

What if I just install "Initialize AI"? I know, it doesn't make any sense and shouldn't happen, but still, it's a possibility, so...

Link to comment
Quote

You don't need to. As I've already told you, what about using the existing entry "ENTROPY_SHIELD – 30" (at least on EE games)?

Then the AI would need to be sensitive to whether this modification to Entropy Shield is present. Admittedly, it would be in keeping with SCS design principles just to assume it is, but in my judgement the advantages of doing so aren't large enough to justify the inconvenience of not just relying on the existing detect-SI-abjuration code.

3 hours ago, Luke said:

You might want to use op#282 just on classic games since they're not compatible with op#328...

It gets installed as 318 on classic games. (Give me some credit for intelligence, please.)

 

3 hours ago, Luke said:
16 hours ago, DavidW said:

Why wouldn't PRIORITY_DISPEL be set here?

What if I just install "Smarter General AI"? Guess PRIORITY_DISPEL and the like aren't used at all in this case...?

What if I just install "Initialize AI"? I know, it doesn't make any sense and shouldn't happen, but still, it's a possibility, so..

Then, in either case, it's harmless. 

Link to comment
34 minutes ago, DavidW said:

It gets installed as 318 on classic games. (Give me some credit for intelligence, please.)

OK, sorry, I don't own them so I cannot play / mod them 🙃...

Edited by Luke
Link to comment

Incidentally, the existing ENTROPY_SHIELD spellstate is already assigned to Entropy Shield (it gets assigned by the main Detectable Spells run, before the spellsystem modifications are installed - look at ds/ds_iwd.tpa). Since that spellstate uniquely identifies Entropy Shield, it's of course right in principle that my AI scripting could work with that spellstate, either by modifying its checks according to whether the Entropy Shield changes are present, or just assuming they are on the grounds that SCS assumes the standard shifts. Applying the SI_ABJURATION spellstate is a relatively quick-and-dirty alternative: since for the most part the AI should react to someone protected by modified Entropy Shield as if they were protected by a combination of original Entropy Shield and SI:Abjuration, setting that spellstate goes most of the way to allowing properly for Entropy Shield's modifications, without any need to tweak things at the script level. At the time that SCS v32 was released, that was of particular significance, because the changes to Entropy Shield were new and might have needed modification, and it was helpful to be able to do that without having to unpick a collection of script changes.

Link to comment
43 minutes ago, Luke said:

OK, sorry, I don't own them so I cannot play / mod them 🙃...

Fair enough!

The 'ds_make_detectable' function that entropy_shield_abjuration uses has quite a lot of processing built into it. Firstly it checks if 'id' (the stat in question, e.g. PRIORITY_DISPEL) is present in STATS.ids in a legal place (i.e. in the shortish range of stats that opcodes 233 and 282 can handle, or - on a classical game, if ToBEx is installed - the longer range that ToBEx opcode 318 can handle). If it's not, and if you're on an Enhanced-Edition game, it checks SPLSTATE,  adds the stat if it's not present, and adds it via opcode 328. If you're not on Enhanced edition, it checks for ToBex, and if it finds it, it adds the stat as a new stat in STATS.ids, and applies it with opcode 318. If it doesn't find ToBEx, it gives up. See ds/ds.tph if you want the gory details!

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...