Jump to content

what's behind the scene that avoid some player attribute value take effect in game ?


coldloc

Recommended Posts

Posted

take one example , playerspeed attribute

 

when modify its value from console or by scripts,  the user wont directly feel any movement speed update changes by pressing wasd key,  until user do certain special animevent such as 

 

1.sprint 

2.sneak and stand up again

 

then repress wasd keys movement speed will be updated. 

anyone familar with whats running behind the scene ?  and how can we do live value changes to bypass such blocking mechanisms that prevent user to have accelaration of speed changes....  

Posted

Player speed is from the height of the char

 

Try setscale .75

 

It's because if the character was short it would look like they were gliding or skiing

Posted
3 hours ago, RohZima said:

Player speed is from the height of the char

 

Try setscale .75

 

It's because if the character was short it would look like they were gliding or skiing

hmm, i think 

 

player.forceav speedmult [speedvalue] 

 

is the one supposed to immediately force player speed property change in the above senario i described. 

 

Posted
1 hour ago, coldloc said:

hmm, i think 

 

player.forceav speedmult [speedvalue] 

 

is the one immediately force player speed property change in the above senario i described. 

 

I'm not totally sure but i think that problem ONLY happend when you use the CONSOLE.

When you put the commands in a SCRIPT are correctly executed inmediately whithout need make more.

Take a look to the DD files that change the speed when equip items. Only have a line with:

akTarget.DamageActorValue("SpeedMult", FlatSpeedDebuff)

 

The actor vaules have a lot of diferent ways for modify it and you can use:

ForceActorValue, ModActorValue, SetActorValue, DamageActorValue, RestoreActorValue...

Each one make diferent things and maybe some are not applied inmediatelly with script but i doubt it.

Posted
1 hour ago, GenioMaestro said:

I'm not totally sure but i think that problem ONLY happend when you use the CONSOLE.

When you put the commands in a SCRIPT are correctly executed inmediately whithout need make more.

 

maybe some are not applied inmediatelly with script but i doubt it.

agreed with most values are immediaty changed and take effect as well in skyrim.

but the "speed" attribute example i used is a bit special that behaves differently.

 

I guess that most games

may have applied  at least two values 

the display value and internal value ,

some are of the same address or linked with one another, while some are diff

as for speed attribute in skyrim i guess the display value had already been changed by the time console or papyrus code executed , yet the internal value that allows player realtime update moving speed didnt change at that point until triggered by some extra actions or commands mentioned above. 

 

later when i reach home i will try to provide more examples that even applied the above console equivalent script didnt immediately change the player speed.

Posted

@RohZima  @GenioMaestro

 

below for your reference,   

 

image.png.2677a395b20baa382501b4a490c86403.png

 

as in the Papyrus script ,  if  I  try 

float newspeedValue = 500.0 
Player.ForceAV("speedmult", newspeedValue  )

the player speed display value would be changed,   same as the console command,  if I get player speed value after these two lines successfully been executed,  player speed display value would be 500. 0 ,  exactly. 

 

 

this could be same with  ( in console command ) 

 

image.png.c470bd1496b0c1f5b7cc63cbb9b5389f.png

 

 

However, at this moment,   "w a s d " movement key won't let u feel the player speed had been changed immediately. 

 

 

If I want Player to immediately speed up the internal speed as well  ,

I can try below ( extra method in papyrus or in console use "SAE"    )

Player.ForceAV("speedmult", ret as int ) 
  
;//Extra Sprint behavior simulation
Debug.SendAnimationEvent(Player, "moveStart")
Utility.wait(0.2)
Debug.SendAnimationEvent(Player, "SprintStart")
Utility.wait(0.2)
Debug.SendAnimationEvent(Player, "SprintStop")
Utility.wait(0.2)
Debug.SendAnimationEvent(Player, "moveStop")
Utility.wait(0.2)

after these lines been executed,  when user directly press the keyboard "w a s d",   will be able to feel the live speed changes.

without manually pressing sprint or sneak / cancel sneak extra actions. 

 

but then back to the main topic is 

I would like to know what happened when executing these additional lines  ,  or what's the hidden script skyrim engine did behind all those extra actions that is kind of unnecessary.  

Posted
2 hours ago, coldloc said:

after these lines been executed,  when user directly press the keyboard "w a s d",   will be able to feel the live speed changes.

without manually pressing sprint or sneak / cancel sneak extra actions. 

 

but then back to the main topic is 

I would like to know what happened when executing these additional lines  ,  or what's the hidden script skyrim engine did behind all those extra actions that is kind of unnecessary.  

https://www.creationkit.com/index.php?title=Actor_Value

 

Go to the end of the page, read and learn.

 

Changes made to the player's SpeedMult actor value will not take effect instantly, whether these changes are scripted or the result of a Spell. Speed changes are applied only when the player's inventory weight or carry capacity change.

  • If you are changing the player's speed with a Value Modifier magic effect, you can force the changes to apply and to wear off properly using an ActiveMagicEffect script attached to the magic effect. OnEffectStart, you'll want to modify the carry capacity actor value for the player (akTarget): increase it by 0.1, and then decrease it by 0.1 immediately after. Do the same thing OnEffectFinish.
Posted
2 hours ago, GenioMaestro said:

https://www.creationkit.com/index.php?title=Actor_Value

 

Go to the end of the page, read and learn.

 

Changes made to the player's SpeedMult actor value will not take effect instantly, whether these changes are scripted or the result of a Spell. Speed changes are applied only when the player's inventory weight or carry capacity change.

  •  

many thanks for the article,  this could be one good reference to look into and try the method it mentioned,  although it doesnt explain much on

 

why the above listed extra anim actions that seems irelavent of changing either inventory weight nor carry capacity

 

would trigger speedmulti take effect. 

Posted
59 minutes ago, coldloc said:

many thanks for the article,  this could be one good reference to look into and try the method it mentioned,  although it doesnt explain much on

 

why the above listed extra anim actions that seems irelavent of changing either inventory weight nor carry capacity

 

would trigger speedmulti take effect. 

The SendAnimationEvent, of course, not have a DIRECT connection with inventory weight or carry capacity change. The only relation can be in this parragraf:

https://www.creationkit.com/index.php?title=SendAnimationEvent_-_Debug

  • Animation Event's will actually cause the actor to perform the action associated with it. For example, sending the animation event "AttackStart" will cause the reference to perform an attack. Anything in front of it will get hurt. This example is true for all animation event's. For example, sending the "DeathAnim" will actually kill the actor.

When you call SendAnimationEvent the actor execute the REAL action, that is, if you send "Atack" the actor execute a REAL atack and if you send "Kill" the actor are REALLY dead. In the same way, if you send "SprintStart" the actor REALLY play the sprint animation and i presume they REALLY move, i not test it.

 

That mean that the SendAnimationEvent are DIRECTLY connected with the Game Engine but in a special way.

I'm totally sure the CORE Game not use SendAnimationEvent for make the movement. But if any script want make a movement can use the animation layer for REALLY make move the actor. I presume the SendAnimationEvent make much more things that the game make when you press the move key.

 

Is a simple layer theory. The game must execute the minimun lines of code for move the actor because the movement keys can be presed a lot of time and execute it in an intenal fast loop. But when the game process the SendAnimationEvent make much more things and sure verify a lot of things for play the correct animation, and probably verify the SpeedMult value. In the same way, when you send "AttackStartLeftHand" you not select WHAT animation must be played but the game play the CORRECT animation depending on what have the actor in the hand. The attack animation is DIFERENT if you have magic staff, sword or the empy hand. For that i think SendAnimationEvent make a lot of things.

Posted

thanks to GenioMaestro  for writing such in-depth explanations on this topic ,  also I've tested the method mentioned in CK document, 

Quote

Changes made to the player's SpeedMult actor value will not take effect instantly, whether these changes are scripted or the result of a Spell. Speed changes are applied only when the player's inventory weight or carry capacity change

 

walking speed immediately updated no side effects.  below should be more elegant way to update real-time player movement speed so far compared with previous one. 

Player.ForceAV("speedmult",  new_speedvalue ) 
Player.ModAv( "carryweight", 0.5 )
Player.ModAv( "carryweight", -0.5 )

( this is a reference to a size control mod used this method in Fphqsmain.psc in which it adjusted moving speed along with actor height / sccale changes ) 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...