Tokens, equip sounds, and effect shaders.

Post » Fri Feb 18, 2011 8:44 pm

I've been experimenting with using tokens for Realistic Fatigue and I've kinda got it working but with some annoying side effects. I have a token that has a zero magnitude drain fatigue effect on it as well as a script that adjusts the drain magnitude and equips/unequips the token to adjust the drain. This is working except with the following annoying side effects;

1) I'm using addItemNS and removeMe and I suspect that these trigger sounds, but I must admit I haven't heard them because I add the tokens to actors when they are far away and add them to the player only once at the start. I believe adding them via a container is the trick to remove these sounds, but I'm a little worried how this will interact with onAdd blocks...

2) I'm using equipItemNS and unEquipItemNS, and I get the annoying equip/unequip sounds. AFAIK there is no way to equip/unequip without these sounds... is that true? I'm also using SetNthEffectItemMagnitude and modAVMod together to adjust the magnitude without equip/unequip, but I want to unequip and totally remove the effect when the magnitude is zero.

3) The DrainFatigue effect includes an effect shader, so all actors that have the token equipped are glowy red. How do I remove this effect shader? I've attempted adding a script effect to the enchantment alongside the fatigue drain with no script and NONE as the shader but it didn't help. Is there some trick to removing the shader?

There are also a bunch of annoying things that require workarounds like gamemode blocks sometimes running immediately on addItemNS before onAdd blocks run, and removeMe not always immediately removing the item, resulting in many gameMode block executions afterwards (sometimes 100s of frames) . I'm adding tokens to actors within 4000 of the player with a quest, and they remove themselves when they are more than 6000 from the player, mostly just to ensure that I don't litter the savegame with tokens.

I've looked at Kurtee's Battle Fatigue and Injuries, and AFAIKT he just lives with the add/remove and equip/unequip sounds and messes with the drainEffect shader to fix the red glow. He also includes a scary amount of defensive coding. He alwasys adds/remove items as required to ensure there is only 1 token in the inventory, and idles his token scripts whenever the player is changing cells.

If there is no easy way to fix these, the general pain of tokens is getting t me and I might just abandon them in favour of my existing scripted ability using modav2. In particular the effect shader is really bad.
User avatar
Jonathan Braz
 
Posts: 3459
Joined: Wed Aug 22, 2007 10:29 pm

Post » Sat Feb 19, 2011 7:05 am

I've been experimenting with using tokens for Realistic Fatigue and I've kinda got it working but with some annoying side effects. I have a token that has a zero magnitude drain fatigue effect on it as well as a script that adjusts the drain magnitude and equips/unequips the token to adjust the drain. This is working except with the following annoying side effects;

1) I'm using addItemNS and removeMe and I suspect that these trigger sounds, but I must admit I haven't heard them because I add the tokens to actors when they are far away and add them to the player only once at the start. I believe adding them via a container is the trick to remove these sounds, but I'm a little worried how this will interact with onAdd blocks...
If you want to make sure no sounds are triggered, simply use the old standby:
message " "message " "AddItem / RemoveItem


2) I'm using equipItemNS and unEquipItemNS, and I get the annoying equip/unequip sounds. AFAIK there is no way to equip/unequip without these sounds... is that true? I'm also using SetNthEffectItemMagnitude and modAVMod together to adjust the magnitude without equip/unequip, but I want to unequip and totally remove the effect when the magnitude is zero.
Again, use the double blank message method.

3) The DrainFatigue effect includes an effect shader, so all actors that have the token equipped are glowy red. How do I remove this effect shader? I've attempted adding a script effect to the enchantment alongside the fatigue drain with no script and NONE as the shader but it didn't help. Is there some trick to removing the shader?
Try using HasEffectShader (OBSE) and StopMagicShaderVisuals.

There are also a bunch of annoying things that require workarounds like gamemode blocks sometimes running immediately on addItemNS before onAdd blocks run, and removeMe not always immediately removing the item, resulting in many gameMode block executions afterwards (sometimes 100s of frames) . I'm adding tokens to actors within 4000 of the player with a quest, and they remove themselves when they are more than 6000 from the player, mostly just to ensure that I don't litter the savegame with tokens.
You could always set a flag when you want the item to remove itself, and have that loop near the top of the GameMode.

I've looked at Kurtee's Battle Fatigue and Injuries, and AFAIKT he just lives with the add/remove and equip/unequip sounds and messes with the drainEffect shader to fix the red glow. He also includes a scary amount of defensive coding. He alwasys adds/remove items as required to ensure there is only 1 token in the inventory, and idles his token scripts whenever the player is changing cells.
Making sure there is only one token in the inventory is pretty critical. I also use a lot of "defensive" coding in my mods that utilize tokens.

If there is no easy way to fix these, the general pain of tokens is getting t me and I might just abandon them in favour of my existing scripted ability using modav2. In particular the effect shader is really bad.
Again, simply use HasEffectShader and StopMagicShaderVisuals.
User avatar
Liii BLATES
 
Posts: 3423
Joined: Tue Aug 22, 2006 10:41 am

Post » Sat Feb 19, 2011 12:13 am

If you want to make sure no sounds are triggered, simply use the old standby:
message " "message " "AddItem / RemoveItem


And that really stops the sounds too? I kinda assumed that it just stopped the message spam.

Try using HasEffectShader (OBSE) and StopMagicShaderVisuals.

Just using StopMagicShaderVisuals will stop the shader if it's been applied by other magic. This means my mod will stop the drainEfffect shader applied by other magical drains, which I don't want. I only want my enchantments to have no shader effect.

I'm sure there used to be some way to do this... didn't OOO and a heap of other magical mods change the script effect shader to do nothing so that you could have spells/enchantments/etc fired by activators with no shader or sounds? Also, wasn't something like ResistWaterDamage often used because its shader does nothing too? Enchantments will use the shader with the largest magnitude effect... is there some way to convince it to use a different shader?

You could always set a flag when you want the item to remove itself, and have that loop near the top of the GameMode.

Making sure there is only one token in the inventory is pretty critical. I also use a lot of "defensive" coding in my mods that utilize tokens.

Yeah...that's what I've been doing too. Though I'm getting kinda frustrated with the constant "try it/fix it" iterations to find/fix all the poorly documented and surprising behaviours. It feels like a massive bundle of bugs re-badged as features.
User avatar
Nicole Elocin
 
Posts: 3390
Joined: Sun Apr 15, 2007 9:12 am

Post » Sat Feb 19, 2011 8:56 am

And that really stops the sounds too? I kinda assumed that it just stopped the message spam.
Yup, it stops the sounds as well.

Just using StopMagicShaderVisuals will stop the shader if it's been applied by other magic. This means my mod will stop the drainEfffect shader applied by other magical drains, which I don't want. I only want my enchantments to have no shader effect.

I'm sure there used to be some way to do this... didn't OOO and a heap of other magical mods change the script effect shader to do nothing so that you could have spells/enchantments/etc fired by activators with no shader or sounds? Also, wasn't something like ResistWaterDamage often used because its shader does nothing too? Enchantments will use the shader with the largest magnitude effect... is there some way to convince it to use a different shader?
You could, of course, drain the fatigue through a script, which would use ResistWaterDamage or something like that. The major problem with this is that there are a frustratingly large number of mods that blithely modify the sounds / effects of ResistWaterDamage / Darkness which means that all the other mods that use them for no sound / visual effect are screwed. I've encountered this problem numerous times with RGO over the years.

Yeah...that's what I've been doing too. Though I'm getting kinda frustrated with the constant "try it/fix it" iterations to find/fix all the poorly documented and surprising behaviours. It feels like a massive bundle of bugs re-badged as features.
Well, yeah. That happens a lot with Oblivion. :P
User avatar
BEl J
 
Posts: 3397
Joined: Tue Feb 13, 2007 8:12 am

Post » Sat Feb 19, 2011 7:44 am

OBSE version 20 comes with EquipItemSilent command which "in addition to suppressing UI messages, also suppress the "item up/down" sounds generated by their original versions".
from: http://www.obse.silverlock.org/obse_command_doc.html
User avatar
Jack Bryan
 
Posts: 3449
Joined: Wed May 16, 2007 2:31 am

Post » Fri Feb 18, 2011 8:05 pm

You could, of course, drain the fatigue through a script, which would use ResistWaterDamage or something like that. The major problem with this is that there are a frustratingly large number of mods that blithely modify the sounds / effects of ResistWaterDamage / Darkness which means that all the other mods that use them for no sound / visual effect are screwed. I've encountered this problem numerous times with RGO over the years.

I thought that many mods now make the script effect shaders/sounds do nothing, so when you select None as your visuals effect for the script effect you get no sounds or visuals. Making it a silent/invisible script effect is pretty easy, but I wanted to try and use actual drain effects so that they would appear on the players magic effects menu and explain what caused it (fatigue drain from encumbered, or from wounded, or whatever). It would also mean the active effects on the actor become the record of the applied drain, rather than having to track my own "script" modifiers.

It would be great if I could trick oblivion that my enchantment is a script effect even though it has drains, because then I could have the drain effects without the visuals/sounds. I tried adding a script effect with no script to the enchantment after the drain, but that didn't work. Maybe if it included a script then it would consider it "larger" than the 0 fatigue drain and use the scripts empty effects. Or maybe I need to make the script effect the first effect on the enchantment... is this worth trying?

If I can't make the drain effects "silent" then I'll have to just use scripted drains instead... that seems more mod friendly than just changing the drain effect shader which is what kurtee's battle fatigue and injuries seems to do.

OBSE version 20 comes with EquipItemSilent command which "in addition to suppressing UI messages, also suppress the "item up/down" sounds generated by their original versions".
from: http://www.obse.silverlock.org/obse_command_doc.html

I tend to avoid beta versions of OBSE and build my mods for the currently released versions... so for me the double message thing might be the winner, even thought it sounds like a nasty side-effect hack :-)
User avatar
Oyuki Manson Lavey
 
Posts: 3438
Joined: Mon Aug 28, 2006 2:47 am

Post » Fri Feb 18, 2011 10:27 pm

I thought that many mods now make the script effect shaders/sounds do nothing, so when you select None as your visuals effect for the script effect you get no sounds or visuals. Making it a silent/invisible script effect is pretty easy, but I wanted to try and use actual drain effects so that they would appear on the players magic effects menu and explain what caused it (fatigue drain from encumbered, or from wounded, or whatever). It would also mean the active effects on the actor become the record of the applied drain, rather than having to track my own "script" modifiers.

It would be great if I could trick oblivion that my enchantment is a script effect even though it has drains, because then I could have the drain effects without the visuals/sounds. I tried adding a script effect with no script to the enchantment after the drain, but that didn't work. Maybe if it included a script then it would consider it "larger" than the 0 fatigue drain and use the scripts empty effects. Or maybe I need to make the script effect the first effect on the enchantment... is this worth trying?

If I can't make the drain effects "silent" then I'll have to just use scripted drains instead... that seems more mod friendly than just changing the drain effect shader which is what kurtee's battle fatigue and injuries seems to do.
I have no idea - usually I run into the issue when a Magic mod happily modifies the various effects to make new spells. And by "me" I mean users who complain about something I can't do much to fix, without breaking someone else's mod.
User avatar
Hope Greenhaw
 
Posts: 3368
Joined: Fri Aug 17, 2007 8:44 pm

Post » Fri Feb 18, 2011 9:40 pm

Yup, it stops the sounds as well.

My tests seem to show otherwise... it definitely stops the message, but not the sounds, at least not for equipItem and unequipItem. I even tried putting 3 long messages before calling equipItem and the sounds were still there.

So it looks like the only easy way is OBSE 0020's EquipItemSilent.

The good news is you can use the following to equip a token with a dynamic fatigue drain EffectItem without the drain effect shader or hitshader triggering;

	SetMENoHitEffect 1, DRFA	SetMEIsHostile 0, DRFA	SetNthEIMagnitude fatigueHealthDrain, aaRFWounded, 0	actor.equipItemNS aaRFWoundedToken 1


And you can use this to adjust the magnitude of the drain after it's been equipped;

	; Find the drain fatigue effect from the token on the actor and adjust it.	let i := actor.GetActiveEffectCount	while i > 0		let i -= 1		if  actor.GetNthActiveEffectMagicItem i == aaRFWounded			if actor.GetNthActiveEffectMagicItemIndex i == 0				; Set/GetNthAEMagnitude use negative numbers for drains				let temp := -fatigueHealthDrain - actor.GetNthActiveEffectMagnitude i				if temp					call aaRFDebug actor, "adjusting wounded token by " + $temp					actor.ModNthActiveEffectMagnitude temp, i					actor.modAVMod fatigue, max, temp				endif			endif		endif	loop


And the drain will be correctly removed when the token is unequipped or removed. The bad news is messing with the MagicEffect NoHItEffect and IsHostile will affect every other fatigue drain effect, so you need to set it back after the token has been equipped. The token takes a frame (or two?) to equip, so you need to leave them off for a bit to make sure. If you have multiple tokens possibly doing this in different frames, you risk having a token toggle it back on when another token is still being equipped. So you need a single central quest to control toggling it off and on that tokens can interface with and request that it be turned off for 2 (more) frames.
User avatar
Lynette Wilson
 
Posts: 3424
Joined: Fri Jul 14, 2006 4:20 pm

Post » Sat Feb 19, 2011 1:32 am

My tests seem to show otherwise... it definitely stops the message, but not the sounds, at least not for equipItem and unequipItem. I even tried putting 3 long messages before calling equipItem and the sounds were still there.
Huh. I've used the two messagebox thing since the very early days of RGO. For me, it removes both the message and the sounds of adding an item to the player. Strange.
User avatar
xx_Jess_xx
 
Posts: 3371
Joined: Thu Nov 30, 2006 12:01 pm

Post » Sat Feb 19, 2011 9:33 am

Huh. I've used the two messagebox thing since the very early days of RGO. For me, it removes both the message and the sounds of adding an item to the player. Strange.

It probably works for adding items, but not equipping them. I suspect the reason for this is addItem/removeItem works in the same frame you call it, but equipItem/unequipItem seems to take a frame or two after you call it before it happens. This means you probably need to do the message trick a frame or two after calling equipItem/unequipItem to suppress it. This suggests spamming empty messages for a couple of frames after calling equipItem/unequipItem might do it... testing that now... Nope... even doing pairs of empty messages for 4 frames after equipItem/unequipItem still gives the equip/unequip sound.
User avatar
Tessa Mullins
 
Posts: 3354
Joined: Mon Oct 22, 2007 5:17 am


Return to IV - Oblivion