The Daily Click ::. Forums ::. Klik Coding Help ::. Scripting Engine in MMF2?
 

Post Reply  Post Oekaki 
 

Posted By Message

Andy Hull



Registered
  08/07/2002
Points
  111
3rd April, 2007 at 20:20:23 -

Are there any examples floating around? What is the best way to tackle this?

-Andy

 
-astro out

www.astrospoon.com

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
4th April, 2007 at 06:35:58 -

There's always the Lua object (MMF2), but you can also make your own. I doubt that you'll find any examples on this, simply because few people know how to do it, and because not many people are interested.

I've been messing around with it, quite a lot actually. It involves lots of string parsing and fastlooping though, (depending on how flexible you want the language/engine to be, or how you want to define your syntax) so if you don't have any experience with fastloops and that sort of stuff, then I really recommend you learn that first.

But I strongly recommend the Lua object if you don't want to make your own scripting engine. The syntax can feel a bit awkward if you're used to C-like languages, but it can be very useful when used right.

Image Edited by the Author.

 
n/a

Andy Hull



Registered
  08/07/2002
Points
  111
4th April, 2007 at 07:10:29 -

Well, I'd really rather make my own... I actually have a computer science degree, and have written scripting engines in C++, so I know how they work, and i have a fine handle on loops . What I am really curious about is what objects i should use to 1) read my script file and 2) parse the strings. I would rather not want to construct my scipt to conform to the ini format. Is there an object that will just let me read in all the text in a file so i can parse through it as i wish?

-Andy

 
-astro out

www.astrospoon.com

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
4th April, 2007 at 07:30:26 -

List object or Edit/Rich edit work fine for that sort of stuff. For string parsing, I recommend String Parser 2 and Regex object, they really help a lot. MMF also comes with some useful substring functions: Left$, Mid$ and Right$.

 
n/a

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48488

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
4th April, 2007 at 09:50:07 -

The Underside by Podunkian uses a scripting method... maybe you could ask him?

On another note, Astrospoon was brilliant... please make another one!

 
n/a

WillWill

Give me stuff

Registered
  24/07/2006
Points
  552
4th April, 2007 at 11:14:03 -

When you do online it can sometimes be like scripting, because you need to do things seperately and not at the same time (tickrates for example).. functions and such can work like scripts, but never like a 100% scripting language.

the LUA Object is something I've seen too, but hey, why script when this program isn't really meant to script?

 
http://www.morphboy.newgrounds.com/
^ Free tunes, as long as you contact me.

Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
4th April, 2007 at 12:15:03 -

If you're looking to simply read the text/data/whatever straight from a file, go for the Binary Object. It's made for file manipulation as bytes, strings, or variables.

 
Go Moon!
   

Post Reply



 



Advertisement

Worth A Click