Jump to content

Can I set NPC orphan scale in furniture object?


jrfk2

Recommended Posts

Hi Folks,

So I have the orphans mod and all was well, then at some point a mod I added caused a number of my orphans to grow to adult size. Kinda creepy.

 

I had done this myself previsouly accidentally using the FurnitureScaleActorToOne keyword which I later removed.

 

To fix this in the game before on PC, I would go into workshop, target the grown orphan, and in the command line issue setscale 1.0 and that would put them back to orphan size .. but that is not working now.

 

So I have a school desk furniture object of my own creation I have the orphans assigned to .. and I was thinking maybe I could have that desk auto-fix them for me, if I could find a way to set their scale either as some property of the furniture object, or as part of the workshopobjectscript for this furniture object ..

 

Any ideas on this ..?

 

thanks ...

Link to comment
Share on other sites

I created a seperate script file and compiled it and added it as a script to the furnitureobject .. I put in some Debug statements to see if it would run .. didn't see them at all .. did I need to add any properties to the script when I add it to my furn obj? thanks...

Link to comment
Share on other sites

Shouldn't need any properties with the code I posted.

 

I personally never use Debug statements. Debug code does not run on console at all, and has to have a special build. Or so I understand, as I say, never used Debug once.

 

I like to craft my own message box if I need a feedback mechanism while testing.

 

The more I think about this the more I'm starting to realize something that may be an issue. Furniture uses the 'Scale Actor to 1' keyword to force characters into 1.0 adult scale so that their animations line up with the furniture.

 

Basically I'm starting to think Scale 1 to a Furniture item is different to an Actor's Base Record Scale 1. Furniture considers scale 1 to be Adult Human Standard Height (1). The Actor's record considers scale "The percent of my Race's full height".

 

So your child runs around with 1 scale in relation to a child (all is well). Gets into furniture and gets set to 1 scale Adult height. The furniture's 'automatic reset of scale' puts them at 1 Adult Height when they exit (oops now the game's data for that actor thinks they are a 1 scale Adult).

 

All just guess work, but back to the problem.

 

Perhaps the SetScale(1) works just fine, but because the actor is 'in' the furniture 1 in this context is 1 Adult Scale. So how about you move the code execution to when they exit the furniture?

 

Like so:

Scriptname FixScale extends ObjectReference Const
{Repair scaled actor}

Event OnInit()
  RegisterForRemoteEvent(Self,"OnExitFurniture")
EndEvent

Event OnExitFurniture(ObjectReference akActionRef)
  akActionRef.WaitFor3DLoad()
  akActionRef.SetScale(1)
EndEvent
Edited by MasterMagnus
Link to comment
Share on other sites

Just thought of a possible helpful change: SetRace() will reset the actor to their base race.

 

Scriptname FixScale extends ObjectReference Const
{Repair scaled actor}

Event OnInit()
RegisterForRemoteEvent(Self,"OnExitFurniture")
EndEvent

Event OnExitFurniture(ObjectReference akActionRef)
akActionRef.WaitFor3DLoad()

(akActionRef as Actor).SetRace()
akActionRef.SetScale(1)
EndEvent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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