Jump to content

Placing objects in worldspace automatically with xEdit?


Recommended Posts

Good morning everybody,

 

is there a way to automate the placement of static objects, trees, ... in a worldspace with xEdit?

 

I know you can do some scripting inside of xEdit, so could this be possible?

 

So the xEdit script would read in a text file that looks something like this:

Cell [-63,-63] (or the cell ID if that is easier to handle by xEdit)

BaseIdOfObjectToPlace PosX PosY PosZ RotX RotY RotZ Scale
.... for all objects to be placed in this cell, one object per line

Cell[-62,-63]
... and so on for all the cells in the worldspace

Is something like this even possible or do I have to place all the objects by hand in the CK and then copy&paste in the values for position and rotation?

Because that would take a very long time and I would like to avoid it if possible.

 

I know this is not the typical way of placing objects in a worldspace.

But I want to recreate something in Fallout 4 and I have the exact positions and rotations of all the objects I need to place in the worldspace.

 

Link to comment
Share on other sites

YouDoNotKnowMyName, long time no see. Sounds like you continue to press forward with your concept of re-creating aspects of Skyrim workspace in FO4. Best guess, I’d say what you are asking is technically possibly. In many ways it seems akin to how Transfer Settlements - Shareable Settlement Blueprints by CDante works. Transfer Settlements reads a .json file which contains all the relevant information for placement. Manual data cleaning would likely be need upfront. For example, you’d likely need to correlate the Skryim based object to an equivalent FO4 base object.


Not positive but I believe xEdit scripts are written in Pascal. If I recall Transfer Settlements is a F4SE plug and likely written in C++. So my guess is that either is doable, providing you have the requisite computer programming knowledge. I am sure some of our comp sci experts can weigh in with more expert information.
Edited by pepperman35
Link to comment
Share on other sites

Yes, I have been away for a little while, working on other stuff besides FO4.

And you guessed right, I am working on my favourite little project again.

 

 

 

The Transfer Settlement blueprints do stuff dynamically in the game at runtime, I am just trying to automate writing stuff into an ESP file.

So as far as I can tell the blueprint stuff is WAAAAAY more advanced and complicated then what I am trying to do ...

Edited by YouDoNotKnowMyName
Link to comment
Share on other sites

I just checked the documentation of all the xEdit scripting functions (https://tes5edit.github.io/docs/13-Scripting-Functions.html)

And there doesn't seem to be a function to "add records" or do something like that.

 

So I guess I need to manually add half a million objects in the CK, copy in their exact position, rotation and scale values.

 

Let's assume I am quick and can do 1 object in 30 seconds, that would take me 4166,6666 hours, so more then 173 days if I could work 24 hours a day on this (I sadly can't) and if the CK could run more then a few hours without crashing.

Well s#*! ...

Link to comment
Share on other sites

Oooooohhh, so maybe "container" refers to a data structure that contains other data structures (like an array, a vector, ....)?

 

I just quickly read over that because my brain is wired to think of actual containers (chests and things like that) when I hear "container".

 

 

That might be what I am looking for, I will read into this scripting stuff, thanks!

 

 

About the "reading in from a text file" thing:

That might not be needed, I can just copy&paste the list of objects to be placed into the code of the script, as an array or something like that.

I have some experience with C and C++, so this shouldn't be that hard to figure out ...

Definitly quicker to figure out then adding everything by hand :laugh:

Link to comment
Share on other sites

The Transfer Settlement blueprints do stuff dynamically in the game at runtime, I am just trying to automate writing stuff into an ESP file.

So as far as I can tell the blueprint stuff is WAAAAAY more advanced and complicated then what I am trying to do ...

 

Both Transfer Settlements and xEdit scripts can read .json files. Transfer Settlements utilizes F4SE plugins for reading .json files, to add "text replacements" to the Pip-Boy menu, to overcome the scrap crash, check the power grid, etc. Fortunately, there's no need for such complicated code.

 

I just checked the documentation of all the xEdit scripting functions (https://tes5edit.github.io/docs/13-Scripting-Functions.html)

And there doesn't seem to be a function to "add records" or do something like that.

 

Use wbCopyElementToFile (with abAsNew=True) in a loop. That should make a lot of copies (new records) of a record. Then SetElementEditValues() for positioning. The worst part is that you would need to have the exact position of every reference.

Link to comment
Share on other sites

Thanks, I will look into that.

 

I do have exact position, rotation and scale for every object I want to place.

 

 

Can I use these scripting function right in xEdit (right click, apply script, new script) or do I need to go through the whole "setting up an IDE" crap?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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