2020-07-05 21:17:46 +00:00
|
|
|
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
|
|
|
|
|
2011-09-22 12:30:49 +00:00
|
|
|
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!
|
|
|
|
|
2011-09-07 02:14:17 +00:00
|
|
|
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
|
|
|
|
|