Sirgallyhave Posted July 16, 2023 Share Posted July 16, 2023 Just a little thing, is there a way to get MovableStatic objects into script properties? The wiki says to use Form to refer to MovableStatics in scripts but if I do this: Form property animated_object auto I can't select a MovableStatic to fill the property. Is there a way to do it? I'm currently dropping them into the Render window in the void then using GetBaseObject() but it's klunky and I hope there's a better way. Link to comment Share on other sites More sharing options...
scorrp10 Posted July 16, 2023 Share Posted July 16, 2023 I dunno, I just started CK, randomly selected a MovableStatic: BFXFireVol01 (000D61B6) . I went into one of my existing mod scripts, and added a Property type Form, named 'BFXFireVol01''Edit Value' button did not offer anything valid. But when I clicked 'Auto-Fill', it populated the property with FormID 000D61B6. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 16, 2023 Share Posted July 16, 2023 One work around solution: Declare your form variables ;local variables - only the local script can use them Form myMovableStatic001 Form myMovableStatic002 ;property variables - any script with a proper call to this script can use them Form Property myMovableStatic001 Auto Form Property myMovableStatic002 Auto Within an event or function define them with GetFormFromFile myMovableStatic001 = Game.GetFormFromFile(0x00123456,"myMod.esp") myMovableStatic002 = Game.GetFormFromFile(0x00123abc,"myMod.esp") Then use your defined movable static variables as needed throughout the script. Just make sure that the variables get defined before being used otherwise the script will not do what you want. *************************************You could also try what scorrp10 mentioned. It may or may not work. Link to comment Share on other sites More sharing options...
Sirgallyhave Posted July 17, 2023 Author Share Posted July 17, 2023 [...]But when I clicked 'Auto-Fill', it populated the property with FormID 000D61B6.One work around solution:[...]Both good suggestions that are much better than what I was doing. Thanks very much, I'll try them both. Link to comment Share on other sites More sharing options...
scorrp10 Posted July 17, 2023 Share Posted July 17, 2023 As long as property name EXACTLY matches the EditorID of the form, Auto-Fill should work. But what If you want to use same script on a number of objects, loading same property with different form each time? Go into that script properties page, add whatever Form properties you need, named however you want, leave them unfilled. If you attach same script to any other object, you at least need to go onto their properties. and click OK. Then go into xEdit, locate whatever the script is attached to, (in my case, it is attached to a quest alias). Find the property, and under Value, just type in the FormID of whatever you want to fill it with. (You can also start typing the editorID, it will find it) Once you put values into all the properties as needed, save and exit. You got your properties loaded, Can verify it in CK It might sound a bit cumbersome, but once you are in xEdit, it should be pretty quick to click through objects and get them filled. Especially if they are different properties on the same script. Link to comment Share on other sites More sharing options...
maxarturo Posted July 17, 2023 Share Posted July 17, 2023 Just use 'ObjectReference', I use objectreference for all mouvablestatics. A MouvableStatis is an ObjectReference. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 17, 2023 Share Posted July 17, 2023 A MovableStatic is an ObjectReference, as maxarturo states, provided it has been pre-placed. This is what is presumably already being done. Quote from the original post. I'm currently dropping them into the Render window in the void then using GetBaseObject() 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? In any event, it is still good to know the various methods offered in response to the question, "How does one fill a form property?". Link to comment Share on other sites More sharing options...
scorrp10 Posted July 17, 2023 Share Posted July 17, 2023 Problem is, if you declare your property as ObjectReference, to fill it you need to specify an actual reference in some cell. Which frankly sounds like what OP is already doing. Which is fine if you want to use a script to say, enable/disable something in a particular dungeon. But if you need the base object, not the best solution. Link to comment Share on other sites More sharing options...
Sirgallyhave Posted July 17, 2023 Author Share Posted July 17, 2023 Just use 'ObjectReference', I use objectreference for all mouvablestatics.A MouvableStatis is an ObjectReference. I think everything is an ObjectReference once dropped into the Render window. I'm trying to get base objects into scripts without using lists and without dropping them into the Render window then calling GetBaseObject(). The main reason is arrays. I often end up with lots of objects I want to reference in script arrays (in properties) without having to drop them all into the Render window and using ObjectReference[] properties. We can use FormList objects then drag and drop whatever objects into lists, then put the list in a script property but they're slow compared to arrays. I didn't think to use GetFormFromFile(), which could be done if the form IDs are contiguous, so they could be read into an array from a loop. It just seems weird that there's no MovableStatic type when we have pretty much everything else. I'd like to be able to define MoveableStatic[] in a property and then fill the array from a list as can be done with Activator[], Armor[], GlobalVariable[] and other types. Link to comment Share on other sites More sharing options...
Sirgallyhave Posted July 17, 2023 Author Share Posted July 17, 2023 As long as property name EXACTLY matches the EditorID of the form, Auto-Fill should work. [...]Thanks, that's a good tip. I didn't think to use xEdit, but I'm not that familiar with it. I'm not sure how it handles arrays. It's worth looking into, I might be able to get it to work with a Form[]. Link to comment Share on other sites More sharing options...
Recommended Posts