Replicating Grummite Water Healing

Post » Mon Nov 28, 2011 6:37 pm

I created a birthsign called the Undine, which grants the possixr water-breathing, and regeneration while in the water or rain. To do the latter I simply copied the script for the Grummite's aquatic regeneration. It works fine. However, I found that the water healing does not work if you are standing in water (i.e. if your feet touch bottom). It only works if you are completely underwater, or treading water that is too deep to stand in. Obviously this is just how the IsSwimming function works. Does anyone know a function I can use, in order for the script to work if the character is standing in say only knee-deep water? I cannot find one in the Construction Set Wiki.

Here is the script below:
ScriptName BSUndineWaterHealingScriptShort RegenOnShort RainGenOnBegin ScriptEffectStart	RemoveSpell BSUndineRegenWater	RemoveSpell BSUndineRegenRainEndBegin ScriptEffectUpdate	If RegenOn == 0		If IsSwimming == 1			RemoveSpell BSUndineRegenWater			AddSpell BSUndineRegenWater			Set RegenOn to 1		EndIf	Else		If IsSwimming == 0			RemoveSpell BSUndineRegenWater			Set RegenOn to 0		EndIf	EndIf	If RainGenOn == 0		If IsInInterior == 0			If IsRaining == 1 && IsSwimming == 0				RemoveSpell BSUndineRegenRain				AddSpell BSUndineRegenRain				Set RainGenOn to 1			EndIf		EndIf	Else		If IsRaining == 0 || IsInInterior == 1			RemoveSpell BSUndineRegenRain			Set RainGenOn to 0		EndIf			EndIfEndBegin ScriptEffectFinish	RemoveSpell BSUndineRegenWater	RemoveSpell BSUndineRegenRainEnd

User avatar
Amber Hubbard
 
Posts: 3537
Joined: Tue Dec 05, 2006 6:59 pm

Post » Mon Nov 28, 2011 11:42 am

There's OBSE's http://cs.elderscrolls.com/constwiki/index.php/IsUnderWater. Might just be what you're after?

Try...
ScriptName BSUndineWaterHealingScriptShort RegenOnShort RainGenOnBegin ScriptEffectStart	RemoveSpell BSUndineRegenWater	RemoveSpell BSUndineRegenRainEnd;====================================Begin ScriptEffectUpdate	If RegenOn != (IsSwimming || IsUnderWater)		Set RegenOn to (RegenOn == 0)		If RegenOn			AddSpell BSUndineRegenWater		Else			RemoveSpell BSUndineRegenWater		EndIf	EndIf	If IsInInterior		If RainGenOn			Set RainGenOn to 0			RemoveSpell BSUndineRegenRain		Else			Return		EndIf	ElseIf (RainGenOn != IsRaining)		Set RainGenOn to (RainGenOn == 0)		If RainGenOn			AddSpell BSUndineRegenRain		Else			RemoveSpell BSUndineRegenRain		EndIf	EndIfEnd;====================================Begin ScriptEffectFinish	RemoveSpell BSUndineRegenWater	RemoveSpell BSUndineRegenRainEnd
...?

^Optimized. The below segments behave identically...
	If (bVar == 1)		If (Condition == 0)			Set bVar to 0			;UndoStuff		EndIf	ElseIf (bVar == 0)		If (Condition == 1)			Set bVar to 1			;DoStuff		EndIf	EndIf
	If (bVar != Condition)		Set bVar to (bVar == 0) ; <--- Set bool to whatever it is not		If bVar			;DoStuff		Else			;UndoStuff		EndIf	EndIf
...but the latter is more concise using a ...boolean hinge which will behave like a do once both ways.
User avatar
Emmie Cate
 
Posts: 3372
Joined: Sun Mar 11, 2007 12:01 am

Post » Mon Nov 28, 2011 5:05 pm

Sadly, IsUnderwater does the same thing as IsSwimming. So no joy in Mudville.
User avatar
Rach B
 
Posts: 3419
Joined: Thu Mar 08, 2007 11:30 am

Post » Mon Nov 28, 2011 9:48 pm

Maybe http://cs.elderscrolls.com/constwiki/index.php/GetSoundPlaying?
User avatar
Gemma Archer
 
Posts: 3492
Joined: Sun Jul 16, 2006 12:02 am


Return to IV - Oblivion