marmots/script-thoughts.txt
Jeremy Penner 4e720f0d67 Refactor / simplify scripting syntax classes
* Introduce Stype, a generalized object for producing synts by text matching
* consistently use stype to determine what can be inserted in a given place
* rewrite SyntDesc to more extensively use Stypes
* Introduce SyntHole, a generalized anyblob that can be put anywhere and evals
  to failure
* Remove all data types but flags, introduce bots
* Remove math
* Remove compiler / VM
* Remove unused methods
2020-07-05 17:17:46 -04:00

78 lines
2.4 KiB
Plaintext

My old scripting system is an overcomplicated unusable disaster zone!!
Let's start very simply with something like Bitsy.
* one layer on a board is the Object Layer; it is where the player lives
* there is a static finite set of named objects, no dynamic creation, no querying
* nothing happens without the player bumping into it
VERBS
* Show Message <string>
* Show Long Message (pop-up) <textarea?>
* If <flag> Then / Else
* Set Flag <true/false/flag>
* Set Visibility of <object | layer> to <true/false/flag>
* Move <object> <N/E/W/S>...
EVENTS
* player touches object
Once this exists we can expand if we want, but in the meantime this would be *awesome*.
======
OLD THOUGHTS
script quotas:
- infinite loops are bad.
- we do not want "new frames" to happen constantly, so a "when this {expr} happens" event will be triggered
when the values are dirty. "when x > 0: x ++" is an infinite loop!
How to refer to things
====
MarMOTS: set model?
when sending a message: send to all in set (useful? or explicit foreach better?)
when asking a question: ask a random member? if != 1 I think this is almost never what you really want.
====
1) construct model:
all values (except for constants) come from some class of object, of which there are always only small number available to you
the instance of the class that you query is chosen by narrowing the set by "picking" in the event conditions
pros of picking:
= lets you say when(anything) and have it make sense
= if there is only one of something you always get it right
cons:
= not always an easy way to express what you want
2) game maker:
self, other, pick
-- gml has the set model!
other == other involved in collision
=============
namespaces:
---------------------------------------------|--------------
| * System *
| Thing
| Whatsit
| Enemy
| ...
| variable?
some core stuff should be global (if, expr, true, false)
I keep forgetting that this kind of interface suggests type inference
what is a type? it's
- number
- string (ansi)
- boolean (yes/no)
- object<|x,y,z|>
- with mixins x, y, z
object<|x|> is a subtype of object<|x,y|>
- list<t>
- void
- t