coreLoader (GP Mod community edition branch)

Tell us about your GP mod (be sure to include a link!)

Moderator: MSandro

Post Reply
Spiralo-Idioïde
Posts: 11
Joined: Jun 16th, '19, 23:53

coreLoader (GP Mod community edition branch)

Post by Spiralo-Idioïde » Mar 25th, '20, 15:45

For the last week I have been working on a branch of the GP community edition. The objective of this branch is to ease switching between different mods or custom applications.

How it works

When you launch GP the VM (virtual machine) loads all the libraries (*.gp) inside the 'runtime/lib' folder. But this is not the only way of loading those libraries, we can also use modules. Modules are objects that contains functions and classes.
The libraries loaded by the VM are loaded in the (topLevelModule) wich is the highest module in GP. We can add classes and functions to this module with the loadModuleFromString method.
To do that we need to keep some libraries in the main library folder and create some functions. The cores files are in the 'runtime/core/[core Name]/

Here is the code that loads a core (with explanations):
loadCore.png

Current functionalities
To ease the work of modders some functions have been added. For example because the core folder is not the same as the usual folder, trying to read a file using a relative path won't give you anything since it is not where you would except it to be. To avoid those problems I created different functions.
core functions.png
core functions.png (2.47 KiB) Viewed 122533 times

What might not work
  • Some parts of the AppMAker may not, I need to test things.

Future functionalities
  • GUI
  • Packaged core as zip Files
  • Config file

Help !
You can test, ask questions, improve the code, make suggestions. You can find the source code in the GP mod community Edition here https://github.com/0gp/GP-CommunityEdit ... coreLoader

Also if you have any question on how to make your custom core works.

Post Reply