Jump to content

Photo

Need help with actor value speedmult


  • Please log in to reply
9 replies to this topic

#1
oyayeboo

oyayeboo

    Stranger

  • Members
  • Pip
  • 8 posts

heya!

i'm making my own little combat overhaul mod (yeah, i dont like all those existing mods for different reasons :P) and i'm stuck with speedmult actor value.

The problem is - changed value doesn't come in action instantly. In my mod speedmult depends on stamina percentage (at 0-30% stamina speedmult is (base speedmult)/2, at 80-100% stamina speedmult isn't altered and at 30-80% stamina speedmult is lowered by 1 for each percent of stamina loss under 80%). And the biggest disappointment is that movement speed is calculated from speedmult only when you switch to walk/run, block, attack or do-whatever-else-than-running. This results in actors running at 50% speed with higher than 30% stamina, unless they take any action. Does anyone knows any workarounds? :(



#2
portbash

portbash

    Enthusiast

  • Members
  • PipPip
  • 193 posts

I'll bump this one as I got the same problem: Speedmult manipulations are only applied/updated if player does some certain action (draw weapon, sneak...).

 

What's the trick? I've seen speed altering in other mods working just fine...



#3
SunDoWneR667

SunDoWneR667

    Stranger

  • Members
  • Pip
  • 9 posts

I'm not an expert, but if you want to keep track of something all the time maybe a "Quest" would do the trick?

 

QuestStage 10 = 80-100% Stamina

QuestStage 20 = 79-30% Stamina

etc,

 

and then do an If statement

 

If Stamina >= 79% SetStage 20

 

in Stage 20 do your Speedmult thingie...

 

Maybe it helps, you have to get the right syntax though.

 

Cheers Sunny



#4
Ceruulean

Ceruulean

    Fan

  • Members
  • PipPipPip
  • 368 posts

Actually, this topic has the same problem as you:

 

http://forums.nexusm...-trigger-enter/

 

Just to quote:

 

 

So, I collectively took the given advice and produced this new script, which is still not working

 

Actually, it does work, but it only works if I have my sword out. My character must walk over the trigger box area with their sword out, come to a complete stop, then walk again and their actor value will be changed. What can be done about this? Some kind of update interval or something?

Scriptname SpikyGrassSlowen extends ObjectReference  
 
String SpeedMult
 
Event OnTriggerEnter(ObjectReference akActionRef)
if akActionRef == Game.GetPlayer()
Game.GetPlayer().SetActorValue("SpeedMult", 50.0)
EndIf
EndEvent
 
Event OnTriggerLeave(ObjectReference akActionRef)
if akActionRef == Game.GetPlayer()
Game.GetPlayer().SetActorValue("SpeedMult", 100.0)
EndIf
EndEvent

 

To which I replied that he should use a magic effect, since it does not require any animation changes. Somehow the scripted method just doesn't want to work fluidly:

 

 

I honestly think you should try making a spell and magic effect, as lofgren suggests. Copy the "Slow" effects from the ice spells, remove the art shaders and sounds, make sure the "Recover," "Detrimental" checkboxes are ticked, although you may want to untick "Hostile." Change the spell from "Aimed/Target" to "Self," and "Concentration/Fire and Forget" to a "Constant Effect."  Then in the spell window, set the magnitude anywhere from 1 to 100, with 50 being 50% slower. Use the script to add the spell upon entering, and removing the spell upon leaving.

Scriptname SpikyGrassSlowen extends ObjectReference  
 
Spell Property SlowSpell Auto

Event OnTriggerEnter(ObjectReference akActionRef)
if akActionRef == Game.GetPlayer()
Game.GetPlayer().AddSpell(SlowSpell, false)
;The 'false' parameter prevents a UI message from popping up that says, 'Spell Added' in the upper corner
EndIf
EndEvent
 
Event OnTriggerLeave(ObjectReference akActionRef)
if akActionRef == Game.GetPlayer()
Game.GetPlayer().RemoveSpell(SlowSpell) ; No message will appear from removing a spell.
EndIf
EndEvent

It'll work just like the player had a frost spell cast on them, except if it is a Constant Effect spell there is no set duration for the debuff, only when you decide to remove it. There's no point going through the whole "Playidle" business; it's excessive.

 

Edited by Ceruulean, 22 June 2014 - 03:35 PM.


#5
portbash

portbash

    Enthusiast

  • Members
  • PipPip
  • 193 posts

I am using a (constant) magic effect! still the player has to draw the weapon or do other actions to make the new speedmult value kick in. I'll check out & reverse an ice spell... good idea. Thx

 

@Sunny: Thx mate but I'm just having difficulties to get the speedmult updated. Not messing with stamina and such. But thx for the effort.



#6
SunDoWneR667

SunDoWneR667

    Stranger

  • Members
  • Pip
  • 9 posts

Maybe you can use the SKSE Event "OnKeyDown"-> http://www.creationk...nKeyDown_-_Form ?

 

If I press WSAD -> Do something


Edited by SunDoWneR667, 22 June 2014 - 05:02 PM.


#7
portbash

portbash

    Enthusiast

  • Members
  • PipPip
  • 193 posts

Well... not even the original ice/slow spells are doing the trick. something ain't right.

 

@sunny: Yeah I might need to create a workaround using SKSE...

 

Right now I'm using the following hack:





			while player.isWeaponDrawn() == false
				player.drawWeapon()
				wait(0.0001)
			endwhile
			while player.isWeaponDrawn() == true
				player.SheatheWeapon()
				wait(0.1)
			endwhile

But there is a tiny moment where the weapon is shown - sucks. Going to try it with sneaking instead.


Edited by portbash, 22 June 2014 - 06:01 PM.


#8
Ceruulean

Ceruulean

    Fan

  • Members
  • PipPipPip
  • 368 posts

Heh, that is weird. I found this mod that seems to have a solution, as it acknowledges the same problems:

 

Frost Magic Bugfixes



#9
portbash

portbash

    Enthusiast

  • Members
  • PipPip
  • 193 posts

I'll check it out. Thx a lot Ceru!

 

 

EDIT:

 

From the mod description (Author WizardWhitenoise)

 

 

So what this mod does is changes the slow effects used by frost spells into script effects. The scripts resolve this issue by causing a temporary 1 lb change in inventoryweight (which is reversed at the end of the effect) just slightly after the speedmult change is applied, in order to force the game to recalculate effective run speed. The removal of this weight at the end accomplishes the same thing, recalculating the actor's actual runspeed when their speedmult is returned to 100.


Edited by portbash, 23 June 2014 - 08:18 AM.


#10
portbash

portbash

    Enthusiast

  • Members
  • PipPip
  • 193 posts

CONFIRMED & SOLVED

 

Manipulating the InventoryWeight actor value will update the SpeedMult value!

 

 

 

Download & endorse: Frost Magic Bugfixes


Edited by portbash, 23 June 2014 - 09:17 AM.





Page loaded in: 1.625 seconds