nsensfel / tonkadur

Narrative scripting/programming tool. Write stories in your favorite editor using a feature-rich language, compile them into a very small and simple language to easily integrate them into your game.
https://tonkadur.of.tacticians.online
Apache License 2.0
2 stars 0 forks source link

Tonkadur as a scripting language framework #17

Closed nsensfel closed 3 years ago

nsensfel commented 3 years ago

Scripting languages need the ability to perform application-specific computations and instructions. Currently, Tonkadur provides this for instructions, although the naming ( declare_event_type/event) is not fitting. Extensions can theoretically provide both, but are not actually supported yet (barely defined interface for the extension and no stable/clean interface to Tonkadur as a library). In any case, Tonkadur extensions are meant for more generic computations and instructions that Tonkadur does not provide by default but that could be useful on many application (e.g. string management). Proper support for extensions is meant to be a V2 feature.

However, application-specific computations and instructions should be very easy to add. To allow this, the following modifications should be made:

Write a big warning about computations being something that should not perform any modification to any state. Probably give some warning like:

(+
   1
   (if_else (false)
      ($my_comp 2 1 0)
      ($something_else 2 1 1)
   )
)

Which is allowed to compute both $something_else and $my_comp.

nsensfel commented 3 years ago

Done.