Pickboard - Lotto Type Item Picking

Discussion in 'JS Plugin Releases (RMMV)' started by Mr. Trivel, Feb 17, 2016.

  1. Mr. Trivel

    Mr. Trivel Glasses Veteran

    Messages:
    284
    Likes Received:
    442
    First Language:
    Lithuanian
    Name: Pickboard


    Version: 1.1


    Author: Mr. Trivel


    Created: 2016-02-16


     


    What does it do?


    Allows players to pick rewards from a board of tiles and costs some currency - be it gold or items.


     


    Video:










     


    Features:


    Setting up multiple different sized boards.


    Rewards ranging from nothing to items/weapons/armor or gold. Any amount of it.


    Resetting the board without having to re add all rewards.


    Saving is board completed state to a Switch for eventing use.


     


    How to use?


    Everything is set up using Plugin Calls.


    We have the following ones:



    Pickboard Start [Board ID] [X] [Y] - creates empty board with X Y dimensions


    Pickboard Reset [Board ID] - resets board of ID to empty state


    Pickboard IsComplete [Board ID] [Switch ID] - Saves answer to a switch


    Pickboard AddReward [Board ID] [RewardType] [ID] [Amount] [Tiles] [IconID] - Adds rewards


    Pickboard SetPrice [Board ID] [PriceType] [ID] [Amount] [IconID] - Picking isn't free, right?


    Pickboard Enter [Board ID] - go the scene with pickboard of ID


    Pickboard SetBackground [Board ID] [ImageName] - Changes background of pickboard
    Pickboard OpenTiles [Board ID] [NumberOfTiles] - opens a number of tiles


     



    [Board ID] - ID of the board you're changing


    [X] - Width of the board


    [Y] - Height of the board


    [Switch ID] - ID of the switch to save board's state


    [RewardType] - a, w, i, g, v - armor, weapon, item, gold, variable
    [PriceType] - a, w, i, g, v - armor, weapon, item, gold, variable


    [ID] - ID of item, if [Type] is gold -- then ID is irrelevant


    [Amount] - How much should be reward if adding it or taken if setting price


    [Tiles] - How many tiles on board has this reward


     


    Example of calls:



    Code:
    Pickboard Start 3 5 5
    Pickboard Reset 3
    Pickboard IsComplete 3 173
    Pickboard AddReward 3 a 4 1 5
    Pickboard AddReward 3 g 0 1000 10
    Pickboard AddReward 3 i 1 5 7
    Pickboard SetPrice 3 i 5 1
    Pickboard Enter 3

     


    Sample pickboard setup from video:


    [​IMG]






     


    Plugin: <GitHub>


    How to download Plugin. Click the link above, there will be a button named Raw, press Right Click -> Save As.


    Images:


    Image files: <MediaFire>


     



    Terms of Use:


    Don't remove the header or claim that you wrote this plugin.


    Credit Mr. Trivel if using this plugin in your project.


    Free for non-commercial projects.


    For commercial use contact Mr. Trivel.
     
    Last edited by a moderator: Mar 11, 2016
    #1
  2. killerfer

    killerfer Veteran Veteran

    Messages:
    197
    Likes Received:
    48
    Location:
    Brazil
    First Language:
    Portuguese
    @Mr. Trivel


    Loved it! Thanks!


    If I may add a suggestion, would be nice to change the images through plugins command to have different looking pickboards throughout the game.
     
    #2
  3. Roguedeus

    Roguedeus Veteran Veteran

    Messages:
    503
    Likes Received:
    100
    First Language:
    English
    This is a really slick plugin. :)


    Would you be willing to add a new reward type that executes a common event?


    It may need to immediately exit the scene in order to prevent repeated event queues from replacing each other. (Unless someone is using a Common event queue plugin)


    edit: It would also need a means of assigning an icon for common event rewards. Since the icon is taken from the reward itself. Possibly assign the icon via an optional command that overrides the items icon.


    Example: Pickboard AddReward [Board ID] [Type] [ID] [Amount] [Tiles] [IconIndex] - Adds rewards


    Thanks for your time. :)


    EDIT2:


    Also. Would you be willing to add a command to check if all available rewards are already obtained? Otherwise a player might continue to play with no possible reward. :(


    Note: This would require the picking end when the last reward is found. If a new reward is added later, or the board is reset, the board would be usable again


    EDIT3:


    One more thing! Would you be willing to add the possibility of using a variable for cost?


    Example: [Type] - a, w, i, g, v - armor, weapon, item, gold, variable


    Pickboard SetPrice 1 v 123 1 - deducts 1 point from $gameVariable 123


    lol... This is such a useful little plugin, I am hoping to use it in a few ways. :D


    EDIT4:


    Oh my goodness... I really hope I am not driving you crazy. BD


    Would you be willing to add the option of revealing random picks upon entry of the pickboard? Sorta like an advantage where the first time its accessed, a certain number of picks are auto revealed?


    Example: Pickboard BonusPicks 1 5 - Reveals 5 picks for free upon first entry. (will reset if the board is reset)
     
    Last edited by a moderator: Feb 17, 2016
    #3
  4. Khayalan

    Khayalan Mapping-Guru Veteran

    Messages:
    50
    Likes Received:
    27
    Location:
    Somewhere in the Nothing
    First Language:
    German
    Really nice Plugin :)
     
    #4
  5. Znikomek

    Znikomek Veteran Veteran

    Messages:
    56
    Likes Received:
    4
    Hi, great work ;)


    do you plan to make popup what item it was won?


    And it is possible to Enter the board without background image?
     
    Last edited by a moderator: Feb 23, 2016
    #5
  6. Roguedeus

    Roguedeus Veteran Veteran

    Messages:
    503
    Likes Received:
    100
    First Language:
    English




    FYI: The "Display Board Window" parameter will clear the background if set false.


    .


    @Mr. Trivel.


    I understand if you are unwilling to add new features.


    Though I really think that you should consider adding a means of preventing the player from playing on an empty board. (A board with no remaining rewards but still has playable selections)


    As I stated in my first post. It is very possible that the player could luckily choose all possible rewards and still have choices left. (Which would all be empty)


    If the player must clear the entire board to be sure they have collected all the rewards, it kind of destroys the 'gambling/lottory' aspect. And may leave the player feeling cheated.


    The only alternative, is to design boards that have a limit to the possible picks, and reset each time the player exits the scene. Which again, sorta breaks half the options you've provided. (Unless I misunderstand them)


    I will interpret further silence as refusal. In which case, I won't bother you about it again. :)
     
    #6
  7. Mr. Trivel

    Mr. Trivel Glasses Veteran

    Messages:
    284
    Likes Received:
    442
    First Language:
    Lithuanian
    @Roguedeus,


    They are all valid suggestions. I'll definitely add the variables as cost and stopping player when there's no rewards left. Not sure about common events right now. As for free bonus tiles when starting a board, I'll probably add that, too.


    But first gotta finish up with other plugins.


    @killerfer,


    Yup, that's a valid suggestion. It's going to be added.
     
    #7
    killerfer and Roguedeus like this.
  8. Znikomek

    Znikomek Veteran Veteran

    Messages:
    56
    Likes Received:
    4
    Yea it's clear the the window backgrouund, and i want to clear the image 'pick_Background' and see the pick Board on tinted map or something like that

    11.png


    12.png


    13.png
     
    Last edited by a moderator: Feb 24, 2016
    #8
    Roguedeus likes this.
  9. Ignatios

    Ignatios Developer Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    English
    I have an issue when this runs on an android...the game crashes and says it can't find the pictures, however the same exact version on the PC works just fine. Any help with that?
     
    #9
  10. Mr. Trivel

    Mr. Trivel Glasses Veteran

    Messages:
    284
    Likes Received:
    442
    First Language:
    Lithuanian
    @Ignatios,


    Hmm, I don't have an Android,  so can't really troubleshoot that.


    Version 1.1


    - Variables added as reward choice or price choice.
    - Able to change any item, gold or variable displayed icon ID for any board.
    - Added transparency option for reward window background.
    - Added command to add different backgrounds to different pickboards.
    - Added option to not have a background by default.
    - Now the board is revealed if there's no more rewards to pick.
    - Added a new command to reveal X random tiles on the board.
     
    #10
    Roguedeus and gRaViJa like this.
  11. gRaViJa

    gRaViJa Veteran Veteran

    Messages:
    732
    Likes Received:
    265
    Location:
    Belgium
    First Language:
    Dutch
    I just finished implementing this plugin in my game 15 minutes ago and now I already have to update hehe //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif


    Great updates! The plugin has anything I wished for now... Except, an option to show each item that is won in a pop-up or something. My question: Are you considering another update? If not, am I allowed to add this to the plugin myself?


    Thanks for this awesome plugin, Trivel!
     
    #11
  12. Mr. Trivel

    Mr. Trivel Glasses Veteran

    Messages:
    284
    Likes Received:
    442
    First Language:
    Lithuanian
    @gRaViJa,


    There's gonna be one more update with common events as rewards and popups for each item received, but probably not in couple of weeks. Feel free to edit the plugin.
     
    #12
    gRaViJa likes this.
  13. Roguedeus

    Roguedeus Veteran Veteran

    Messages:
    503
    Likes Received:
    100
    First Language:
    English



    This is a great update! :D


    Out of curiosity. Will the common event rewards be able to execute immediately?


    Example: Starting a battle.
     
    #13
  14. Mr. Trivel

    Mr. Trivel Glasses Veteran

    Messages:
    284
    Likes Received:
    442
    First Language:
    Lithuanian
    @Roguedeus,


    Yup, they will execute the moment they're rewarded.
     
    #14
  15. Roguedeus

    Roguedeus Veteran Veteran

    Messages:
    503
    Likes Received:
    100
    First Language:
    English


    Even if the common event runs a command that alters the current board?


    Example: Reveals a few free choices?


    This leads me to a new suggestion! //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif


    Can you add a command that re-hides some already revealed tiles? The rewards under them won't change, but it adds to the 'memory' aspect of the board. Trying to remember which tiles were already empty can add complexity to a board/


    Thanks again!


    BTW:


    Without a command to check to see if a board already exists, calling the reset board command causes an error.


    I've resorted to calling:

    Code:
    if($gameSystem._pickboardData[1]) $gameSystem.resetPickboard(1);
     
    #15
  16. Mr. Trivel

    Mr. Trivel Glasses Veteran

    Messages:
    284
    Likes Received:
    442
    First Language:
    Lithuanian
    @Roguedeus,


    If you try to reset before board exists, it'll crash, yup. I'll add failsafes for next version then.


    Hiding specific tiles or hiding whole board? Well, sure to both. For now you can use this for it:

    Code:
    // Hide single tile:
    $gameSystem._pickboardData[boardId].board[tileIndex].open = false;
    
    // Hide all tiles:
    for (var i = 0; i < $gameSystem._pickboardData[boardId].board.length; i++) {
    	$gameSystem._pickboardData[boardId].board[i].open = false;
    }
     
    #16
    Roguedeus likes this.
  17. gRaViJa

    gRaViJa Veteran Veteran

    Messages:
    732
    Likes Received:
    265
    Location:
    Belgium
    First Language:
    Dutch
    Can I add one more request? (or is this already doable now?): Thing is I want the pickboard to appear after "missions" and based on how good the player battled, they can choose more rewards. I figured out how, but I want the player to be unable to leave the pickboard untill all the picks are done. If i make an item "Picks" which is used as the cost for selecting items and the player get's 10, then the player can't leave untill the item "Picks" has 0 count again (aka the player picked 10 items from the board).
     
    #17
  18. Mr. Trivel

    Mr. Trivel Glasses Veteran

    Messages:
    284
    Likes Received:
    442
    First Language:
    Lithuanian
    You can't do that with the current version, but if you want it, just add this piece of code somewhere in the plugin.


    Scene_Pickboard.prototype.popScene = function() {
    var have = 0;
    if (this._priceWindow._price.type === 'g')
    have = $gameParty.gold();
    else if (this._priceWindow._price.type === 'v')
    have = $gameVariables.value(this._priceWindow._price.id);
    else
    have = $gameParty.numItems(this._priceWindow._item);
    if (have === 0 || $gameSystem.allRewardsPicked(this._priceWindow._boardId))
    Scene_Base.prototype.popScene.call(this);
    else
    this._pickboardWindow.activate();
    };


    E.g.:

    [​IMG]
     
    #18
    gRaViJa likes this.
  19. gRaViJa

    gRaViJa Veteran Veteran

    Messages:
    732
    Likes Received:
    265
    Location:
    Belgium
    First Language:
    Dutch
    Gonna try it out right now. (Edit: it works, thank you for this)
     
    Last edited by a moderator: Mar 11, 2016
    #19
  20. SimProse

    SimProse Veteran Veteran

    Messages:
    319
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Am I strange, or does this no longer work with RPG MV 1.5.2? I get "Cannot set property '1' of undefined" when it starts up. I double-checked and everything seems fine with the formatting and all. The error seems to happen with the 'Pickboard Start' command based on the error console readout. Mine is 'Pickboard Start 1 5 5', which should work ok.
     
    #20

Share This Page