Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Scripting Language* #45

Open
jbheard opened this issue Oct 22, 2020 · 1 comment
Open

Scripting Language* #45

jbheard opened this issue Oct 22, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed long term Something to implement later, or over a period of time

Comments

@jbheard
Copy link
Contributor

jbheard commented Oct 22, 2020

* Or at least something like a scripting language

I doubt this project will ever grow large enough to warrant using an entire language for it (I hope I'm wrong), so we likely don't need anything like Lua, or letting game devs write their own python. But I think it is necessary to have some kind of customizable behavior to make the engine effective.

Some of this is already in the docs for items, but this will also be a necessity for Room objects since something happens when a player makes a choice.

For example, suppose your room has the option Pick up potion. The game dev needs some way to add a potion to the user's inventory, and then remove that option from the room.

Something a bit more complex is using variables. For example, the user wants to keep track of how many times a player has visited a specific room. Variables could be represented as GameObjects, but we need some kind of typing system (unless all variables are integers? strings would get messy, and floats can probably be avoided).

@jbheard jbheard added enhancement New feature or request help wanted Extra attention is needed long term Something to implement later, or over a period of time labels Oct 22, 2020
@jbheard
Copy link
Contributor Author

jbheard commented Oct 23, 2020

Some more thoughts on this; the parsing language could have simple rules:

  1. One command per line. Define a variable, instantiate an item/enemy/something, etc.
  2. Commands must map 1-to-1 with existing functions. e.g. GameContext.destroy(obj) is called as destroy obj

With these 2 rules in place the language becomes similar to assembly, and is exceedingly simple to write an interpreter for.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed long term Something to implement later, or over a period of time
Projects
None yet
Development

No branches or pull requests

1 participant