Hi,
I have a 3D scene editor.
I need my scripts to be dynamically loaded in the scene.
In c# or java I can use reflections to do that.
How can I do that with D?
I know that std.traits only works in compile time.
Please, help me
Gabriel

Hi,
I have a 3D scene editor.
I need my scripts to be dynamically loaded in the scene.
In c# or java I can use reflections to do that.
How can I do that with D?
I know that std.traits only works in compile time.
Please, help me
Gabriel

I've used a reflection library called witchcraft which might be
helpful to you.
For script execution, I like LuaD, might be worth checking out
also.
Jordan

Hi,
I have a 3D scene editor.
I need my scripts to be dynamically loaded in the scene.
In c# or java I can use reflections to do that.
How can I do that with D?
I know that std.traits only works in compile time.
Please, help me
Gabriel

Your best bet is to either use a scripting language like Lua
(Unity is written in C++ and uses C#), or compile your scripts to
a dll and load them from there.

Hi,
I have a 3D scene editor.
I need my scripts to be dynamically loaded in the scene.
In c# or java I can use reflections to do that.
How can I do that with D?
I know that std.traits only works in compile time.
Please, help me
Gabriel

Your best bet is to either use a scripting language like Lua
(Unity is written in C++ and uses C#), or compile your scripts
to a dll and load them from there.

Thank you for your answer,
This is a script example:
----------------------------
module game.player;
import engine;
class Player : Actor {
this(string name) {
super(name)
}
~this() {}
void jump() { ... }
Editable("Slider")("min = 0; max = 5;")
ubyte lives = 5;
}
----------------------------
If i compile this script to a .dll then pleyer object can be
dragged and dropped into the scene?
Do yout think that after the final LDC Android build, the game
will work properly on Android? (because of .dll scripts)
Gabriel

I understand, thank you! :)
I have created another scripting model (compiled, not
interpreted) for the graphics engine, which is better than the
runtime reflection (it has only one disadvantage and more
advantages over it). I cannot wait until the engine is finished,
so that I will be able to show it to the public.
Gabriel

I understand, thank you! :)
I have created another scripting model (compiled, not
interpreted) for the graphics engine, which is better than the
runtime reflection (it has only one disadvantage and more
advantages over it). I cannot wait until the engine is
finished, so that I will be able to show it to the public.
Gabriel

I'm curious to see what you've come up with.
There are certain problems that can't really be overcome with a
compile time approach, like generically passing things across DLL
boundaries, or modifying/referencing things at design-time in an
editor. You could generate some generic wrapper/interface at
compile time, but that would basically be the same as run-time
reflection at that point.