Jump to content


Photo

String Parser and code runner


  • Please log in to reply
6 replies to this topic

#1 HelpMyFellowPeople

HelpMyFellowPeople

    GMC Member

  • GMC Member
  • 239 posts

Posted 03 November 2011 - 10:49 AM

Right, have I got a treat for you... I was messing around with some game creation tools and thought of how cool it would be if people could make Modable games. Well here is a real simple way for you to do it. If you know gml and how to use scripts, it will do what ever you want. I have a few simple scripts already and they work good. Basicly, it loads a text file, reads it from top to finish, and converts any compatable scripts to actions. For example:
;Create the title image(AddImage(ImageFilename,x,y,Transparent,BaseColor,Angle))
AddImage("Data\Images\Menu\Title.png",0,0,0,c_white,0)
;Add 3 menu buttons. AddButton(Text,x,y,Action(String) -1 if none,HoverSound -1 if none,ClickSound -1 if none)
AddButton("New Game",32,330,"Exec('Data\level1.cgf')",-1,-1)
AddButton("Load Game",32,360,-1,-1,-1)
AddButton("Game Options",32,390,-1,-1,-1)
AddButton("Quit Game",32,420,"EndGame(1,'Are you sure you wish to leave?')",-1,-1)
That creates a simple main menu. As long as the command exists as a script in your exe, it will execute that command. Awesome right?

I havnt done much commenting but if you know your way around gml, you will be sweet.

I look forward to your comments and I would like to see what you come up with.

DOWNLOAD: http://www.mediafire...lxl3b1a6f7uex8w

Please dont ignore this... I put alot of work into it.

Oh and if you get any errors, just disable error messages in the Global Game Options.
  • 0

#2 HelpMyFellowPeople

HelpMyFellowPeople

    GMC Member

  • GMC Member
  • 239 posts

Posted 09 December 2011 - 10:24 AM

No one thinks this is cool? I thought it was great. People can now make a fully mod-able game with this. Like the Cube 2 Engine. Could also be used to make a level editor with save/load in this style.
  • 0

#3 Proto1

Proto1

    GMC Member

  • GMC Member
  • 211 posts
  • Version:GM:HTML5

Posted 30 December 2011 - 06:58 AM

No one thinks this is cool? I thought it was great. People can now make a fully mod-able game with this. Like the Cube 2 Engine. Could also be used to make a level editor with save/load in this style.


If its any consolation, I just found it and think that it is brilliant! I'm actually looking at using a very similar function as a form of in-game debugger. In case I need to change a variable on the fly. Very cool indeed.
  • 1

#4 2DLuis

2DLuis

    Graphic Designer

  • GMC Member
  • 2493 posts
  • Version:GM8

Posted 01 January 2012 - 06:14 PM

Looks good. I see you use PHP's syntax for comments.
  • 0

#5 HelpMyFellowPeople

HelpMyFellowPeople

    GMC Member

  • GMC Member
  • 239 posts

Posted 03 January 2012 - 08:57 PM

Did I? lol. I think anything will work for comments. Just as long as it doesnt start with a script name.
  • 0

#6 GJH105775

GJH105775

    GMC Member

  • New Member
  • 15 posts
  • Version:Unknown

Posted 02 February 2012 - 04:38 PM

I think this is pretty cool.Posted Image:thanks:
  • 0

#7 HelpMyFellowPeople

HelpMyFellowPeople

    GMC Member

  • GMC Member
  • 239 posts

Posted 19 February 2012 - 04:33 AM

Thank you. I think it could be useful for some people too
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users