Jump to content


Photo

[Disregard] Why is opcode 272 used for auras instead of using opcode 146 in EE games?


7 replies to this topic

#1 Ulb

Ulb
  • Members
  • 146 posts
  • Gender:Male

Posted 09 August 2017 - 09:41 PM

*edit* To answer my own question: You can't do that because opcode146 will disrupt any spells your character casts, you incredibly dimwitted moron, you just used that effect to stop a character from singing its bard song!

Also, note to self: Stop posting before coffee..

 

So when ever I wanted to build a passive aura or an other repeating effect I've been using opcode 272 to do that. But in the other thread Argent mentioned that opcode 272 is affected by slow/haste and it got me thinking; why not just use opcode 146 instead and have it loop itself?

 

I understand that this kind of stuff was probably a bit straining on the classic engine and that back then the only way to stop the loop would probably have been protection from spell. On the EEs however that seems not to apply anymore.

 

Here is an example for a healing aura:

spell <party only area projectile> with melee effects:
-cast spell <the same spell> <delay/permanent 6s > <target self>
-current hp bonus <x> <instant p.u.d.> <preset target>

The aura is canceled with another spell which you get via the old give/remove switcheroo at the spell effect level.

 

I did some quick testing and this seems to work just fine. So am I missing something or is doing it this indeed a good way to do it in the EE engine?


Edited by Ulb, 09 August 2017 - 10:32 PM.


#2 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2551 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 09 August 2017 - 11:54 PM

I'm quite certain that instant casting (param2=1) doesn't interrupt anything? In that case, no particular reason I can think of immediately.

Except, you gotta be careful with infinite nesting like that. I once made a mistake of looping 146 that used multi hit projectile, that was rather amusing to watch for several rounds until I had to close the program in task manager :D.


Edited by Ardanis, 09 August 2017 - 11:57 PM.

"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#3 kjeron

kjeron
  • Members
  • 66 posts

Posted 10 August 2017 - 01:06 AM

A delayed 146 is fine for a duration spell, but it cannot be used for permanent auras.  Death, Export, Ctrl+R, and (Opcode 17, Param2 BIT16) will all remove it.  272 and 232 can be used with timing mode 9, which is not removed by such.  I prefer 232 only because 272 still has stacking issues.



#4 Ulb

Ulb
  • Members
  • 146 posts
  • Gender:Male

Posted 10 August 2017 - 01:13 AM

I'm quite certain that instant casting (param2=1) doesn't interrupt anything? In that case, no particular reason I can think of immediately.

Except, you gotta be careful with infinite nesting like that. I once made a mistake of looping 146 that used multi hit projectile, that was rather amusing to watch for several rounds until I had to close the program in task manager :D.

 

Hm, I'll give it a try later and see if it works.

 

A delayed 146 is fine for a duration spell, but it cannot be used for permanent auras.  Death, Export, Ctrl+R, and (Opcode 17, Param2 BIT16) will all remove it.

 

That wouldn't be a problem since the character would have the “turn aura off” spell. So you would just have to cast that one once and could then re-cast the aura spell.



#5 subtledoctor

subtledoctor
  • Modders
  • 2145 posts
  • Gender:Male

Posted 10 August 2017 - 05:33 AM

After a LOT of experimentation over the last 2 years, I've found that 232 is the way to go for this kind of thing. No stacking issues, no interruption issues, no worries about some condition ending it or causing it to be impossible to end when you need it to, etc. Works for toggleable effects, permanent effects, item equipping effects, whatever. It's very reliable, no-muss-no-fuss.

I've been in the process of switching all of my aura-like abilities over to opcode 232, soon they will all use it. (Except for the improved bonus spell slot items, they need to use a different mechanic.)

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


#6 Ulb

Ulb
  • Members
  • 146 posts
  • Gender:Male

Posted 10 August 2017 - 08:09 AM

After a LOT of experimentation over the last 2 years, I've found that 232 is the way to go for this kind of thing. No stacking issues, no interruption issues, no worries about some condition ending it or causing it to be impossible to end when you need it to, etc. Works for toggleable effects, permanent effects, item equipping effects, whatever. It's very reliable, no-muss-no-fuss.

I've been in the process of switching all of my aura-like abilities over to opcode 232, soon they will all use it. (Except for the improved bonus spell slot items, they need to use a different mechanic.)

 

In that case I'll take your word for it and do the same. Thanks for the advice :)



#7 subtledoctor

subtledoctor
  • Modders
  • 2145 posts
  • Gender:Male

Posted 10 August 2017 - 08:43 AM

All credit goes to kjeron, who helped me make it work really seemlessly:

- 177 effect targeting EA/all

- .eff has 232 effect with condition = "hp < spelcial" and special = "102" and offsets 0x90 and 0x94 left blank

- the resulting .spl has the targeting information and begins with a 321 effect canceling itself.  (In pre-EE there is no opcode 321, so you would have to create a custom secondary type and then the first effect would be the opcode that cancels spells with that seccondary type.)

 

It works like a bard song - it kicks in at the end of a round, so there might be a 1-5 second delay the first time you enable it, or when targets come into range if it has a range.  But aside from that it's been working great.  (And, since I use it to replicate bard songs, this could actually be considered a bonus for being extra faithful in the reproduction. ;) )


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


#8 Avenger

Avenger
  • Modders
  • 3711 posts
  • Gender:Male
  • Location:Hungary

Posted 12 August 2017 - 01:01 AM

There is also opcode 333 in the EE that may (or may not) help with aura type spells.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users