Jump to content

Dynamic Update on Speedmult?


kieranh7

Recommended Posts

Hey fellas,

 

Stuck on a small script, courtesy of game mechanics, and I was wondering if anyone knows of a possible work-around for it ?

 

This specific script basically alters the speed mult for a set period in seconds for a sprint-type ability, but due to the restraint on pc running-speed updating it wont trigger unless the pc either sprints, or crouches (same as when used via console player.setav speedmult XX), but i'm trying to get it to dynamically update, based on the effect duration, ie effect kicks in, then runs out, aposed to having to manually sneak etc each time to trigger.

 

Any help is greatly appreciated, code below. Thanks.

 

bool bIsFinishing = False

Event OnEffectStart(Actor Target, Actor Caster)
	RegisterForUpdate(1)
	Game.GetPlayer().ModActorValue("SpeedMult", 500)
	Game.GetPlayer().IsSprinting()
	Game.GetPlayer().IsRunning()

EndEvent

Event OnEffectFinish(Actor Target, Actor Caster)

	bIsFinishing = True
	RegisterForUpdate(1)
	Game.GetPlayer().ModActorValue("SpeedMult", -500)
	Game.GetPlayer().IsSprinting()
	Game.GetPlayer().IsRunning()	

endevent 

 

I added in the Update register, and isSprinting,Running as a bash to try get the game to update speedtype automatically, but it didn't work.

Link to comment
Share on other sites

I know nothing about Papyrus, just common programming concepts (lil bit of ada and lil bit of c++) but i think you're using stuff there that doesnt does what you think it does

 

http://www.creationkit.com/OnUpdate_-_Form

http://www.creationkit.com/RegisterForUpdate_-_Form

 

That registerforupdate does nothing since you dont have a OnUpdate event there (or maybe you didnt quoted the entire sources). And these two lines are doing nothing if im not mistaken:

 

Game.GetPlayer().IsSprinting()

Game.GetPlayer().IsRunning()

 

You're just asking "Is the player sprinting?" it returns a boolean (true/false) then doing nothing with that boolean. And then asking "is the player running?" and doing nothing with that again.

 

The only two things that are doing something there are the bIsFinishing = true and the two ModActorValue.

 

Having said all that, i dont know how to do what you're asking. Im guessing that the game updates the actor speed value when the player changes their type of movement (walking to running, sprinting to walking, etc), not in between them. At first glance that seems kinda out of reach for Papyrus (forcefully update the current actor movement speed) but as i said, i know nothing bout it so i may be wrong. Maybe you can artificially change the sprinting or running checks for a sec so the game updates the speed values right there.

 

EDIT: Maybe you can do it with SKSE or ScriptDragon. I think that those can set key presses. Just make the script press the sprint button for half a second for the game to update the current speed value.

 

Seems overly complex just for doing that, maybe some ppl with experience can point out other solutions.

Edited by eltucu
Link to comment
Share on other sites

Add a secondary effect to the spell which when it starts adds for example 0.01 to carry weight and when it ends removes 0.01 from carry weight again. Changing carry weight makes the game update speed, and using a small magnitude like 0.01 will ensure you don't actually affect gameplay (due to round MAYBE the actor will sometimes get or lose 1 point of carry weight, but that seems like a reasonable trade-off)
Link to comment
Share on other sites

erm not sure if that the problem, not in the mood to think logicially atm :D

but

 

-500 != /500

 

speedmultiplier 500 = speed x (+500)

speedmultiplier -500 = speed x (-500)

 

a x (-b) is simply not equal to a / b

 

hence your speed does not get reset, as in reverting the multiply, but becomes somin else

Link to comment
Share on other sites

Thanks very much for all replies fellas, Sorry about the rubbish script lines, I was throwing stuff in there randomly by the end, to see if it helped lol. Going to try all suggestions, very much appreciated. I'll report back if they work.

 

@Jaysus, Its ok mate, tested it, works fine reverting to normal, as its Mod actor value, instead of 'Set', so it just modifies the speed val by 500, even though im using the speedmult, it doesn't alter the multiplier. Thanks for the help.

 

Thanks a lot.

 

Edit: Borgut1337 , your idea worked perfectly, great thinking there I must say. Will include your help on the credits of the mod, Thanks a lot guys for the help.

 

Now, I just need to find out what the papyrus syntax is for 'player.SetGS fjumpheightmin' for a jump ability, tried the AV type of it which is jumpingBonus, but that doesn't work, can't seem to find it anywhere on the CK wiki.

Edited by kieranh7
Link to comment
Share on other sites

Thanks very much for all replies fellas, Sorry about the rubbish script lines, I was throwing stuff in there randomly by the end, to see if it helped lol. Going to try all suggestions, very much appreciated. I'll report back if they work.

 

@Jaysus, Its ok mate, tested it, works fine reverting to normal, as its Mod actor value, instead of 'Set', so it just modifies the speed val by 500, even though im using the speedmult, it doesn't alter the multiplier. Thanks for the help.

 

Thanks a lot.

 

Edit: Borgut1337 , your idea worked perfectly, great thinking there I must say. Will include your help on the credits of the mod, Thanks a lot guys for the help.

 

Now, I just need to find out what the papyrus syntax is for 'player.SetGS fjumpheightmin' for a jump ability, tried the AV type of it which is jumpingBonus, but that doesn't work, can't seem to find it anywhere on the CK wiki.

 

No need to put me in credits, I didn't come up with it myself, I just followed this thread on bethsoft forums when it was active: http://forums.bethsoft.com/topic/1333531-ive-made-a-fortify-speed-spell-but-theres-a-bit-of-an-issue/page__hl__speed

Link to comment
Share on other sites

Thanks very much for all replies fellas, Sorry about the rubbish script lines, I was throwing stuff in there randomly by the end, to see if it helped lol. Going to try all suggestions, very much appreciated. I'll report back if they work.

 

@Jaysus, Its ok mate, tested it, works fine reverting to normal, as its Mod actor value, instead of 'Set', so it just modifies the speed val by 500, even though im using the speedmult, it doesn't alter the multiplier. Thanks for the help.

 

Thanks a lot.

 

Edit: Borgut1337 , your idea worked perfectly, great thinking there I must say. Will include your help on the credits of the mod, Thanks a lot guys for the help.

 

Now, I just need to find out what the papyrus syntax is for 'player.SetGS fjumpheightmin' for a jump ability, tried the AV type of it which is jumpingBonus, but that doesn't work, can't seem to find it anywhere on the CK wiki.

 

No need to put me in credits, I didn't come up with it myself, I just followed this thread on bethsoft forums when it was active: http://forums.bethsoft.com/topic/1333531-ive-made-a-fortify-speed-spell-but-theres-a-bit-of-an-issue/page__hl__speed

 

Even so, thanks a lot.

 

 

Didn't want to make another thread just for this one question. Does anyone know the papyrus syntax for SetGS? ie 'Player.SetGS fJumpHeightMin 300' for example. I've tried various guesses at it, such as ofc Game.GetPlayer().SetGS("fJumpHeightMin", 500) which is not a defined function, tried modAV, SetGravityScale(which was a guess). Tried SetGameSetting, Can't find it on CK wiki either. If anyone knows, and can let me know it would be very much appreciated. Thanks a lot.

Edited by kieranh7
Link to comment
Share on other sites

Didn't want to make another thread just for this one question. Does anyone know the papyrus syntax for SetGS? ie 'Player.SetGS fJumpHeightMin 300' for example. I've tried various guesses at it, such as ofc Game.GetPlayer().SetGS("fJumpHeightMin", 500) which is not a defined function, tried modAV, SetGravityScale(which was a guess). Tried SetGameSetting, Can't find it on CK wiki either. If anyone knows, and can let me know it would be very much appreciated. Thanks a lot.

 

There isn't any function for that. I know it's weird and it sucks, but will probably have to wait for the SKSE guys to implement it

Link to comment
Share on other sites

  • Recently Browsing   0 members

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