PlayerSelfiesFaceset.js (camera plugin)

Discussion in 'JS Plugin Releases (RMMV)' started by mogwai, Apr 22, 2017.

  1. mogwai

    mogwai 1984

    Messages:
    876
    Likes Received:
    564
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    I just made a plugin that will turn camera selfies into a face set for the game. :kaoswt2:(yes, you read it right)

    Forgive me, that this plugin is a little bizarre. :beard

    The angle here is: a game that stars the game player, as the game player's actual self.
    Think Neverending story or something, where the reader becomes the read-ed.

    :guffaw: It's fun; it's got novelty value. :mrsatan:
    [​IMG]

    [​IMG]

    [​IMG]

    To use this plugin, you're gonna need three things.

    Thing number one: Call this function by event script call. (not plugin command)
    PHP:
    SelfieFace.getSelfies({
        
    filename:"CustomSelfPhoto"
    });
    You don't need to specify the filename parameter, but then it will just make a random filename and you won't be able to use it later on in the game. For instance you can use...

    thing number two: This default faceset; (save this one or make your own)

    CustomSelfPhoto.png

    You can make your player's role talking messages with this dummy faceset and when the player takes selfies, it will overwrite this dummy file in their game play. (so it will use all their selfies in their premade dialogue)

    Thing number three: You can make more than one faceset, and you can define your own facial expressions (selfie directions) with this other event script call parameter.
    PHP:
    SelfieFace.getSelfies({
        
    filename:"CustomSelfPhoto",
        
    expressions:[
            
    "a normal face",
            
    "a happy face",
            
    "a laughing face",
            
    "a sad face",
            
    "a angry face",
            
    "a shocked face",
            
    "dramatic look-away",
            
    "dramatic eye contact"]
    });
    I recommend only doing groups of 8. More than 8 will break it, and less than 8 is a waste of negative space and I didn't test it much.

    And that's all that's to it.

    This plugin is vicariously the idea of @shinichi999 because I discovered how to use camera and microphone in HTML5, while I was researching how to take on his request for a similar plugin in this thread. I'm just a little more certain that I can make it now. I just did this extra plugin for practice and for fun.

    And all functional credit goes to this HTML5 tutorial I found. I really wouldn't know how to do it, if it weren't for this. https://davidwalsh.name/browser-camera

    You're free to use this in commercial games or dissect it to make other kinds of camera apps or whatever too. I don't mind.

    Version 0.1
    EDIT: I had a flaw where the file path couldn't handle Unicode characters, but luckily shinichi caught it and I fixed it before the plugin had any downloads (because the thread wasn't even live yet). I also had a flaw where I didn't shut the stream off, but it's now fixed thanks to Microsnitch discovering it.

    EDIT: Version 0.2: I've never been so dumb... :( @shinichi999 caught another big flaw. I didn't position my video and canvas elements for different resolutions so everything was out of whack in fullscreen, but it's now fixed! :D
     

    Attached Files:

    Last edited: Apr 26, 2017
    #1
    Poryg, just1witness, Indsh and 9 others like this.
  2. shinichi999

    shinichi999 Veteran

    Messages:
    117
    Likes Received:
    11
    First Language:
    Spanish
    This is absolutely amazing! I just tested it and it`s really funny!

    But I have just one concern:

    [​IMG]

    I think the webcam should be in the middle of the blue rectangle, not to the left. What do you think?
     
    #2
  3. mogwai

    mogwai 1984

    Messages:
    876
    Likes Received:
    564
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    Oh no! I was so excited to have a functional camera app, that I didn't consider its position in full-screen. It's now fixed. Thanks @shinichi999 Wow! That's 3 for 3 major fixes you've contributed to this plugin! I've attached version 0.2 to the original post.
     
    #3
    shinichi999 likes this.
  4. shinichi999

    shinichi999 Veteran

    Messages:
    117
    Likes Received:
    11
    First Language:
    Spanish
    Excellent! Now it`s totally perfect! I like it! :D
     
    #4
    mogwai likes this.
  5. Tuomo L

    Tuomo L Oldbie

    Messages:
    1,852
    Likes Received:
    858
    Location:
    Finland!
    First Language:
    Finnish
    Primarily Uses:
    RMMV
    This is hilarious and opens up so many options, thanks Mogwai!
     
    #5
  6. mogwai

    mogwai 1984

    Messages:
    876
    Likes Received:
    564
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks for liking this @just1witness (why?) the script only has 9 views and it was only by @shinichi999 because he helped me debug it.

    Photobucket will requit this bandwidth err to whoever caused this nonsense, like they always do.

    I have a veteran account with them and I order things from their print shop all the time, on promo codes.

    Here is my PB alternative, for the nobody who wants this script anyway... attachments...
     

    Attached Files:

    #6
  7. just1witness

    just1witness Veteran

    Messages:
    525
    Likes Received:
    1,343
    First Language:
    English
    Primarily Uses:
    RMMV
    The question isn't why, it's why not.
     
    #7
  8. mogwai

    mogwai 1984

    Messages:
    876
    Likes Received:
    564
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    PHP:
    var just1witness = new friend();
    just1witness.friendliness 479;
    var 
    respect = function(){
        if(
    mogwai.likes===540)
           
    mogwai.likes++;
    };
    respect();
    // exception: err the mogwai object does not know how to requit
     
    #8
    just1witness likes this.
  9. just1witness

    just1witness Veteran

    Messages:
    525
    Likes Received:
    1,343
    First Language:
    English
    Primarily Uses:
    RMMV
    @mogwai Thanks :)

    Code:
    function answer (string) {
      return string.split("").reverse().join("");
     
    }
    
    answer("syawyna sresol rof si qnittiuq");
    
     
    #9
  10. mogwai

    mogwai 1984

    Messages:
    876
    Likes Received:
    564
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    PHP:
    mogwai "Worlds of ZZT";
    just1witness = ["script","Java","Javanese","Japan","NES","Nintendo","Etc."];
    if(
    just1witness.indexOf(mogwai) !== -1){
       
    console.log("undefined");
    }
     
    #10
    just1witness likes this.
  11. just1witness

    just1witness Veteran

    Messages:
    525
    Likes Received:
    1,343
    First Language:
    English
    Primarily Uses:
    RMMV
    It's a mystery. It will forever be a mystery. :stickytongue:
     
    #11
    mogwai likes this.

Share This Page