The Daily Click ::. Forums ::. Klik Coding Help ::. Making a scripting language with MMF2
 

Post Reply  Post Oekaki 
 

Posted By Message

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
9th February, 2007 at 03:18:44 -

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.

Image

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
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.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
9th February, 2007 at 09:36:27 -

Lua has an awful syntax though. I made a simple but flexible scripting engine in MMF 1.5 not long ago. I never used it though.

 
n/a

Reno



Registered
  11/01/2005
Points
  906
9th February, 2007 at 15:13:16 -

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.

 
Reborn Again

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
12th February, 2007 at 22:30:47 -

I'm not using Lua for the same reason I don't use RPG Maker - flexibility.

Here's what I've worked on so far. You'll need some stuff from the MMF2 Bonus Packs. Might have to right-click > save as...
http://freebor.tripod.com/files/script.zip

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.

Image
   

Post Reply



 



Advertisement

Worth A Click