Jump to content

Setscale Problems - Flickering NPCs? Script Help Required


MarchUntoTorment

Recommended Posts

This is a bug that I have encountered that I've isolated down to be connected with the mod 'Powered Power Armor', but would likely occur with any mod that uses the 'setscale' script command.

 

For those not in the know, PPA has a function which I absolutely love called 'Power Armor Scaling' which scales power armoured characters up to 1.15, which feels much more realistic and makes them seem much more imposing (and makes me feel incredibly intimidating while wearing it). I love it, and at this point, can't play without it.

 

However, it appears to cause severe problems with NPCs. Basically, they start constantly flickering back and forth between inventory states, for reasons that wholly escape my understanding (I'm not a Script God like some users here, I'm afraid). Dialogue cannot be initiated with them under any circumstances while this occurs, and it causes massive slowdowns to my PC while it occurs. After a time, between ten seconds and a minute, it ceases.

 

Can anyone with more knowledge on scripting offer a solution for this bug? It seems unlikely that I'm the only one who's come across it, as it appears to be inherent to the setscale command. If it's not, please do advise me on another way to fix it.

 

Thanks all!

 

P.S. Here's the script that PPA uses for scaling:

 

 

 

 

scn PPAPARescaleTokenScript

ref rContainer

begin onadd

set rContainer to getcontainer

rContainer.setscale PPAPAScale

removeme

end

 

 

 

 

If I had to take a guess, I'd say that the problem is that somewhere in there, the script keeps getting re-activated continuously, being stuck in an infinite loop. If any script junkies here could help me out, I'd greatly appreciate it, as I'm sure would the author of PPA (although he appears to be inactive).

Edited by MarchUntoTorment
Link to comment
Share on other sites

A few things come to mind, though I could be mistaken about them.

 

First, if the SetScale function is supposed to activate upon wearing the Power Armour, the script should begin OnEquip, instead of OnAdd. OnAdd means if it is in the inventory, but not necessarily equipped.

 

Second, I am unsure what the "RemoveMe" function is supposed to remove.

 

But the most likely cause of this issue is the lack of a DoOnce function. As it stands, it appears the script would keep running continuously all the while the Power Armour is sitting in someone's pocket.

 

Try something like this, perhaps?

scn PPAPARescaleTokenScript

short	DoOnce
ref	rContainer

BEGIN OnEquip

	set rContainer to GetContainer
	if ( DoOnce == 0 )
		rContainer.SetScale PPAPAScale
		set DoOnce to 1
		RemoveMe ;You should probably keep this in until you know what it does
	endif

END


BEGIN OnUnequip

	set DoOnce to 0

END

That should pretty much address all the issues I can see with the script you posted.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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