Jump to content

Photo

Arcane Specialties (new mage-sorcerer-bard mod project)

mage wizard sorcerer specialist bard spell school mana pool focus

35 replies to this topic

#16 kjeron

kjeron
  • Members
  • 136 posts

Posted 07 August 2018 - 03:10 PM

What do you think about this? Could it work? It would be better or worse than make hundreds of rows in splprot for predetermined stat checks?

Yes, splitting it into separate spells would be better than hundreds/thousands of splprot entries, and should work, one way or another.

SPELLA: As is but without:
Protection From Spell #206 => (SPELL D)
// This is taken care of in SPELLB##

For SPELLB##:
(all minlvls)

  • Cast Spell #146 (instantly) => (SPELL D)

(min lvl: 1)

  • Immunity Spell #318 (value: 0, type: 0) (duration 2400/(2+CHA modifier)-1) => (SPELL A)
  • Immunity Spell #318 (value: (2+CHA modifier), type: STAT 116 < -1 splprot row) => (SPELLB##)
  • Cast Spell #146 (value: (2+CHA modifier), type: instantly at level) => (SPELL D)

(min lvl: 2)

  • Immunity Spell #318 (value: 0, type: 0) (duration 2400/(2+CHA modifier)*2-1) => (SPELL A)
  • Immunity Spell #318 (value: (2+CHA modifier)*2, type: STAT 116 < -1 splprot row) => (SPELLB##)
  • Cast Spell #146 (value: (2+CHA modifier)*2, type: instantly at level) => (SPELL D)

(min lvl: 3)

  • Immunity Spell #318 (value: 0, type: 0) (duration 2400/(2+CHA modifier)*3-1) => (SPELL A)
  • Immunity Spell #318 (value: (2+CHA modifier)*3, type: STAT 116 < -1 splprot row) => (SPELLB##)
  • Cast Spell #146 (value: (2+CHA modifier)*3, type: instantly at level) => (SPELL D)

(...)

SPELLC: (If we are or would go over maximum mana, remove all modifiers and reset current = maximum, cleans up accumulating effects)
(for all min lvls)

  • Remove Effects by Resource #321: => (SPELLC) // Remove Increments (over time)
  • Remove Effects by Resource #321: => (SPELLD) // Remove Reset (this one)
  • Remove Effects by Resource #321: => (SPELLE) // Remove Decrements (from casting) (SPELL6 in my first post)
  • Proficiency Modifier #233 (value: min lvl, type: 116, Increment)

// FYI minlvl is not capped at either 50 or 255 when set using the "Cast at Level" opcodes, if you need higher values.

SPELLD: Don't need the Cast SpellA, it will already be cast every round.

 

Use opcode 318 instead of 324 - the latter will flood the combat log with feedback messages about "Unaffected by effects from <RESOURCE>".


Edited by kjeron, 07 August 2018 - 03:12 PM.


#17 MaLa

MaLa
  • Members
  • 17 posts
  • Gender:Male
  • Location:Italy

Posted 07 August 2018 - 05:01 PM

Wow! This is much better then my version! Thank you very much!

 

 

Cast Spell #146 (instantly) => (SPELL D)

 

No delay? Maybe I'm missing something, but wouldn't this instantly regenerate one mana point after a spell has been cast at max mana?

 

 

FYI minlvl is not capped at either 50 or 255 when set using the "Cast at Level" opcodes, if you need higher values.

 

I was struggling for how to pass a value from one effect to another: this is brilliant!

 

 

SPELLD: Don't need the Cast SpellA, it will already be cast every round.

 

I was actually trying to avoid the "every round" casting with that chain cast, thinking that it would be less demanding for the game engine, but maybe it's a bit risky. Obviously in that case I would have removed the Cast On Condition and iniciate the chain by making every sorcerer spell cast SPELL A.



#18 kjeron

kjeron
  • Members
  • 136 posts

Posted 07 August 2018 - 06:28 PM

No delay? Maybe I'm missing something, but wouldn't this instantly regenerate one mana point after a spell has been cast at max mana?

Immunity to SPELLA is applied regardless of current mana. The very first time it triggers will be instant, but afterwards it would only occur if the timer (2400 / ((2+CHA)*level)) had already expired.

I was actually trying to avoid the "every round" casting with that chain cast, thinking that it would be less demanding for the game engine, but maybe it's a bit risky. Obviously in that case I would have removed the Cast On Condition and iniciate the chain by making every sorcerer spell cast SPELL A.

In that case having it cast SPELLA is probably correct.


Also a correction on SPELLB##
these lines should be specifying SPELLC:
Cast Spell #146 (value: (2+CHA modifier), type: instantly at level) => (SPELL D)
->
Cast Spell #146 (value: (2+CHA modifier), type: instantly at level) => (SPELL C)

Edited by kjeron, 07 August 2018 - 06:29 PM.


#19 MaLa

MaLa
  • Members
  • 17 posts
  • Gender:Male
  • Location:Italy

Posted 08 August 2018 - 12:54 AM

 

Cast Spell #146 (value: (2+CHA modifier), type: instantly at level) => (SPELL D)
->
Cast Spell #146 (value: (2+CHA modifier), type: instantly at level) => (SPELL C)

 

Yes, I figured that out, but I didn't want to be annoying, so I didn't correct you! =P


Edited by MaLa, 08 August 2018 - 06:29 AM.


#20 MaLa

MaLa
  • Members
  • 17 posts
  • Gender:Male
  • Location:Italy

Posted 21 August 2018 - 05:23 AM

How can I safely identify every spell that will be listed in the sorcerer starting and level up selection using WeiDU? Looking at SPWI name prefix, wizard (1) spell type, 2 starting values in SPELL.ids first column, it seems that none of them refers only to this kind of spell... I need to patch all of them, including any mod added spell



#21 kjeron

kjeron
  • Members
  • 136 posts

Posted 21 August 2018 - 07:34 AM

How can I safely identify every spell that will be listed in the sorcerer starting and level up selection using WeiDU? Looking at SPWI name prefix, wizard (1) spell type, 2 starting values in SPELL.ids first column, it seems that none of them refers only to this kind of spell... I need to patch all of them, including any mod added spell

SPWI[LEVEL][01-50].spl
All spells that follow that naming format are picked up by the engine to be selected by mages/sorcerers, minus those listed as IS_HIDDEN in "HIDESPL.2da".
Spell type doesn't even matter - the game will let you pick priest/innate spells if they are named as such (they won't work, but it still lets you).

#22 MaLa

MaLa
  • Members
  • 17 posts
  • Gender:Male
  • Location:Italy

Posted 07 October 2018 - 04:00 AM

Thank you kjeron for your previous reply, it was very helpful! I meant to thank you but then I forgot... so better late than never!

 

Anyway, it was a bit more complicated than I first expected, but I think now I'm very close to a working beta of the sorcerer component. At this point I could use some help with a couple of things:

 

- For now I'm using two proficency for the system to work: one for current mana and one for max mana. This is a bit wasteful since proficencies are dword and i need only 7 bits to store a value between 0 and 99. IIRC kjeron suggested me in a previous post to use the higher bits to avoid the conflict with the original function of the proficency, so I think maybe I could fit both values in the same proficency and still don't overwrite the first byte. I could easily bit-shift my values, but then how do I chek them for = or <= in #318 an #326 opcodes? the checks would need to be limited to the correct byte and this doesn't seem possible to me... I'm missing something?

 

- I need to detect when a character has just been revived to trigger a spell. I can't patch the casting of this spell in the revive spells because the spell need to be cast on self. The best solution I found util now would be to create a custom spell state, make all revive spell set it, and put a cast spell on condition on the charachter linked to that spell state. I still didn't test this solution, but I think it could work... is there a better solution? (spell states are a limited resource and I would prefer not using them)



#23 subtledoctor

subtledoctor
  • Modders
  • 2853 posts
  • Gender:Male

Posted 07 October 2018 - 04:50 AM

IIRC kjeron suggested me in a previous post to use the higher bits to avoid the conflict with the original function of the proficency, so I think maybe I could fit both values in the same proficency and still don't overwrite the first byte. I could easily bit-shift my values, but then how do I chek them for = or <= in #318 an #326 opcodes?

NI doesn't really support it but you can patch the effect in Weidu:

COPY ~mymod/spell.spl~ ~override~
  LPF ALTER_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (89 + (0x10000 * 1))

Parameter1 tells is to apply 1 point to the 2nd byte; parameter2 tells it to use stat 89 (bastard sword) and to increase rather than set the proficiency. 


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#24 MaLa

MaLa
  • Members
  • 17 posts
  • Gender:Male
  • Location:Italy

Posted 07 October 2018 - 05:16 AM

Yes, this is the part I understand, the problem is how to read that value correctly once I set it...
Now I have this four rows in splprot:

W7_CM_LT                    121                         -1                          2
W7_CM_EQ                   121                         -1                          1
W7_MM_LT                    122                         -1                          2
W7_MM_EQ                   122                         -1                          1

If I put everithing in the same stat, I can't use 1 (equal) or 2 (less) as relational operators because they will take the whole dword into consideration...



#25 subtledoctor

subtledoctor
  • Modders
  • 2853 posts
  • Gender:Male

Posted 07 October 2018 - 05:54 AM

I think if you want to use higher bytes then you need to check for bit-equality. Which means it gets rather complicated if you need the stat to represent more than 8 values. May e not impossible, just not something I can reliably rattle off the top of my head.

On the resurrection issue: I can't tell what the point of it is. To reset mana? Couldn't you just see effect timing to 1 instead of 9? Or maybe cast yhe reset spell upon resting (don't you have to do that anyway?) by checking for fatigue = 0?

But anyway my tl;dr suggestion is, if using a spellstate works then use a spellstate. Avoiding them is noble but there are 100 free states. If a bunch of mods limit themselves to adding 1, it's not going to be a problem. I use 1-2 spellstates per mod in 4 mods... it's not likely to be a problem unless someone gets greedy and uses 10 or 20.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#26 MaLa

MaLa
  • Members
  • 17 posts
  • Gender:Male
  • Location:Italy

Posted 07 October 2018 - 06:36 AM

 

I think if you want to use higher bytes then you need to check for bit-equality. Which means it gets rather complicated if you need the stat to represent more than 8 values. May e not impossible, just not something I can reliably rattle off the top of my head.

Yes, this is what I was thinking... binary match might be possible in a very complicated way, expecially for the less relation, I took it into cosideration for a while but i concluded that it ins't really feasable in practice. Too bad... Thanks anyway for your help!

 

On the resurrection issue: I can't tell what the point of it is. To reset mana? Couldn't you just see effect timing to 1 instead of 9? Or maybe cast yhe reset spell upon resting (don't you have to do that anyway?) by checking for fatigue = 0?

I need that to reactivate mana regeneration: currently it has a timing 1 to prevent the character from regenerating mana while dead. Mana regeneration is activated by casting a wizard spell and recast itself on a delay every time it triggers, so currently if it end prematurely it will not restart until the player casts a spell... this isn't ideal for me.



#27 MaLa

MaLa
  • Members
  • 17 posts
  • Gender:Male
  • Location:Italy

Posted 14 October 2018 - 06:51 AM

Update on the resurrection issue:

I tested the spellstate solution and it worked somewhat correctly... the issue with that is that cast spell on condition is very unreliable in respect to the trigger timing (it could easily trigger several seconds late). So I've been looking for a better solution and I found one, which I think could be worth sharing:

The issue was how to force a character to cast a spell on self whenever he has just been targeted by some other spell or item (in my case all resurrection spells and items).
This is my solution:

Patch all the spell/item/s you want to be able to force their target to cast the spell, adding to them a create magical weapon effect:
ocode: 111 target: 2 timing: 0 duration: 0 resource: YOURFAKEITEM

Create the item YOURFAKEITEM: most parameter are irrelevant, but it need to contain at least a weapon ability otherwise the game will crash. Add to this item all the effects you want the character to cast on self as equipping effects.

Done. The new item will be equipped by the target character, apply its equipping effects and immediately disappear.

I tested this solution and it works much better than the spellstate one (and doesn't consume a spellstate), so i think this could be helpful to anyone who need to solve a similar issue.



#28 kjeron

kjeron
  • Members
  • 136 posts

Posted 14 October 2018 - 09:31 AM

Patch all the spell/item/s you want to be able to force their target to cast the spell, adding to them a create magical weapon effect:
ocode: 111 target: 2 timing: 0 duration: 0 resource: YOURFAKEITEM

You also remove any other temporary weapon they may have, since resurrection spells don't have checks against targeting living creatures. (Not that the game doesn't already have such problems - casting Resurrection on a living target will remove most temporary abilities).

You can also use Sequencers to force a creature to cast a spell on themselves through another spell:
Opcode 177: Target (Preset) Resource (EFF, Opcode 256: Resource (Spell), Parent Resource (ParSpell))
Opcode 258: Target (Preset), Resource (ParSpell)
(Spell) should have range of 32767(max). (Spell) will be cast by the target, on themselves, at their caster level.
(If the spell forcing the cast is AoE, use Opcode 260 instead of 258, and all effects in (Spell) need to target (Self).)
The Opcode 177 effect can be in the Resurrection ability, or just permanently (timing=9) attached to each creature that needs it.
The opcode 258/260 effect would go in each Resurrection ability, after the opcode 177 if present.

#29 MaLa

MaLa
  • Members
  • 17 posts
  • Gender:Male
  • Location:Italy

Posted 14 October 2018 - 04:38 PM

 

You also remove any other temporary weapon they may have, since resurrection spells don't have checks against targeting living creatures. (Not that the game doesn't already have such problems - casting Resurrection on a living target will remove most temporary abilities).

Ok, this isn't really an issue in my case (except maybe for players willing to abuse the rod of resurrection for the heal effect), but it does limit drastically the flexibility of this solution, since it can't be safely applied to spells intended to target living creatures.

Looking at your proposed solution, it seems that I reinvented the wheel but made it square =P

I will implement your version, even if it isn't really needed, because i must say it is definitely more elegant.

I can't say enough how much your help is appreciated, this mod owe you a great deal!

 

edit:

doing a quick test I found a downside to the spell sequencer solution: it displays the spell sequencer active portrait icon and this can be confusing for the player. Is this unavoidable? If this is the case, given that in this specific application is very unlikely to occour the magical weapon overriding issue, I think maybe my original solution could be preferable...


Edited by MaLa, 14 October 2018 - 05:49 PM.


#30 kjeron

kjeron
  • Members
  • 136 posts

Posted 14 October 2018 - 07:51 PM

doing a quick test I found a downside to the spell sequencer solution: it displays the spell sequencer active portrait icon and this can be confusing for the player. Is this unavoidable? If this is the case, given that in this specific application is very unlikely to occour the magical weapon overriding issue, I think maybe my original solution could be preferable...

As a permanent effect, it's unavoidable.
Putting it in the resurrection spell as instant/zero-duration will avoid the icon though.

Edited by kjeron, 14 October 2018 - 07:51 PM.




Reply to this topic



  



Also tagged with one or more of these keywords: mage, wizard, sorcerer, specialist, bard, spell, school, mana, pool, focus

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users