Jump to content
⚠ Known Issue: Media on User Profiles ×

Handling MovableStatics in Papyrus


verteiron

Recommended Posts

In some of my spell scripts I spawn, move, scale, and otherwise manipulate statics in the world to provide effects. This works fine as long as I attach some OnCellDetach events to the script to make sure the statics don't get stuck.

 

My problem is there is a type of object called a MovableStatic that is not handled like Statics. MovableStatics are fun objects that I'd really like to be able to use in my spell scripts (thick smoke trails on meteors, for example), but the CK Wiki has next to no info on MovableStatics. They don't seem to have a Papyrus property type, and using property type Static doesn't let me pick MovableStatic objects. Their CK type is MSTT, but that doesn't get me anywhere.

 

I thought I could do a property like

 

Static property FXSmokeLargeClose01 auto

 

And then autofill, but this doesn't work.

 

I've seen a couple of threads here related to this subject on the Bethsoft forums, but they've all petered out without an answer.

 

Is there ANY way to handle these things in Papyrus? If there's absolutely no way to set a MovableStatic property, then can anyone recommend a method for spawning these troublesome objects?

Link to comment
Share on other sites

Well for anyone else searching for a solution to this, there just flat-out doesn't seem to be a MovableStatic type at all. The only way I have been able to do this is by making an ObjectReference property, then picking the MovableStatic from an existing location, then spawning it with something like this:

 

Form MyMoveableStaticBase = MyMoveableStatic.GetBaseObject() 
ObjectReference foo = Game.GetPlayer().PlaceAtMe(MyMoveableStaticBase, 1)

 

This gets me an ObjectReference named Foo that I can then manipulate. Thanks to SinderionsBones and RandomNoob on the Bethsoft forums for pointing me in the right direction.

 

Only downside to this is if I want to use a MovableStatic that isn't placed anywhere in the game, I have to add it to a hidden corner of a cell somewhere, then pick it. The Rube Goldberg Creation Kit strikes again ;)

Link to comment
Share on other sites

A static, and a movable static, when in the world *are* object references :D that's why this works. It's not that you're treating them as this, it's that this is what they are.

 

the 'getbaseobject' is returning a base object type form. Placeatme() creates a new object based on the form you pass the function. You are already making new ones :D

 

the original 'mymoveablestatic' is not being moved, just duplicated based on its type (you got it's type, it's 'formbase' from the 'getbaseobject()', this is also optional)

 

If you want to move the existing object, you use moveto(), or translateto() depending on if you want to see it move.

Link to comment
Share on other sites

Right. I understand why this works, but it's different and more roundabout than the method I use to place statics in my spells. In my Summon Ice Wall spell, for example, I have 2 Static (not ObjectReference) properties that I populate at design time with the statics I want to use in the spell, selected from the list of all available Static objects. I'm just surprised there is no corresponding property for MovableStatics, and that to use them I have to basically clone an existing ingame object rather than use, say, a MovableStatic property. I like the Property method because it doesn't matter whether the object I want to use is already placed somewhere or not; there are a number of interesting MovableStatics that are not on any maps. To use those with the ObjectReference property, I have to add them to some map somewhere first.

 

My understanding is that if I did a PlaceAtMe of an objectreference property, I would actually be relocating the in-game instance of that object, not a new copy, which is why the GetBaseObject step is needed. Is that wrong?

Edited by verteiron
Link to comment
Share on other sites

You can avoid placing a dumb Ref in the world and declare the Base Object property as a Form.

See Setting a Form as a Property works OK

 

It's not actually that hard to do even if you have to edit the FormID of the VNAM. If you want to go that route and it's not clear then feel free to ask :)

 

---

The PlaceAtMe always makes a new Ref. MoveTo would relocate the orig.

Link to comment
Share on other sites

  • 1 year later...
  • Recently Browsing   0 members

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