Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Weight change effect script not dynamically updating


Truthslayer
 Share

Recommended Posts

Hi, I'm trying my hand at redoing the scripts for Size Changing Spell Effects to use SKSE functionality and at the same time pull the values as variables to expand the range of possible original sizes and to affect more actors (eventually). That seemed to work without crashing as badly as the default thanks to the wait delays I added. Then I decided to try my hand at using the GetWeight/SetWeight functions as well since no one else seems to be doing this specifically. In short, the weight is changing, but I'm not getting the body to update on the fly like the height is without constantly equipping/unequipping the armor.

 

From the included code, can anyone give suggestions/ideas as to why this is and how to fix it?

 

Scriptname lxlFattenTemp extends ActiveMagicEffect  
  

  
float Property OriginalWeight auto

Event OnEffectStart(Actor akTarget, Actor akCaster)

actorbase pakTarget = akTarget.GetActorBase()
float Weight = pakTarget.GetWeight()
Debug.Notification(Weight)
OriginalWeight = Weight
while (Weight < 100.0)
	Weight += 0.5
	akTarget.GetActorBase().SetWeight(Weight)
	akTarget.QueueNiNodeUpdate()
	Utility.Wait(0.5)
endWhile
Debug.Notification(Weight)	
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
actorbase pakTarget = akTarget.GetActorBase()
float Weight = pakTarget.GetWeight()
while (Weight > OriginalWeight)
	Weight -= 0.4
	akTarget.GetActorBase().SetWeight(Weight)
	akTarget.QueueNiNodeUpdate()
	Utility.Wait(0.5)
endWhile

akTarget.GetActorBase().SetWeight(OriginalWeight)
akTarget.QueueNiNodeUpdate()

EndEvent

 

 

Link to comment
Share on other sites

I don't use SKSE for my scripts.

 

But my guess here is your using the 'actor base', not the actor the spell is affecting. So in order for that specific actor to be updated back to the base object, I would assume it would need to look at the base again, which I suspect is done when you equip some type of clothing as you noted.

Link to comment
Share on other sites

Okay, it's just that I am using akTarget.QueueNiNodeUpdate(), which is to that actor itself. Again, I'm using a setheight version of this for the vertical size and it works, updating the height on the fly. I'm just stumped as to why the weight one doesn't. 

 

PS. How do I get the code to display without the alternating white lines?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...