Jump to content

Moving objects via script (TranslateTo)


FuryoftheStars

Recommended Posts

Woohoo, everything most things seem to be working so far. :) Course, I forgot to put in a "i += 1" into my while loops, so it was kind of funny seeing the first chandelier just flickering in and out of existence. :P (Annnnd there seems to be a bug with the compiler software I'm using. Won't compile "i += 1", though it will compile "i =+ 1", even though that syntax doesn't actually work. Oh well. Writing out the full thing of "i = i + 1" for now.)

 

And this...

If False && NeedsUpdating && ConfirmationMessage.Show() == 1
...still resulted in the message box showing, so I guess that answers that question. :) Oh well, multi-line it is!

 

 

Ok, another hurdle! (In case you can't tell, I'm writing this post as I go and try things and encounter new issues, then fix them....). The end table and book under the wall mounted horker head on the 2nd floor of the main hall... they're enabled via the mannequin next to them rather than directly like the chandeliers and horker head. In the CK, I can add them as objects to the script and everything looks fine there, but when the script actually runs, it's saying the object is "None" and (expectedly given no object) throws errors when attempting to do anything with them. What gives?

Edited by FuryoftheStars
Link to comment
Share on other sites

I

 

  On 2/8/2021 at 5:08 AM, FuryoftheStars said:

 


Ok, another hurdle! (In case you can't tell, I'm writing this post as I go and try things and encounter new issues, then fix them....). The end table and book under the wall mounted horker head on the 2nd floor of the main hall... they're enabled via the mannequin next to them rather than directly like the chandeliers and horker head. In the CK, I can add them as objects to the script and everything looks fine there, but when the script actually runs, it's saying the object is "None" and (expectedly given no object) throws errors when attempting to do anything with them. What gives?

 

 

I'm not sure why that would be. If the property is filled it should be working. Maybe it has something to do with the HF scripts. I'd look at the mannequin's attached scripts to see. Also, that's weird that i += 1 doesn't work, I've never had problems with that.

Link to comment
Share on other sites

Ok, I'll try some testing at some point to see if I can figure that out. I'm pretty sure it's not the HF script that's causing issues as it's the same script as used by the chandeliers and horker head. Only thing that's really different is that the book and end table are enabled via a set Enable Parent (pointing to the mannequin), and that there is no Reference Editor ID name filled in (it has a hex ref id, just not a plain text one). Filling something into this does not solve it on an already existing save, though. I'll try a couple bouts with it on new play throughs and see what I get.

 

And the i+=1 thing, yeah, I dunno. It seems to work today for some reason. May have been some kind of weird bug in the CK/compiler? Maybe if I'd shut the CK down and retried it would've worked? *shrug*

Edited by FuryoftheStars
Link to comment
Share on other sites

Yeah, that was what I was using, but I had the CK open in the background for most of the day, closing and reopening seldomly, so I don't know if that could have interfered somehow (I reported the issue to the SSEScript mod page and the author responded saying his software still uses the game's compiler for actually compiling).

 

 

 

Ok, so I did some testing on these objects that are coming back None. If I start a new game, they don't do this. I'm wondering if this is related to these objects not being persistent previously and thus, if you haven't built the mannequin yet, don't actually exist yet? Even though they get flagged persistent by this mod now, I don't think it takes effect until they're enabled (or a new game is started).

 

Additionally, I can't actually enable/disable these objects directly even when they do exist. The Enable Parent setting seems to override this, so I have to enable/disable the mannequin instead. Not a huge deal, I was able to work through that by adding another array (that I populate in the CK with the object's Enable Parent, if there is one) and duplicating the main working part of the code with the minor changes of enabling/disabling the object specified by the new array, while performing the TranslateTo on the object in the original array.

 

Are there search tools/features I can make use of in the script? Maybe once I enable the mannequin and the table and book are created, I can search the cell for them and then do the needed work? Or, assuming that once created the table and book keep the same ref id # as visible in the CK, I can pass their id #s themselves to the script (rather than the object reference) and somehow pull their object reference with that? I don't know what's available to me at this point, but I feel like there's gotta be something (the HF script is somehow able to enable its objects with just a part id # being passed to it rather than an object reference).

Link to comment
Share on other sites

Took a bit of a hiatus. :tongue:

 

Here's my (current) final version of the script that seems to be working. If interested, let me know if you see anything in there that sticks out as maybe needing to be changed.

 

 

  Reveal hidden contents

 

 

 

Thanks for all your help on this!!

 

Edit: Aaaand I should probably make sure to take out all the Debug.Trace lines (delete or comment out) for the actual packaged mod. :P

Edited by FuryoftheStars
Link to comment
Share on other sites

  • Recently Browsing   0 members

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