xiongchiamiov / ossified

Using a visual novel framework to help you with open-source licensing.
Other
3 stars 0 forks source link

Rewrite it all in javascript #2

Open danielbeardsley opened 11 years ago

danielbeardsley commented 11 years ago

So that it can be "played" right in your browser.

adam000 commented 11 years ago

:+1: You can also publish the latest stable version to gh-pages!

xiongchiamiov commented 11 years ago

Yes, this is something I've thought about ever since starting this project.

It is unlikely Ren'py will support javascript output in the near future because it has a lot of drawing code; see renpy/renpy#103 for more details.

I don't use the advanced features or full power of Ren'py, though, so it's very feasible to use something like JS-ViNE. I'm not terribly happy with how code-like the script is afterwards, as compared to the original Ren'py version, but it's not too bad, I suppose.

I've mostly been avoiding it because this was a project to allow me to experiment with Ren'py, but as the actual project is becoming more important than the technology used to implement it, I'm starting to agree with you.

xiongchiamiov commented 11 years ago

Okay, so I've found a project with no code, a crappy click-n-drag project that outputs to html, and a fairly new and somewhat active HTML5-based project. And I have to say, that one's demo kicks the pants off ViNE's. But it's using svn and hosted on Google Code. :/

Edit: And the things the author does to get around svn are painful: he keeps versioned files in the repo because then he can revert to older versions. That's what your VCS is for!

xiongchiamiov commented 11 years ago

Well, searching through Github yields a few more options:

jtenner commented 8 years ago

I'm working on something better at the moment actually :).

I would love to reuse the syntax provided by renpy scripts in js, but I have no good way of interpreting it myself. Any thoughts?

xiongchiamiov commented 8 years ago

I talked to Tom about it a few years back. I also started writing my own parser for Ren'Py that would generate a suitable script for one of the javascript engines, but didn't get very far on that at all. Unfortunately, the renpy parser is very tied in with the rest of the app, and so it's effectively impossible to just use the prebuilt parser unless you want to have all of renpy's dependencies installed and working.

jtenner commented 8 years ago

@xiongchiamiov I have discovered too that there are no independent implementation solutions. What I need is a way to parse/lex the syntax and yield a tree of commands. From there, everything is renderer dependent.

The former should be 100% possible.

I'm not very good at this kind of thing sadly.

Instead I am trying to write a javascript generator api the yields script slides. Not sure if this piques anyone's interest but I'll share an example here.

var chapter = function* chapter(script, data, config, actors) {
  var Amanda = actors.createActor('Amanda');

  //Slide 1:
  //center the actor in the middle of the sprite
  Amanda.center(0.5, 0.5).move('center', 'standing');
  script.background('background-id');
  script.text(
    'Hi I am Amanda.',
    'This is a new line of text.'
  );  
  yield script.createSlide();

  script.choices({
    'choice-1': 'Choice Text',
    'choice-2': 'Other Choice Text'
  });

  //choices must feed the response back into the generator
  var answer = yield script.createChoices();
  data.flag = answer;
  return script.redirectTo('other-chapter');
};