Jump to content

Changing stealth button to a different one?


Recommended Posts

Hello, I wanted to change some stuff in thieves, but stealth is extremely hardcoded and doesn't allow for any real changes. Bard song on the other hand had many customisation options. So my question is - is it possible to change Stealth button, to act as bard song? Or to replace it entirely? And would song mechanic work for thieves?

Link to comment

You can replicate bard songs in other classes without too much trouble, and no need for .exe hacking. For a basic setup you need the following:

1. Innate song ability:

  • op177 .eff, timing mode 1 *
  • op171, give cancel song ability, timing mode 1
  • op172, remove this ability

2. .Eff:

  • op232, timing mode 1, condition hp<%, special = 102, casts song effect spell

3. Song effect spell:

  • like a bard song - use an appropriate projectile, and whatever effects you want

4. Cancel song ability:

  • op321 canceling innate song ability
  • op171, give innate song ability
  • op172, remove this ability

This creates a toggleable "song" in your innate abilities bar. Now there is an issue because bard songs automatically stop if you attack or cast a spell. So there are two things you can do here:

  1. Add effects to the innate song ability which prevent attacking and casting spells (op144+op145, and set APR to zero) - this means the player will need to manually cancel the song in order to attack or cast spells
  2. Add a melee hit effect (op248) and ranged hit effect (op249) to the innate song ability which triggers an .eff, and the .eff will use op146 to cast the cancel song ability; and also add a "global" or "casting feature" effect to every spell this person could cast (innates and, if it can multiclass, divine and/or arcane spells) with op146 casting the cancel song ability

Both of those can work well it done right. Option #2 involves adding stuff to like, every castable spell, sso in an abundance of caution I elect to use option #1.

Link to comment

Thank you for the replies! 

 

I thought of a bard song because I wanted to enhance Stealth without forcing players to do anything new, they would click "stealth" as usual, but the underlying logic would be different.

The best way would be to edit the spell being cast when your thief successfully goes invisible, but that's impossible to my knowledge. Then I thought of turning stealth into bard song button, so that I could create my own spells to be applied. As Graion said, it's doable with Eeex, but that would force players to install another mod to work properly. If it can't be done via UI editing available, only via exe hacking, then my best bet would probably be to disable stealth button entirely and just create an innate ability with some logics similar to stealth, with my additional changes.

Link to comment

Crazy idea off the top of my head: if you apply a permanent contingency on a thief, checking for some state that is applied by stealth, then you could do more things by sing the stealth button. Like, maybe stealth applies STATE_INVISIBLE or something. You could apply a permanent (timing 9) repeating effect that uses op326 to apply a spell whenever you have that state. 

This is actually a pretty cool idea, I might need to check into it a bit more. Need to confirm that stealth actually applies a state, and if it is the same state as invisibility then you would need to be okay with the thief getting the same effect when magically invisible etc. But that would probably be okay…

Link to comment

That's a possibility too. And if you really want only Stealth to get this bonus, you can always add a spell state to all magical invisibilities and in opcode 326 add another condition.

 

But I think that's still 1s that you'd have to wait for the effects to apply. And there will be situations where that would be too long, like shadowdancer->fighter with 10APR backstabbing enemies. Is there no way to check for something every 1 game tick?

Link to comment

Only way I've found to edit actionbar items, as in swapping them to something else, is through EEex. As such, EEex could be used to change the stealth button into a bard song and then alter the bard song for that particular kit/class to grant stealth when used and whatever else you want. One problem that readily comes to mind (outside of the button looking like a song) is there will be no way to account for skill points in hide in shadows/move silently with this approach (at least not easily).

If I may ask, what exactly are you hoping to have occur when you stealth?

Edited by morpheus562
Link to comment

EEEx works only for Windows, that's a problem, since not everyone has it or wants to install some Virtual Machine.

 

I am not sure yet, what I want to do, as I'm just looking at what's possible and what's not, only after that will I think in detail of the changes. But using song and opcode 326 would allow me for example to enable Hide in plain sight for everyone (link % chance to apply invisibility to hide in Shadows stat and somehow apply penalty to it when enemies are close, so you need 200 to have a chance to hide during combat)

Link to comment

I tried to find a way to use different button's behavior, when clicking on Stealth and I found this thread https://forums.beamdog.com/discussion/70192/is-it-possible-to-assign-one-class-interface-to-that-of-another-class 

Studying it and making some very simple testing showed, that if I have a character selected, I can for example make my Bard select Pick Pocket, by clicking Bard Song button, but I sadly I don't know how and where this buttonArray:OnLButtonPressed(3) is filled. If I could get a reference to that functions which are inside this array, I could probably be able to make the Thief sing a song, when Stealth button is clicked. Does anyone know if such thing is possible without EEEx?

Link to comment

Honestly I think that you should come up with a more concrete idea of what you want to do. Like, if you could sing a bard song from the stealth button then like all bard songs it would have a delayed effect, which you said you want to avoid. If you want a non-shadowdancer to be able to hide in plain sight… honestly you could just let them go invisible, which amounts to the same thing. (Tying the success to your stealth skill would be a bit tedious but totally doable.)

I generally see more specific questions lead to more helpful answers. To answer your most recent specific question, I have no experience messing with buttons. I have seen a spell, made by @Grammarsalad, that summons an invisible creature which can script the caster to hide like a thief. It would be easy enough to put that in an innate ability; so maybe it would be easier to make a bard who can hide, than a thief who can sing. (Always good to step back and look at other route to your goal.)

Link to comment

You're right, Bard Song won't work here. I thought that setting song's target to 7 (Caster, keep spell no animation) would make it work instantly, but that's not true. It seems that I will have to create a skill that will have all the logic. @subtledoctor how would you go about implementing successful stealth based on Hide in Shadows? I can use opcode 326 to get proper percentage chance to hide, I can even halven the chance if we're in outdoors area and it's daytime, but I am not sure if it's possible to properly check if there's enemy in sight and I would probably apply a -150 penalty to Hide in Shadows when that's the case. Sadly Cast Spell on Condition checks for enemy proximity once per round, so it's not instantly applied...

Link to comment
On 6/26/2022 at 2:15 PM, subtledoctor said:

Honestly I think that you should come up with a more concrete idea of what you want to do. Like, if you could sing a bard song from the stealth button then like all bard songs it would have a delayed effect, which you said you want to avoid. If you want a non-shadowdancer to be able to hide in plain sight… honestly you could just let them go invisible, which amounts to the same thing. (Tying the success to your stealth skill would be a bit tedious but totally doable.)

I generally see more specific questions lead to more helpful answers. To answer your most recent specific question, I have no experience messing with buttons. I have seen a spell, made by @Grammarsalad, that summons an invisible creature which can script the caster to hide like a thief. It would be easy enough to put that in an innate ability; so maybe it would be easier to make a bard who can hide, than a thief who can sing. (Always good to step back and look at other route to your goal.)

Oh yeah. It's actually pretty easy to do iirc. I have at least two spells that do think. Hold on

Link to comment
On 6/26/2022 at 2:15 PM, subtledoctor said:

Honestly I think that you should come up with a more concrete idea of what you want to do. Like, if you could sing a bard song from the stealth button then like all bard songs it would have a delayed effect, which you said you want to avoid. If you want a non-shadowdancer to be able to hide in plain sight… honestly you could just let them go invisible, which amounts to the same thing. (Tying the success to your stealth skill would be a bit tedious but totally doable.)

I generally see more specific questions lead to more helpful answers. To answer your most recent specific question, I have no experience messing with buttons. I have seen a spell, made by @Grammarsalad, that summons an invisible creature which can script the caster to hide like a thief. It would be easy enough to put that in an innate ability; so maybe it would be easier to make a bard who can hide, than a thief who can sing. (Always good to step back and look at other route to your goal.)

Oh yeah. It's actually pretty easy to do iirc. I have at least two spells that do think. Hold on.

 

Here is the script. It could probably be improved but this could get you started:

 

https://github.com/UnearthedArcana/B_Spells/blob/master/B_Spells/data/new_spells/ranger_1/B_CAMO.baf

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