some scripting helps

Post » Wed Jun 20, 2012 3:08 am

heyoooh

my first post here, and its to ask for help. how original of me.

that said, i totally still need help and try as i might i just cant figure this tuckfard out.

sooOOooo...

what i'm trying to do here, is create a speed boost that applies when a spell affect is applied to the character. further more, i'm trying to get that speedboost to occur when the walk key is pressed (i.e not running, sprinting, sneaking)

i can apply the effect successfully, and the speedboost itself works, just not in any predictable or manageable way. it has worked on a double tap of sprint, all the time, none of the time, only during the weapon draw/sheath animations (i have no idea). its actually driving me a little batty :(

so, in full and unnecessary detail...

Spoiler
Scriptname wendigospeedscr extends activemagiceffect  function modav(string speedmult)if game.getplayer().issprinting() == 1          game.getplayer().modav(speedmult, 110)elseif game.getplayer().isrunning() == 1         game.getplayer().modav(speedmult, 110)elseif game.getplayer().issneaking() ==1         game.getplayer().modav(speedmult, 120)elseif game.getplayer().isrunning() ==0 && game.getplayer().issprinting() == 0 && game.getplayer().issneaking() == 0        game.getplayer().modav(speedmult,200)endifendfunction

i wrote this code myself, guessed pretty much everything from reading the list of things on the creation kit. but...yeah...i dont even know if this is being executed at all.

any help please?
i wub you :biggrin:
User avatar
James Rhead
 
Posts: 3474
Joined: Sat Jul 14, 2007 7:32 am

Post » Wed Jun 20, 2012 8:19 am

Check it out
Event OnEffectStart(Actor akTarget, Actor akCaster)if game.getplayer().issprinting() == 1		  game.getplayer().modav(speedmult, 110)elseif game.getplayer().isrunning() == 1		 game.getplayer().modav(speedmult, 110)elseif game.getplayer().issneaking() ==1		 game.getplayer().modav(speedmult, 120)elseif game.getplayer().isrunning() ==0 && game.getplayer().issprinting() == 0 && game.getplayer().issneaking() == 0		game.getplayer().modav(speedmult,200)endifendevent

For spell you must use this event
Event OnEffectStart(Actor akTarget, Actor akCaster)
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am

Post » Tue Jun 19, 2012 10:37 pm

Spoiler
Event OnEffectStart(Actor akTarget, Actor akCaster)float speedmult = Game.GetPlayer().GetActorValue(speedmult) as floataktarget = game.getplayer()akcaster = game.getplayer()if game.getplayer().isrunning() == 1 &&  game.getplayer().issprinting() == 1 && game.getplayer().issneaking() == 1speedmult = 200elseif speedmult <= 100speedmult = 500endifendevent

hey man, thanks for the reply. i changed to the event as suggested, and had to change most of the code as well, it was saying that the value speedmult was undefined. this is still not working though :(

i dont like to be a pain in the proverbial, :(

thanks again :)
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Wed Jun 20, 2012 6:45 am

you can use the original code, you just need to declare speedmult as a string variable (kinda dumb, I know, but what can you do?)
you were getting that error because the function ModAV expects a string (name of AV to modify). you were giving it a string, just not declaring it properly

string speedmultEvent OnEffectStart(Actor akTarget, Actor akCaster)if game.getplayer().issprinting() == 1				  game.getplayer().modav(speedmult, 110)elseif game.getplayer().isrunning() == 1				 game.getplayer().modav(speedmult, 110)elseif game.getplayer().issneaking() ==1				 game.getplayer().modav(speedmult, 120)elseif game.getplayer().isrunning() ==0 && game.getplayer().issprinting() == 0 && game.getplayer().issneaking() == 0			    game.getplayer().modav(speedmult,200)endifendevent
User avatar
Big mike
 
Posts: 3423
Joined: Fri Sep 21, 2007 6:38 pm

Post » Tue Jun 19, 2012 10:47 pm

Guys you have forgotten "speedmult"
game.getplayer().modav("speedmult",200)
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Wed Jun 20, 2012 4:46 am

I'm pretty sure this is just me being stupid now. the entire speedmult thing...simply does not work as a script, i dont know what i'm doing wrong at all :(

if i change the spell type from script to peak value mod (speedmult) it works, i cant set it to only affect walking...but it works...

the script itself doesnt work, compiles but no worky.

i would post a screeny but...well...i cant...so...poop...but i'm looking at it now, its a very good one...had pertinent informations on it and everything...also my [censored]...but mostly information...

is there something thats so painfully obvious that i have missed it entirely? like..."click here to disable everything in the world ever"

or am i striving for the impossible?
User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am

Post » Wed Jun 20, 2012 1:46 am

The game doesn't realize you changed speedmult until it goes to recheck it (when you go from normal running to sprinting and stuff like that), a work around for this is to change the players carryweight as well, this causes the speedmult change to update properly
For example I used a function like this to cause it to update:
bool osc = falseFUNCTION oscCarryWeight()	IF osc == false	    Game.GetPlayer().ModAV("CarryWeight", 0.01)	ELSE	    Game.GetPlayer().ModAV("CarryWeight", -0.01)	ENDIF	osc = !oscENDFUNCTION
User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm


Return to V - Skyrim