Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   GS2 Emulator (https://forums.graalonline.com/forums/showthread.php?t=134265855)

fowlplay4 02-27-2012 11:08 PM

Quote:

Originally Posted by Hezzy002 (Post 1686221)
I really wish you never did this. It's never going to get anywhere because it's a weird Javascript parser and preprocessor step rather than an actual VM or even interpreter, yet people in the future will point back to it and go, "Look, it exists! Now shut up." There are so many reasons why this is a bad idea.

I get that this isn't the 'traditional way' to do things, and is just a hack that takes advantages of the similarity between the two languages.

I barely have any experience writing a VM or interpreter (or really anything that low-level), I'm just trying to provide something usable for the masses who actually want to write something that would work in an actual GS2 script, and perhaps maybe make them feel like they have a chance if they do decide to get a gold account and NC Access.

If you focus entirely on the 'bad' and give yourself reasons why it shouldn't be done, ignore any positive benefits then nothing will get done.

Hezzy002 02-28-2012 03:33 AM

Quote:

Originally Posted by fowlplay4 (Post 1686232)
I get that this isn't the 'traditional way' to do things, and is just a hack that takes advantages of the similarity between the two languages.

I barely have any experience writing a VM or interpreter (or really anything that low-level), I'm just trying to provide something usable for the masses who actually want to write something that would work in an actual GS2 script, and perhaps maybe make them feel like they have a chance if they do decide to get a gold account and NC Access.

If you focus entirely on the 'bad' and give yourself reasons why it shouldn't be done, ignore any positive benefits then nothing will get done.

I'd agree if it were any other community, but that's been Graal's mantra for the last decade. Hell, you could've picked apart an open source Javascript engine and added these things to the core, not as a preprocessor step, and I'd have been very, very happy with that.

DustyPorViva 02-28-2012 03:46 AM

Do you intend this to be a syntax checker? If so then this is good. For example I have no access to GS2 at the moment but sometimes I am asked to convert simple things. To be able to make sure I made no mistakes would be nice. But as for learning I can't say this would be useful past the very very basics of scripting, can you? Most people are interested in developing in Graal because OMG GRAPHICS and this won't be able to provide that sort of satisfaction. The most it would be able to do in its fullest potential are simple echos and evaluations.

Not trying to downplay what you're doing, it's great that people like you try to provide services that devs should get but don't, but I'm wondering if it will be worth the effort in the end.

fowlplay4 02-28-2012 05:47 AM

Quote:

Originally Posted by Hezzy002 (Post 1686251)
I'd agree if it were any other community, but that's been Graal's mantra for the last decade. Hell, you could've picked apart an open source Javascript engine and added these things to the core, not as a preprocessor step, and I'd have been very, very happy with that.

I'll consider it but that would probably just get to the point where I would have to basically code my own 'Graal' client just to be able to provide a decent full-fledged GS2 emulation experience.

Quote:

Originally Posted by DustyPorViva (Post 1686253)
Not trying to downplay what you're doing, it's great that people like you try to provide services that devs should get but don't, but I'm wondering if it will be worth the effort in the end.

But for something that I really only put maybe an hour and a half into it's definitely worth it for those starting out.

There's nothing more de-motivating to newbies than reading my tutorial only to find that out that the only way you can complete the first part is plopping cash down for a gold account and managing to find NC access.

Also hoping that maybe Stefan will take interest in this kind of project, and just maybe he'll consider making development more accessible.

DustyPorViva 02-28-2012 05:56 AM

Quote:

Originally Posted by fowlplay4 (Post 1686260)
There's nothing more de-motivating to newbies than reading my tutorial only to find that out that the only way you can complete the first part is plopping cash down for a gold account and managing to find NC access.

But what about when they get to the second part, the more interesting making game-stuff/graphical part of the tutorials where they will still have to plop down cash to do it?

Like I said kudos to you for doing this but I'm just wondering if the benefits make the effort worth it. But then again sometimes I do a lot of stuff with absolutely no benefit and lots of effort.

I guess in the end you can make a syntax checker out of it?

fowlplay4 02-28-2012 06:24 AM

Quote:

Originally Posted by DustyPorViva (Post 1686261)
But what about when they get to the second part, the more interesting making game-stuff/graphical part of the tutorials where they will still have to plop down cash to do it?

Like I said kudos to you for doing this but I'm just wondering if the benefits make the effort worth it. But then again sometimes I do a lot of stuff with absolutely no benefit and lots of effort.

I guess in the end you can make a syntax checker out of it?

Well, I'm hoping it'll get them in the door and make them want more. I'll have to wait for feedback from new scripters who used it when they were learning to see whether it was effective or not. I know one person who wanted to learn GS2 was really happy about it so far.

I might attempt to, might be able to apply my learnings from that and end up with in-game GS2 Emulator (GS2ception) which would allow them to actually use the engine. Might require gold depending on where they can use it but it would remove the NC requirement.

We'll just have to see what I do next. :)

Quote:

Originally Posted by Hezzy002 (Post 1686262)
An HTML5 Graal clone would be interesting.

Sounds like a pending C&D to me.

Hezzy002 02-28-2012 06:35 AM

Quote:

Originally Posted by fowlplay4 (Post 1686263)
Sounds like a pending C&D to me.

I started working on a multiuser HTML5 Graal chatroom thing, it could load NW and gani files by requesting them through AJAX request and used websockets for actually sending player positions and chat and stuff. I dunno why, I just had 45 minutes every day, for a few weeks, without admin rights and with only a browser and notepad in front of me.

Maybe I'll use the gani stuff for an online gani editor, that'd be useful.

fowlplay4 02-29-2012 07:29 AM

Updated to V1.1

1. Support for GS2 Arrays
2. GS2's for each loop is now supported as well.

Many thanks to Jazz for that. :)

Link: http://fp4.ca/gs2emulator/

Tolnaftate2004 02-29-2012 07:15 PM

Quote:

Originally Posted by fowlplay4 (Post 1686398)
1. Support for GS2 Arrays

Hate to burst your bubble but you're not going to find a way to replace GS-style arrays with a regex.

First thing I tried of course was
a = {1,2,{3,4}};
which broke it.

There's gonna need a lot more work put into this to get proper GS emulation in JS. At a minimum, you'll likely need to break the GS into an AST and have a visitor reconstruct into JS.

As far as GSception goes, there were 2 things written a few years back:
by me
by zero (ziro?) / zokemon

fowlplay4 02-29-2012 08:06 PM

Added another hack to get that working, and noted the limitation.

And yes, I understand how much work a proper emulation would take and that using regex is just a hack solution.

Tolnaftate2004 03-05-2012 11:21 PM

Quote:

Originally Posted by DustyPorViva (Post 1686253)
Do you intend this to be a syntax checker?

Here ya go.

e: Just check my sig. I keep updating this post, and eventually I won't be able to anymore.


All times are GMT +2. The time now is 03:17 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.