Re: Some Plugins
Ok, I'll look into making MExtensions later. Shouldn't be a problem at all.
Right, I've tried to make things simple for this, but it's ended up being a bit weird. My build scripts all expect a folder layout similar to the binary distribution, which unfortunately isn't how scons builds maratis. My setup is as follows (on OSX right now, but the principle's the same)
Harpy:dev pgeyer$ cat ~/.profile
# other stuff...
#set up Maratis
export MSDKDIR=${HOME}/dev/Maratis-dev/
Harpy:dev pgeyer$ ll ~/dev/Maratis-dev/
total 8
lrwxr-xr-x 1 pgeyer staff 68 6 Jun 08:14 Bin -> /Users/pgeyer/dev/maratis/trunk/dev/prod/darwin/release/Maratis/Bin/
drwxr-xr-x 4 pgeyer staff 136 7 Jul 17:27 Plugins
drwxr-xr-x 4 pgeyer staff 136 6 Jun 08:16 SDK
Harpy:dev pgeyer$ ll ~/dev/Maratis-dev/SDK/*
/Users/pgeyer/dev/Maratis-dev/SDK/MCore:
total 16
lrwxr-xr-x 1 pgeyer staff 56 6 Jun 08:16 Includes -> /Users/pgeyer/dev/maratis/trunk/dev/MSDK/MCore/Includes/
lrwxr-xr-x 1 pgeyer staff 61 6 Jun 08:17 Libs -> /Users/pgeyer/dev/maratis/trunk/dev/prod/darwin/release/MSDK/
/Users/pgeyer/dev/Maratis-dev/SDK/MEngine:
total 16
lrwxr-xr-x 1 pgeyer staff 58 6 Jun 08:15 Includes -> /Users/pgeyer/dev/maratis/trunk/dev/MSDK/MEngine/Includes/
lrwxr-xr-x 1 pgeyer staff 61 6 Jun 08:17 Libs -> /Users/pgeyer/dev/maratis/trunk/dev/prod/darwin/release/MSDK/
Harpy:dev pgeyer$ ll ~/dev/Maratis-dev/Plugins/*
/Users/pgeyer/dev/Maratis-dev/Plugins/Includes:
total 40
lrwxr-xr-x 1 pgeyer staff 49 23 Jul 11:09 MEmbedFile.h -> /Users/pgeyer/dev/MEmbedFile/include/MEmbedFile.h
lrwxr-xr-x 1 pgeyer staff 49 7 Jul 17:26 MEventListener.h -> /Users/pgeyer/dev/MEvent/include/MEventListener.h
lrwxr-xr-x 1 pgeyer staff 45 7 Jul 17:26 MGameEvent.h -> /Users/pgeyer/dev/MEvent/include/MGameEvent.h
lrwxr-xr-x 1 pgeyer staff 47 7 Jul 17:26 MSaveFile.h -> /Users/pgeyer/dev/MSaveFile/include/MSaveFile.h
lrwxr-xr-x 1 pgeyer staff 49 7 Jul 17:27 MScriptExt.h -> /Users/pgeyer/dev/MScriptExt/include/MScriptExt.h
/Users/pgeyer/dev/Maratis-dev/Plugins/Libs:
total 80
lrwxr-xr-x 1 pgeyer staff 49 23 Jul 11:10 MEmbedFile.dylib -> /Users/pgeyer/dev/MEmbedFile/bin/MEmbedFile.dylib
lrwxr-xr-x 1 pgeyer staff 41 7 Jul 17:27 MEvent.dylib -> /Users/pgeyer/dev/MEvent/bin/MEvent.dylib
lrwxr-xr-x 1 pgeyer staff 47 7 Jul 17:28 MSaveFile.dylib -> /Users/pgeyer/dev/MSaveFile/bin/MSaveFile.dylib
lrwxr-xr-x 1 pgeyer staff 49 7 Jul 17:29 MScriptExt.dylib -> /Users/pgeyer/dev/MScriptExt/bin/MScriptExt.dylib
lrwxr-xr-x 1 pgeyer staff 69 8 Jul 19:19 MScriptableBehaviour.dylib -> /Users/pgeyer/dev/MScriptableBehaviour/bin/MScriptableBehaviour.dylib
lrwxr-xr-x 1 pgeyer staff 48 23 Jul 11:10 libMEmbedFile.a -> /Users/pgeyer/dev/MEmbedFile/bin/libMEmbedFile.a
lrwxr-xr-x 1 pgeyer staff 40 7 Jul 17:27 libMEvent.a -> /Users/pgeyer/dev/MEvent/bin/libMEvent.a
lrwxr-xr-x 1 pgeyer staff 46 7 Jul 17:28 libMSaveFile.a -> /Users/pgeyer/dev/MSaveFile/bin/libMSaveFile.a
lrwxr-xr-x 1 pgeyer staff 48 7 Jul 17:28 libMScriptExt.a -> /Users/pgeyer/dev/MScriptExt/bin/libMScriptExt.a
lrwxr-xr-x 1 pgeyer staff 68 8 Jul 19:19 libMScriptableBehaviour.a -> /Users/pgeyer/dev/MScriptableBehaviour/bin/libMScriptableBehaviour.a
Basically I have my maratis root directory outputting to ~/dev/maratis/trunk/dev/prod/... and then ~/dev/Maratis-dev symlinking to the relevant parts of that. And to allow plugins to use plugins, they're all present within ~/dev/Maratis-dev/Plugins. The only environment variable needed is $MSDKDIR which then points to the current binary distribution root.
Hope that helps.
In other news, I've made a couple of additions to MScriptExt and MScriptableBehaviour.
- MScriptExt - Changed dofile to check a relative path first against the current directory the script is being run in, then against the project root.
- MScriptExt - moved editor script loading into the script rather than being done in C++, which makes it cleaner and less error prone
- MScriptExt - added the following table extensions: table.copy table.compare table.compare_deep table.concat table.contains
- MScriptableBehaviour - fixed getClone bug (wasn't copying the behaviour name across properly)
- MScriptableBehaviour - load behaviour scripts once, and from the plugin script, similar to how the editor scripts are loaded
- MScriptableBehaviour - Used table.copy to copy variables when initialising new behaviours, before if you set a table as a behaviour variable, it was shared between all instances of the behaviour.
- MScriptableBehaviour - added a helper function to get a behaviour assigned to an object ID (ie for a player: local player_bh = player.get(getObject("player")))