Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Using GMLive for make-shift mod support

A topic by Coded Games created Jun 12, 2020 Views: 253 Replies: 1
Viewing posts 1 to 2

Is it possible to bundle your game with a couple .gml script files that will be loaded at initial runtime by GMLive?

For example my game uses scripts to represent each card:


/*  -------------------------------------------------------- */ switch(argument0) { case (cardProcess.info): scr_preload_variables();
//
//                  Card Information
//
/*  -------------------------------------------------------- */

#region Card Information

cardName = "";
cardDescription = "";
cardFusion = ["FILL THIS IN", card_wild_card, legendary_wild_card];

#endregion

/*  -------------------------------------------------------- */ scr_card_end_info(argument2, argument1); break; case (cardProcess.create):
//
//                  Card Create Event
//
/*  -------------------------------------------------------- */

#region Card Create Event


#endregion

/*  -------------------------------------------------------- */ scr_card_end_create(); case (cardProcess.step):
//
//                  Card Step Event
//
/*  -------------------------------------------------------- */

#region Card Step Event


#endregion

/*  -------------------------------------------------------- */
//
//                  Card Hover Details
//
/*  -------------------------------------------------------- */ break; case (cardProcess.hoverDetail):

#region Card Hover Event

auto_tool_tip();

#endregion
break;}


These cards are then called using script_execute. If I bundle a couple of these blank card scripts into the game, and include them as included files would it be possible for GMLive to load them into the game at runtime? Would this have any major limitations?

Developer

You would want to use live_snippet_* functions for that, not adding dummy scripts.

The obvious caveat is that the code ran this way is not "sandboxed" - it can do anything that your game code can.

So, for modding purposes,

  • TXR allows minimalistic scripting with custom syntax/function sets.
    A two-part tutorial is available to explain how everything works and how you can extend it to do what you need it to.
  • Apollo runs Lua code.
    You choose what can be accessed.
  • For larger commercial projects (e.g. Rivals of Aether, Forager, Nuclear Throne) I license and handle integrations of a larger system with a GML-like scripting language (and some syntax extensions - see NT documentation for overview), sandboxing (to the point of picking which variables of which instances can be read/written to), and scoping (each mod can define its own scripts, globals, and so on - without risk of interfering with other mods).