Larian Banner
Previous Thread
Next Thread
Print Thread
[WIP Beta] Editor Plugins #533401
31/07/14 01:34 PM
31/07/14 01:34 PM
Joined: Apr 2013
Posts: 466
N
Norbyte Offline OP
addict
Norbyte  Offline OP
addict
N

Joined: Apr 2013
Posts: 466
Well, I've noticed that although the editor does not support adding custom C++/C# modules, interally it *does* use a plugin framework with a hardcoded list of plugins to load.

I've extended this system a bit to allow loading any .NET module.

Steps for setting up the launcher:
  • Download the alternate editor launcher from https://dl.dropboxusercontent.com/u/32263228/dos/GlassesAltEditorRel.zip
  • The "bin" folders the compiled launcher, the "src" folder contains the launcher sources and a minimal sample plugin
  • Copy bin\The Divinity Engine\GlassesAltEditor.exe to the editor root directory (SteamApps\Common\The Divinity Engine\ or something similar)
  • (optional) Copy the sample plugin (bin\EditorPlugins\SamplePlugin.dll) to the My Documents\Larian Studios\Divinity Original Sin\EditorPlugins
  • When you start the editor with GlassesAltEditor.exe a new menu item should appear like so:


The launcher will only load a plugin if the following conditions are met:
  • The plugin .dll is in the My Documents\Larian Studios\Divinity Original Sin\EditorPlugins folder
  • The plugin filename ends with Plugin.dll (eg. MyTestPlugin.dll is fine, but MyTest.dll is not)
  • The plugin module is a managed (.NET) DLL
  • The module contains at least one *public* class that implements the LSToolFramework.IPlugin interface (if the module contains multiple such classes, the editor will instantiate and register each of them)


To see what classes/symbols are available in the editor I'd recommend using a .NET decompiler tool such as dotPeek: http://www.jetbrains.com/decompiler/
(or just add the editor assemblies -- LSToolFramework, LSFrameworkPlugin, etc. -- as a reference to your project and Visual Studio intellisense will see the classes just fine)

Re: [WIP Beta] Editor Plugins [Re: Norbyte] #533437
31/07/14 03:11 PM
31/07/14 03:11 PM
Joined: Dec 2013
Posts: 22
Sunjammer Offline

stranger
Sunjammer  Offline

stranger

Joined: Dec 2013
Posts: 22
Excellent work!


Sunjammer
Code Monkey
Divinity Engine Wiki
Re: [WIP Beta] Editor Plugins [Re: Norbyte] #533605
31/07/14 05:14 PM
31/07/14 05:14 PM
Joined: Jul 2014
Posts: 102
C
Celludriel Offline
member
Celludriel  Offline
member
C

Joined: Jul 2014
Posts: 102
Excellent this is exactly what the editor needed now we can go nuts

- terrain import
- item creation
- creature creation

the possibilities are endless. I just wish Larian would document their file formats publicly cause the guess work going on now is driving me crazy. I still can't find the exact formula to figure out the total amount of big 32*32 tiles in a map frown

I was working with dotpeek as well, to figure out their map creation but the sneaky buggers obscurified that part of their code AAAAAARGH !!!!

To bad you had to copy the entire contents of the GlassesEditor and couldn't extend theirs and just override what was needed frown

Last edited by Celludriel; 31/07/14 05:19 PM.
Re: [WIP Beta] Editor Plugins [Re: Norbyte] #533633
31/07/14 05:48 PM
31/07/14 05:48 PM
Joined: Apr 2013
Posts: 466
N
Norbyte Offline OP
addict
Norbyte  Offline OP
addict
N

Joined: Apr 2013
Posts: 466
The entire editor launcher is like 1 class, so its no big deal.
The code isn't obfuscated anywhere though, all .NET assemblies decompiled just fine for me.
Those that can't be decompiled are only partially managed (ie they contain native C++ code, thats why they look weird)

Re: [WIP Beta] Editor Plugins [Re: Norbyte] #533644
31/07/14 06:12 PM
31/07/14 06:12 PM
Joined: Jul 2014
Posts: 102
C
Celludriel Offline
member
Celludriel  Offline
member
C

Joined: Jul 2014
Posts: 102
aaaaaaah k that explains. Yeah when I decompile java and I see those kind of symbols, it usually means it's obscurified. I just do .NET in my spare time. I used to write ANSI C though, that was hard to decompile, so I guess decompiling the c++ parts is an effort in vain ?

Re: [WIP Beta] Editor Plugins [Re: Norbyte] #533657
31/07/14 06:35 PM
31/07/14 06:35 PM
Joined: Apr 2013
Posts: 466
N
Norbyte Offline OP
addict
Norbyte  Offline OP
addict
N

Joined: Apr 2013
Posts: 466
Yeah, compiled C++ code loses almost all of the semantic information that the original code has (class names, variable names, function signatures, etc.) so all you get is a huge chunk of assembly code.

Decompiling everything is futile, however concentrating on certain parts and decompiling just those small functions can work.

Re: [WIP Beta] Editor Plugins [Re: Norbyte] #533660
31/07/14 06:42 PM
31/07/14 06:42 PM
Joined: Jul 2014
Posts: 102
C
Celludriel Offline
member
Celludriel  Offline
member
C

Joined: Jul 2014
Posts: 102
Thought so, but well not to worry I just had a jolt of lightning in my head, and think I found the calculation for the tiles. I've put it in the heightmap tool thread. So I now should have a lib that can read the .data formats. Now I need to write helpers to manipulate the data within them and people can write their own height editors and importers.

Now I've been thinking what we really need is one lib fe: DosFileManager.dll. This one will be able to read the Dos Xml formats and all binary formats. Thing is I'm ambitious but not enough to do that all by myself. With a lib as this, making plugins would be a breeze for any implementor.

Last edited by Celludriel; 31/07/14 06:43 PM.
Re: [WIP Beta] Editor Plugins [Re: Norbyte] #533677
31/07/14 07:05 PM
31/07/14 07:05 PM
Joined: Apr 2013
Posts: 466
N
Norbyte Offline OP
addict
Norbyte  Offline OP
addict
N

Joined: Apr 2013
Posts: 466
We really should start a repository for a shared D:OS library smile

Re: [WIP Beta] Editor Plugins [Re: Norbyte] #533685
31/07/14 07:12 PM
31/07/14 07:12 PM
Joined: Jul 2014
Posts: 102
C
Celludriel Offline
member
Celludriel  Offline
member
C

Joined: Jul 2014
Posts: 102
Agreed, although I have no idea how many authors are currently working on libs. I know you have some going for a few of the binary files. ChrisKang is working on his own parser and project to generate heightmaps and make them into terrains. So if anyone else is working on something and interested we could get something going. One of the first steps would be to make a todo list. I would go for the bare minimum first.

- Read format file into memory
- Write the memory back to file without breaking it

Next we could create helpers at will without breaking the base file read and write. Ok granted users can still mess up their files with bad data, but when careful helper authors could minmize that risk

Also each file format needs NUnit tests !!!!

Re: [WIP Beta] Editor Plugins [Re: Norbyte] #536240
04/08/14 12:44 AM
04/08/14 12:44 AM
Joined: Jul 2014
Posts: 28
D
docalypse Offline
apprentice
docalypse  Offline
apprentice
D

Joined: Jul 2014
Posts: 28
This is awesome. I hope this takes off. After adding just 1 skill, I really would like an easier way to go about it.

Would it be possible for a plugin that basically streamlines what Rhidian describes here, for adding new spells? (Thanks Rhidian for the awesome pioneering)

Re: [WIP Beta] Editor Plugins [Re: Norbyte] #536264
04/08/14 02:50 AM
04/08/14 02:50 AM
Joined: Apr 2013
Posts: 466
N
Norbyte Offline OP
addict
Norbyte  Offline OP
addict
N

Joined: Apr 2013
Posts: 466
Yeah, a stats/skills editor is the first plugin I was thinking of doing, as that part is seriously lacking in the editor.

Re: [WIP Beta] Editor Plugins [Re: Norbyte] #536535
04/08/14 10:34 AM
04/08/14 10:34 AM
Joined: Jul 2014
Posts: 95
FromHolland Offline
journeyman
FromHolland  Offline
journeyman

Joined: Jul 2014
Posts: 95
great news Norbyte! I'm an avid user of your tools so this will be no different, hats off;)


Powered by UBB.threads™ PHP Forum Software 7.6.2