GetCastPenalty

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Post Reply
TimMB
Posts: 12
Joined: 04 Jul 2017, 00:05
Github profile: https://github.com/tmbutterworth

GetCastPenalty

Post by TimMB » 28 Jan 2018, 22:15

I'm having some issues with the GetCastPenalty function. I'm trying to get the below StartUp script to function. I tested the individual compents I could test through the script console and all seem to be functioning. The variable is configured as a Global Variable. Can someone take a look. It seems like it should work. Sound I try the GetSpellEffect function instead and simplify it to a single sound volume?


;
; Sound effect for when player is affected by Sound Spell
; This needs a better sound effect (Buzzing, Ringing Noise)
;
Begin sc_snd_sp_snd_eff

; MenuMode Optimization
if ( MenuMode == 1 )
return; Stop Processing
endif

; StopSound Effect
if ( GetSoundPlaying, "s_sound_spell" == 1 ) ; Sound Effect Playing
if ( Player->GetCastPenalty = 0 ) ; No Cast Penalty
Player->StopSound, "s_sound_spell"
Return; Stop Processing
endif
if ( Player->GetCastPenalty > 0 ) ; Cast Penalty still in effect
Return; Stop Processing
endif
endif

; CastPenalty Check
if ( Player->GetCastPenalty = 0 ) ; No Cast Penalty
Return; Stop Processing
elseif ( Player->GetCastPenalty > 0 ) ; Cast Penalty Start Sound Effect
set GV_NoiseSound to 1
endif

; Play Sound Effect
if ( GV_NoiseSound == 1 )
if ( Player->GetCastPenalty >= 95 )
Player->PlayLoopSound3DVP, "s_sound_spell", 10.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 90 )
Player->PlayLoopSound3DVP, "s_sound_spell", 9.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 85 )
Player->PlayLoopSound3DVP, "s_sound_spell", 9.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 80 )
Player->PlayLoopSound3DVP, "s_sound_spell", 8.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 75 )
Player->PlayLoopSound3DVP, "s_sound_spell", 8.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 70 )
Player->PlayLoopSound3DVP, "s_sound_spell", 7.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 65 )
Player->PlayLoopSound3DVP, "s_sound_spell", 7.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 60 )
Player->PlayLoopSound3DVP, "s_sound_spell", 6.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 55 )
Player->PlayLoopSound3DVP, "s_sound_spell", 6.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 50 )
Player->PlayLoopSound3DVP, "s_sound_spell", 5.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 45 )
Player->PlayLoopSound3DVP, "s_sound_spell", 5.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 40 )
Player->PlayLoopSound3DVP, "s_sound_spell", 4.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 35 )
Player->PlayLoopSound3DVP, "s_sound_spell", 4.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 30 )
Player->PlayLoopSound3DVP, "s_sound_spell", 3.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 25 )
Player->PlayLoopSound3DVP, "s_sound_spell", 3.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 20 )
Player->PlayLoopSound3DVP, "s_sound_spell", 2.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 15 )
Player->PlayLoopSound3DVP, "s_sound_spell", 2.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 10 )
Player->PlayLoopSound3DVP, "s_sound_spell", 1.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty >= 5 )
Player->PlayLoopSound3DVP, "s_sound_spell", 1.0, 1.0
set GV_NoiseSound to 0
return; Stop Processing
elseif ( Player->GetCastPenalty > 0 )
Player->PlayLoopSound3DVP, "s_sound_spell", 0.5, 1.0
set GV_NoiseSound to 0
return; Stop Processing
else ; Error Control
set GV_NoiseSound to 0
return; Stop Processing
endif
endif

End sc_snd_sp_snd_eff

User avatar
akortunov
Posts: 246
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation
Github profile: https://github.com/akortunov

Re: GetCastPenalty

Post by akortunov » 29 Jan 2018, 05:07

IIRC, parameters in PlayLoopSound3DVP should be in 0-1.0 range, so you can not increase loudness endlessly.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests