Jump to content

NiOverride Script Not Working


arandomperson23

Recommended Posts

Posted

I'm trying to make Sexlab change NiNode actor height alongside the vanilla actor scale. Mods like PSQ change it a lot and mess up animations. I managed to compile sslActorAlias.psc but it never changes the height when used with an animation. I've tried a lot of different ways of adding NiOverride.AddNodeTransformScale to the code but nothing ever changes.

 

My current code looks like this

 

state Ready

	bool function SetActor(Actor ProspectRef)
		return false
	endFunction

	function PrepareActor()
		; Remove any unwanted combat effects
		ClearEffects()
		if IsPlayer
			Game.SetPlayerAIDriven()
			NiOverride.AddNodeTransformScale(PlayerRef, false, isFemale, "NPC", "SexLab.esm", 1.0)
			NiOverride.UpdateNodeTransform(PlayerRef, false, isFemale, "NPC")
		endIf
		if ActorRef
			NiOverride.AddNodeTransformScale(ActorRef, false, isFemale, "NPC", "SexLab.esm", 1.0)
			NiOverride.UpdateNodeTransform(ActorRef, false, isFemale, "NPC")
		endIf
		ActorRef.SetFactionRank(AnimatingFaction, 1)
		ActorRef.EvaluatePackage()
		; Starting Information
		LoadShares()
		GetPositionInfo()
		IsAggressor = Thread.VictimRef && Thread.Victims.Find(ActorRef) == -1
		; Calculate scales
		float display = ActorRef.GetScale()
		ActorRef.SetScale(1.0)
		float base = ActorRef.GetScale()
		ActorScale = ( display / base )
		AnimScale  = ActorScale
		ActorRef.SetScale(ActorScale) 

 

 

and for node removal

 

function RestoreActorDefaults()
	; Make sure  have actor, can't afford to miss this block
	if !ActorRef
		ActorRef = GetReference() as Actor
		if !ActorRef
			return ; No actor, reset prematurely or bad call to alias
		endIf
	endIf	
	; Reset to starting scale
	if ActorScale != 0.0
		ActorRef.SetScale(ActorScale)
		NiOverride.RemoveNodeTransformScale(ActorRef, false, isFemale, "NPC", "SexLab.esm")
		NiOverride.UpdateNodeTransform(ActorRef, false, isFemale, "NPC")
	endIf 

 

 

but I've also tried adding the NiOverrides directly after ActorRef.SetScale(ActorScale). What makes even less sense is right in the same code (different function) are NiOverrides for high heels that work just fine. As far as I can tell everything should be working. Any ideas?

 

Sorry if this belongs in Sexlab technical support, I thought since it's mostly about NiOverrides it would fit better here.

Posted
Sometimes compiling scripts is not enough (depending on the script itself).

It is an integral part of the Save. Have you tested these changes with a new game?

Posted

 

Sometimes compiling scripts is not enough (depending on the script itself).
It is an integral part of the Save. Have you tested these changes with a new game?

 

Yes, still didn't work.

Posted

They should be. The only parts I added were the NiOverride lines, I included the rest here for context. You can look at the full sslActorAlias.psc from your sexlab files and add my changes in if you want to see the whole code.

Posted

1 is used to reset the actor to default size for the animation. That part only matters if you have height changing mods that use vanilla scaling.

 

I'm wondering if the NiOverride from the high heels event is interfering with my changes. I'm going to try removing those lines entirely and compiling. Probably won't work but it's worth a shot.

Posted
I use NIO scripts intensively - but only for morphs (ingame highheels also for stockings, pregnancy, etc.).

With Node scaling I never occupied myself. :(

 

Perhaps it is good to return the method / function return as a message.

Debugging and simple Try -Catch is unfortunately not possible with Papyrus.

Posted

Alright I added debug message boxes after all of my changes and they showed just fine. I also tried changing NPC to NPC_HEAD 5 and none of the heads changed size.

 

Edit: I'm so confused. I took a guess that a raw number might not work so I used ActorScale as the value. Now when animations start both actors disappear, when the animation ends they reappear but any hdt parts are gone.

 

Edit2: Changed the scale value to 'base' (which is 1.0). Same thing happens, but only to actors that have a changed height scale. If they haven't been changed their hdt parts are normal.

 

Edit3: Uh, I don't know what I did but I managed to scale player and actor. I'll edit this again when I figure out why it works now, maybe this will help someone in the future.

 

Edit4: So it did work, but it scales both actors BY that amount, not TO that amount, so it's just increasing their size. On top of that the animations are offset by the scale.

 

I would really like to use SetNodeScale and GetNodeScale to have it work like the vanilla SetScale and GetScale, but unfortunately I can't call functions from racemenuplugin. I may try some other options but I don't think it will work.

Archived

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

  • Recently Browsing   0 members

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