Jump to content

MovableStatic in a property


Recommended Posts

Without knowing more of what is trying to be done, an answer specific to this scenario will always be lacking.

Why does the base form need to be accessed?

Are the movable statics being spawned in with PlaceAtMe or similar?

Yes, I need it for PlaceAtMe() as well. I can use the suggestions above for that though by naming my Form properties the same as the MovableStatic objects then using Auto-Fill. That's a good tip that didn't occur to me.

 

It's just for a ferry I'm running from one dock to another. I don't know how to do animations yet so I've got different models for sail furled, sail set, and I'm trying to get lanterns lit after dusk to dawn but haven't gotten far on that yet. So I end up with four models of the same boat and I was dropping them into the Render window, putting them under the lake, then using ObjectReference and GetBaseObject() for PlaceAtMe() to place the right model for the location and time of day.

Link to comment
Share on other sites

Arrays are also easy. Make an array in CK, add a bunch of 'None' items to it. Save.

 

YfNHiea.jpg

 

 

Load up xEdit, whatever your script is attached to, the properties will be in the VMAD section, array will be listed out conveniently. Just click the FormID field and start typing in.

You can type in Editor ID or the FormID itself.

 

MadbdqR.jpg

 

Link to comment
Share on other sites

Arrays are also easy. Make an array in CK, add a bunch of 'None' items to it. Save.

Oh wow, that's easy. Creating the empty array members is what I didn't think of. I wondered how xEdit would lay things out, but with some empty members defined, it's simple. That's great. Thanks for taking the time to explain that and with pictures, it's very helpful.

 

Link to comment
Share on other sites

Just remember a couple things about using xEdit:

1. When xEdit is running, all plugin files are considered 'opened' and are therefore locked. Which means you cannot save changes to a plugin in CK when xEdit is up.

2. Even when you click 'Save' in xEdit to apply changes you made, it does not actually write those changes out - they are 'stashed'. The changes are applied to .esp files only when you exit xEdit.

So if you make changes and save, and launch game without closing xEdit, you will find your changes are not there. That is because xEdit did not actually write them yet.

Link to comment
Share on other sites

1) You can make your 'mouvablestatics' into 'activators', and yes the collision will still move as long as the nif is set up correctly.


2) You don't need to use 'PlaceAtMe()' to spawn every time different meshes, simplify your idea's exacution.

a- Create a cell, it doesn't has to have anything in it or to be connected to the world (basically you don't want to connect it to anything), just an empty cell that belongs to your mod.

b- Place in that cell 4 xMarkers, 1 can do the trick, but we will use 4 to keep things in order.

Give the xMarkers unique 'Reference Editor's IDs'

c- Place in that cell all your 4 different boat models, either if they are mouvablestatics or activators, at this point it dosen't really matters.

d- Now use 'MoveTo()' to place the desire boat to position. From the 'ghost cell' to your cavin, and from your cavin to the 'ghost cell'.

Link to comment
Share on other sites

Just remember a couple things about using xEdit:

[...]

Thanks for all the tips. I've accidentally tried to save my plugin in the CK while xEdit was open and have noticed it's not a good idea. :smile:

 

I also didn't know that Alt+S to Save doesn't actually save the changes. I'd read somewhere to use Alt+S after making important changes but now I know to exit all the way if I really want to save. I try not to have plugins open in the CK and xEdit at the same time if I plan to edit and save anything, but sometimes I open xEdit just to look at something and forget it's open or vice versa with the CK.

 

It's good to know the details.

Link to comment
Share on other sites

1) You can make your 'mouvablestatics' into 'activators', and yes the collision will still move as long as the nif is set up correctly.

 

2) You don't need to use 'PlaceAtMe()' to spawn every time different meshes, simplify your idea's exacution.

a- Create a cell, it doesn't has to have anything in it or to be connected to the world (basically you don't want to connect it to anything), just an empty cell that belongs to your mod.

b- Place in that cell 4 xMarkers, 1 can do the trick, but we will use 4 to keep things in order.

Give the xMarkers unique 'Reference Editor's IDs'

c- Place in that cell all your 4 different boat models, either if they are mouvablestatics or activators, at this point it dosen't really matters.

d- Now use 'MoveTo()' to place the desire boat to position. From the 'ghost cell' to your cavin, and from your cavin to the 'ghost cell'.

Yes, that's a good way of doing it that also eliminates the need to Delete() things. Just move them around to make them appear and vanish.

 

Though I should add it's a good idea to use Disable() before MoveTo().

Link to comment
Share on other sites

I never noticed any issues with not disabling the object before moving it (but it doesn't harm to do it).

 

The only issue I remember encountering is that the angle gets messed up when you move an object to an actor, and needs to be adjusted with 'SetAngle()' because adding the flag 'MatchRotation' on 'MoveTo()' some times does not fires.

Link to comment
Share on other sites

I never noticed any issues with not disabling the object before moving it (but it doesn't harm to do it).

 

The only issue I remember encountering is that the angle gets messed up when you move an object to an actor, and needs to be adjusted with 'SetAngle()' because adding the flag 'MatchRotation' on 'MoveTo()' some times does not fires.

 

It seems that MoveTo() just moves the object at whatever angle it's in, while TranslateTo() rotates the object to match the angle of the target reference. I didn't even know MoveTo() had an optional MatchRotation flag. :smile:

 

I don't know if it's always slow if the object is enabled. My boat is in a worldspace cell so it might be different inside, but my boat moved painfully slowly while enabled and if Disable() is called first it moves in a jiffy with MoveTo(). Then I call SetAngle() to set the proper rotation, as you say.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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