1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Random button

Discussion in 'Loader Requests' started by Hank East, Oct 9, 2016.

  1. Hank East

    Hank East Swell Supporter

    Joined:
    Jan 25, 2012
    Messages:
    539
    Likes Received:
    29
    I haven't seen anyone request or do this before so here goes. I'm requesting a button mod that selects a character from your collection at random, like in a fighting game.

    The default game has a randomize option, but it creates a new character using random assets rather than selecting an already existing character randomly.
     
  2. stuntcock

    stuntcock Club Regular Staff Member Moderator

    Joined:
    Jun 5, 2012
    Messages:
    1,520
    Likes Received:
    353
    If you just it to select one of your vanilla characters (defined by a mere charcode) then the code is very simple:

    Code:
    l.g.inGameMenu.characterMenu.resetSearch();
    l.g.inGameMenu.characterMenu.triggerSelect( Math.random() * (l.g.inGameMenu.characterMenu.thumbs.length - 1));
    
    If you want the scope to include Character Folders then it gets more complex. You'd need to walk through the whole tree so that we could include characters buried within subfolders. You'd also need to find some way to identify and exclude the non-character folders. For example, sby's Loader Pack includes entries for various Loader mods: aimpenis, autohuereg, strandlimit, etc... You presumably wouldn't want to activate one of those when pressing the Random button.
     
  3. Hank East

    Hank East Swell Supporter

    Joined:
    Jan 25, 2012
    Messages:
    539
    Likes Received:
    29
    Well I do not use character folders so I'm just looking for it to select vanilla characters. Also I thought it could maybe have a tag system to select which characters get thrown in the randomise pool.
    For example, let's say I have all my Pokémon characters named "[girl name here] PKMN". If I wanted to just randomly pick a Pokémon girl, I'd add "PKMN" as a tag and it would pick up from there. Just an idea I had after making the request.
     
  4. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,331
    Likes Received:
    73
    one of my mods i think is called extract loader chars can rip loader mods out of the vanilla menu and put them on an old-style loader menu.
    even supports regular expressions to leave certain characters in. in my setup, i denote characters with 'c-' in the start of the mod's character folder. it could help with the situation stuntcock mentioned (as long as that thumbs list gets updated, not sure if it will)

    i mostly made it for myself, not sure how many other people have actually tried it out xD.