Skip to content
This repository has been archived by the owner on Jul 26, 2020. It is now read-only.

REQUEST: Allow inline functions with script injection #19

Open
imlazyeye opened this issue Sep 26, 2018 · 0 comments
Open

REQUEST: Allow inline functions with script injection #19

imlazyeye opened this issue Sep 26, 2018 · 0 comments

Comments

@imlazyeye
Copy link
Member

imlazyeye commented Sep 26, 2018

The following syntax in an object's create event:

#lambda damagePlayer(dmg) {
  hp -= dmg;
}

will instruct gml-tools to create (or update) a "private" script on compile. The scripts would be stored in scripts/lambdas/obj_name_here/function_name_here, or alternatively, could all be stored in a view not connected to the visible resource tree.

Additionally, all generated functions could have:
if (object_index != <lambda object owner here>) return;
at the top of their code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant