Ren'Flash?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Ren'Flash?

#1 Post by PyTom »

So here I was, yesterday, procrastinating. (On the new demo, on graduating, on... well, anyway...) I read:

http://lemmasoft.renai.us/forums/viewtopic.php?t=1424

And it got me to thinking what it would take to implement something resembling the core of Ren'Py, that could create a flash file. Anyway, I took it up to a proof of concept. Here's the example script:

Code: Select all

class Game extends Main {
    
    // Boilerplate required to make the game actually work.
    static function main() {
        var g = new Game();
        g.init();
        g.run(1);
    }

    // Variables that are used by this game.
    var e : Character;

    function init() {
        // set the size and width of the screen.
        screen_width = 800;
        screen_height = 600;

        
        // Declare the images.
        image("washington", new Position(new Image("washington"), 0.5, 1.0));
        image("eileen_happy", new Position(new Image("eileen_happy"), 0.5, 1.0));
        image("eileen_concerned", new Position(new Image("eileen_concerned"), 0.5, 1.0));

        // Declare a character.
        e = new Character("Eileen", 
                          0xe0ffe0, "dejavusans", 22, 
                          20, 450, 760, 130,
                          0xffffff, "dejavusans", 22, 
                          20, 480, 760, 130,
                          new Absolute(new Image("frame"), 10, 445));

    }

    function script(pc : Int) {
        switch(pc) {
        case 1:
            show("washington");
            show("eileen_happy");
            
            say(e, "Welcome to the new Ren'Flash demo game.");
            wait(2);

        case 2:

            say(e, "This is a proof of concept to show that it's possible to implement the core of the Ren'Py engine in Flash.");
            wait(3);

        case 3:
            say(e, "I think the concept has been proved, but we still need to write a Ren'Py->Script converter.");
            wait(4);

        case 4:
            hide("eileen_happy");
            show("eileen_concerned");
            say(e, "And I'm not sure if we'll get around to doing that anytime soon.");
            wait(5);

        case 5:
            hide("eileen_concerned");
            show("eileen_happy");
            say(e, "Well, in any case, I hope you've enjoyed this demo!");
            wait(6);

        case 6:
            say(e, "It took you " + flash.Lib.getTimer() + " milliseconds to play through this demo. Click to restart.");
            wait(1);

        }
    }
}
It's in the HaxE language, with my own library, and while it doesn't look much like Ren'Py, I'll assert that it would be pretty easy to translate the basics of Ren'Py into this language. It wouldn't be Ren'Py proper, but it would be philosophically similar.

I combined it with swfmill, and was able to build it into a working proof-of-concept.

I don't really plan to go anywhere with this, unless someone wants to hire me to do some consulting work. (And that won't come cheap.)

(Oh, and I still have never touched the flash tool.)
Attachments

[The extension swf has been deactivated and can no longer be displayed.]

Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#2 Post by DaFool »

Eileen is well on her path to world domination! :D :D :D :D

Although, I thought something like "Export to swf" in the Launcher menu would put everyone else to shame.

edit: I miss rollback :)

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#3 Post by monele »

What do you mean ? You can roll back to the previous post in this thread using the wheel :P.

Well I'm not sure I understood everything but it sounds cool ^^. But hm... it still seems like Ren'Py would benefit from being able to play flash animations more than Flash running like Ren'Py. Sure it's crossplatform and web launched, but you miss the right button, the wheel and you suffer from some Flash problems with bitmaps (though... it gets better and better lately).
Mah, it's a step forward nonetheless ^^

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#4 Post by PyTom »

DaFool wrote:Although, I thought something like "Export to swf" in the Launcher menu would put everyone else to shame.
That'll never happen. Flash is different enough from the way Ren'Py works to make that very difficult. (Although Flash 9 supposedly fixes some of that.)

To be honest, Flash has a mind of its own about layout, and I had to fight it on that. So I'm not overly inclined to work more on this... I just wanted to show off what I did.
edit: I miss rollback :)
Rollback is technically possible, but I'd need to implement it, which I'm not bothering to do. I'd also need to figure out how to invoke it... I'm not sure if you can get at the mouse wheel in Flash.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot]