Page 1 of 4

Location Editor (WIP)

Posted: Thu Dec 19, 2019 10:48 pm
by Uncanny_Valley
I'm releasing my Location Editor here as is. It's far from finished, but works very well at editing existing interior locations. Taverns, shops, homes, temples and guilds (blockName.RMB-nn-buildingX.json files).

REQUIRES: Daggerfall unity source (minimum 0.10.20)


Basic Instructions
  • Download the unity package and import it into the Daggerfall Unity project
  • Once installed, you will find a new tool under Daggerfall Tools called "Location Editor - Interior"
  • I highly recommend dragging the opened Location editor window to the inspector view, so it creates an extra tab for you to view it instead of the inspector. The editor was designed to be used in this way
  • Place your edited location file(s) (.json) in the WorldData folder in streamingAssets to see your changes in the game. (NOTE: the file name must remain the same as the original)
  • If you later wish to distribute your edited interior(s), you can package the files into a mod
Editor Window.png
Editor Window.png (397.67 KiB) Viewed 1015 times
Notes:
  • When you open a location it will load all the objects into your currently opened scene in Unity. 3D objects can be moved, rotated and scaled. Billboards (flats) can only be moved.
  • When selecting an object in the scene, the editor will show the available "options" for that objects. Selecting a wooden box for example gives you the option to enable/disable it as a container
  • Select the parent object called (Location : "File Name" ) in the Hierarchy to edit special option for the location such as Building Type
  • If you wish to add new objects to the location, click the "Add object" button. You can add objects from pre-made lists or add them "manually" by typing in their ID number
  • Some objects, such as painting, are grouped together. When selecting these objects in the scene view, the editor will give you the option to quickly cycle through the different variances of that objects. You will also notice that when adding new objects from a list, some of them are displayed as "ObjectName"[Number], to indicate that they are grouped together
  • When moving and rotating objects, you will probably notice that objects will slightly "snap" into place. This is because Daggerfall objects location and rotation is stored with less precision then Unity, so this "snapping" will make sure that any object you move or rotate in the editor will have the exact same position/rotation in the game
  • To close down a current open location you can either delete the parent object or close down the editor window (as in right click and choose "Close Tab"). NOTE: Do not forget to save before you do this or your changes will be lost!

    I will update the editor here when new features are added or sever bugs are fixed.
    My hope is that sharing this editor now might encourage someone to start a shop or temple re-design project. ;)

Re: Location Editor (WIP)

Posted: Thu Dec 19, 2019 10:51 pm
by Uncanny_Valley
[Reserved]

Re: Location Editor (WIP)

Posted: Thu Dec 19, 2019 11:06 pm
by Hazelnut
Cool, nice to see progress on this. :)

I think you should make it clear that it can only edit building world data files (blockName.RMB-nn-buildingX.json) and not locations or RMB / RDB blocks. Or am I doing something wrong - I got exceptions for anything that wasn't a building.

Also loading buildings which use new models causes an exception because the model is not part of the DF data. No idea how this could be solved. Personally I do the editing first and then switched the model later, but that's cos I only have 1.

Could we get a ground plane for the building exteriors? It's really hard to place objects without being able to see where the ground is.

Lastly, how can I switch it off when i want to just run DFU? Just discard changes for the DF startup scene?

Re: Location Editor (WIP)

Posted: Fri Dec 20, 2019 12:10 am
by Uncanny_Valley
Hazelnut wrote:
Thu Dec 19, 2019 11:06 pm
I think you should make it clear that it can only edit building world data files (blockName.RMB-nn-buildingX.json) and not locations or RMB / RDB blocks. Or am I doing something wrong - I got exceptions for anything that wasn't a building.
It only supports editing buildings (or interiors as I refer to them), I tried to make it clear in the first line of the post, but I can see if I can make it clearer.
Hazelnut wrote:
Thu Dec 19, 2019 11:06 pm
Also loading buildings which use new models causes an exception because the model is not part of the DF data. No idea how this could be solved. Personally I do the editing first and then switched the model later, but that's cos I only have 1.
The editor has been a work in progress during my work with the taverns, so adding support for custom new models hasn't been relevant thus far for me. One solution could be that if the editor finds and object that isn't part of the orginal DF data, it still loads the objects but uses some "unknown object" token as its visual representation in the editor. So you can still edit and work with it, even if you don't get a full visual representation. I would like to be able to load up the editor with mods, to be able to preview the location with texture and model replacements, but haven't gotten that far it. As mentioned, its far from finished.
Hazelnut wrote:
Thu Dec 19, 2019 11:06 pm
Could we get a ground plane for the building exteriors? It's really hard to place objects without being able to see where the ground is.
That's a really good idea, and should be easily fixed. I just wonder how big it should be? Do building have a fixed size or does it vary?
Hazelnut wrote:
Thu Dec 19, 2019 11:06 pm
Lastly, how can I switch it off when i want to just run DFU? Just discard changes for the DF startup scene?
You can either select the parent object in the Hierarchy and just delete it, or closing down the editor (as in right click and "close tab" on the editor window).

Re: Location Editor (WIP)

Posted: Sat Feb 08, 2020 1:44 pm
by Uncanny_Valley
Small update to the editor. The editor will now automatically assign NPC:s unique "positions" so they don't receive the same name in game

Re: Location Editor (WIP)

Posted: Mon Feb 10, 2020 3:11 pm
by King of Worms
Completely missed the release :lol:
Or have I forgotten?

Anyway, I will download and try :)

Thanks a lot!

Re: Location Editor (WIP)

Posted: Tue Feb 11, 2020 8:21 pm
by Baler
This is awesome! Was fooling around with it all last night

Re: Location Editor (WIP)

Posted: Wed Feb 12, 2020 11:50 am
by King of Worms
Hi, uhm.. after importing the Unity package and restarting unity the Daggerfall Tools folder completely disappeared.

Any idea what went wrong? Does this have some requirements on Daggerfall Unity master version?

Thank you :)

PS: Found these 4 errors in Unity

Assets/Game/Addons/LocationEditor/Editor/LocationEditorHelper.cs(1191,59): error CS1061: Type `DaggerfallConnect.DFBlock.RmbBlock3dObjectRecord' does not contain a definition for `XRotation' and no extension method `XRotation' of type `DaggerfallConnect.DFBlock.RmbBlock3dObjectRecord' could be found. Are you missing an assembly reference?


Assets/Game/Addons/LocationEditor/Editor/LocationEditorHelper.cs(1191,209): error CS1061: Type `DaggerfallConnect.DFBlock.RmbBlock3dObjectRecord' does not contain a definition for `ZRotation' and no extension method `ZRotation' of type `DaggerfallConnect.DFBlock.RmbBlock3dObjectRecord' could be found. Are you missing an assembly reference?


Assets/Game/Addons/LocationEditor/Editor/LocationEditorInterior.cs(860,28): error CS1061: Type `DaggerfallConnect.DFBlock.RmbBlock3dObjectRecord' does not contain a definition for `XRotation' and no extension method `XRotation' of type `DaggerfallConnect.DFBlock.RmbBlock3dObjectRecord' could be found. Are you missing an assembly reference?


Assets/Game/Addons/LocationEditor/Editor/LocationEditorInterior.cs(862,28): error CS1061: Type `DaggerfallConnect.DFBlock.RmbBlock3dObjectRecord' does not contain a definition for `ZRotation' and no extension method `ZRotation' of type `DaggerfallConnect.DFBlock.RmbBlock3dObjectRecord' could be found. Are you missing an assembly reference?
Spoiler!
Untitled.jpg
Untitled.jpg (329 KiB) Viewed 602 times

Re: Location Editor (WIP)

Posted: Wed Feb 12, 2020 12:52 pm
by Hazelnut
How old is your DFU source code? Seems like its missing something added months back.

Re: Location Editor (WIP)

Posted: Wed Feb 12, 2020 8:25 pm
by King of Worms
Hazelnut wrote:
Wed Feb 12, 2020 12:52 pm
How old is your DFU source code? Seems like its missing something added months back.
Few months old Id say :) I will update and see what happens, thank you

I try to update as little as possible, because if I just overwrite the old files, it may corrupt my whole mod as it happened to me some year back and it was major PITA to set it all back to normal.

So to do it properly, I need to create a new folder with new master, copy everything from my mod there, and than let Unity sort it out, which takes many hours... so thats why.