Anyone know how to make a scripting language in MMF2? I'm trying to get something where I could code events out of MMF.. it works fine for most of the things I need, like displaying text, loading files, anything that doesn't have a timespan. But when I try to put a simple 'active object clicked', it screws up completely.
Seems like the main problem is that when the tokens object reads a combo box line-by-line too fast (like every 0.03 secs), it sometimes doesn't have time to read some of the lines.
And another thing... is there a way to read a file by line number without using the combo box?
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
9th February, 2007 at 03:32:22 -
One method I found good was to use Lua, but modify it so that it represents your language instead of lua. Infact you could just use Lua? But if you don't want it to look like lua, then you can just replace certain strings with your one before you execute it. For example if the script is:
Exit;
In Lua,
you can just change it so whenever it says exit it replaces it (with the use of a string manipulating extension) with DoCall("exit");, a command that lua will understand.
I thought of doing a scripting language in MMF1.5 long ago but then I relized how much effort that would take. effort I didn't have because I was sick at the time.
Sorry, I haven't really commented it much, just a bit where I thought to save time by the tutorials. Tried to do it just now, but only have MMF2 demo, no bonus packs on this comp.
The first part works well enough.. it's the 2nd frame that's the problem, all when you try to click. It's a simple enough action... When clicked, flag turns on. When flag is on and the comp reads the line, the thing works. That's all.
And yet that 2nd frame has been butchered by my debugging attempts. There's a bunch of useless code in there just for me to check whether MMF2 can even activate the conditions.
Dunno.. maybe there's something in there I missed. Was working on this between assignments and tests, after all and still am between assignments and tests. Maybe one of you with a more relaxed mind and/or more experience can see where I messed up.
And maybe even see if there's a better way to read a file line-by-line than using the combo object. I could write the code in the string text object or list object, but that defeats the purpose of making a scripting engine in the first place.
Thanks.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.