Who's using GameMonkey Script?

Started by
26 comments, last by evolutional 19 years, 5 months ago
I thought I had also posted this comment to the game monkey forum, but apparantly I didn't, so since their forum is obviously too hard for me to understand, and since this is a scripting forum, we can discuss lex here ;)

I'm using 1.22.
gmScanner.l specifies an action to be taken on matching "and".
lex (and flex) should find that as a match to the first three characters in "andy", so if a function called "andy" works for you people there is something I don't understand going on. That or the flex.exe which comes with the source is modified from the original, which seems more than just unlikely.

Anyone know?

PS - yes, semi-colon comment understood, but that doesn't explain the "unexpected TOKEN_AND". That would cause an error like "couldnt find $end" or something.
Advertisement
How odd that we're not seeing the same problem. I really don't see why compiling on *nix would have an effect on the scanner. I've had a look at the gmScanner.l file and whilst my Lex is rustier than yours I can't really see a problem.

Have you tried using the other keywords as a test case?

So:

whileme = function() { return 0; };

If that matches KEYWORD_WHILE then it looks like a problem in the scanner.

Incidentally, if you get it working under *nix, I think the authors would appreciate the makefiles and gmConfig_p.h file you used ;)
The scanner will try to make the longest token possible, so it can't grab 'and' from 'andy'. The missed semicolon will cause an error to occur somewhere later as the code doesn't terminate where expected. The KEYWORD_AND may have come from a later line of code.

I've not tried GM although I've looked at it. I'm looking for a script language for our Game engine. Does anyone know if it's possible to access instances from GM that have been made in C++?

Something like:

aClass someClass;

and access someClass from GM

IF not which scripting language support such system (if any)

styx
Auris Terre a free and open source MMORPG. http://auristerre.sf.net- Your world is our world! -
styx,

I'm almost ready to release a utility called gmBind, it's a templated class library that lets you quickly interface GM with C++ classes and access them in script. gmBind allows you to create native C++ objects from script, as well as 'port' an existing C++ object to GM. I'm already using the alpha in my own projects with great success, but I'm tidying it up and adding extra features ready for the full release.
Nice! Is there a project page somewhere, where I could try it out? Would be nice. Oh and btw, nice tutorials! Keep up the good stuff mate

cheers!
Auris Terre a free and open source MMORPG. http://auristerre.sf.net- Your world is our world! -
The project page will be the same one as the tutorials - but as I say I've not released it yet - but I'm looking to in the next few weeks once I decide to commit myself to a particular design decision regarding the properties.

And thanks for the compliments - I'm aiming to add more to the tutorials to cover more advanced topics too [smile]
Just one more thing, has anyone ever succeeded compiling GM on Linux? I saw on the project page it has been compiled on Mac so my guess is it should compile on Linux without to much tweaking.

Auris Terre a free and open source MMORPG. http://auristerre.sf.net- Your world is our world! -
In the new 1.22 release, there's a file called platform/win32gcc/gmConfig_p.h which I believe could be tweaked (or even just used outright) for GCC on *nix operating systems. The only thing left to do would be to create a makefile to build the library - If you do this I can imagine that it'd be useful for others so I'd be happy to pass it onto the guys maintaining the library if you wish to share it :)
Sharing is good :) I'll look into it. Thanks
Auris Terre a free and open source MMORPG. http://auristerre.sf.net- Your world is our world! -

This topic is closed to new replies.

Advertisement