Jump to content

[LE] Reliably Getting Size of an Actor


Haravikk

Recommended Posts

I have a script which needs to distinguish actors based on a size rating.

 

Currently I'm doing this with form lists and putting races such as trolls, werewolfs etc. into one (large) and giants, dragons etc. into another (giant) but this feels like a really clunky and inflexible way to do this as the actors I'm processing could potentially be anything at all, so could include new creatures added by mods that I would have to add support for in patches and such.

 

What I'd rather do is have some threshold by which something is considered large, giant etc. based upon its actual physical size, even if it requires a bit of fudging.

 

My first thought was to just compare against Actor.GetHeight(), but this only works when the actor is standing normally, since it's based on the bounding box size (which can change). Height alone also isn't super useful, as werewolves and trolls aren't actually that tall compared to regular humanoids, but they are bulky.

 

My next idea was to instead multiply Actor.GetHeight(), Actor.GetWidth() and Actor.GetLength() into a volume and do it that way, which would better reflect the full size of an actor. This feels better, though I'm wary about it involving three function calls to another script, as any of these three values could change during the calculation; probably a negligible risk but feels risky all the same.

 

I've noticed that races do have a size property, which could be used to identify giant (extra large) creatures, but as far as I can tell this isn't accessible anywhere via script?

 

Has anyone used any other tricks to detect a rough "size" for creatures or is calculating volume probably my best bet?

Link to comment
Share on other sites

I've noticed that races do have a size property, which could be used to identify giant (extra large) creatures, but as far as I can tell this isn't accessible anywhere via script?

 

 

It's not and even if it were, I don't think it would be useful to you. I went through the entire race list (vanilla skyrim only)

 

Race | Size

 

Dragon XL

Giant XL

MammothRace XL

UndeadDragonRace XL

 

AtronachFrostRace L

AtronachStormRace L

BearBlackRace L

BearSnowRace L

DwarvenCenturionRace L

FrostbiteSpiderRaceGiant L

 

ElderRaceVampire S

MudcrabRace S

SkeeverRace S

SkeeverWhiteRace S

SprigganSwarmRace S

SwarmRace S

WitchlightRace S

 

All that aren't listed are Medium size.

Link to comment
Share on other sites

I'm not sure I can use those unless I've missed a trick to handling the values they return? Scale seems to just be a percentage of the size of the model or some value set by the skeleton (a giant's scale for example is 1.0, same as an average sized humanoid), and mass appears to be arbitrary or also scaled to model size?

Edited by Haravikk
Link to comment
Share on other sites

  • Recently Browsing   0 members

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