I mean...it's cool, but if you have no way of telling who won and who lost and rewarding them, sorta loses a bit of the point, eh? Is there a quick way to at least store something in a variable if the player wins?
Wuxing Minigame
● ARCHIVED · READ-ONLY
-
-
@SimProse Since the player is allowed to play again if they want to (rather than the minigame closing out) I thought it'd be kinda pointless to keep track of winning or losing. If you want to do it though you can.
Either add 1 to a variable or switch in these lines (~887)
Code:if (this._shouldProcessEnd) { var score = this._matchHistory.getScore(); var c = score[1], p = score[0]; if (p > c) { //player wins //$gameSwitches.setValue(ID, true/false); //$gameVariables.setValue(ID, value); this._log.setText(victoryText[0], victoryText[1]); } else if (p < c) { //player loses //$gameSwitches.setValue(ID, true/false); //$gameVariables.setValue(ID, value); this._log.setText(lossText[0], lossText[1]); } else { //player ties //$gameSwitches.setValue(ID, true/false); //$gameVariables.setValue(ID, value); this._log.setText(tieText[0], tieText[1]); } this._replayCmd.open(); this._replayCmd.activate(); this._shouldProcessEnd = false; } -
Thank you, Mjshi!
So, I made my attempt at:
if (this._shouldProcessEnd) {
var score = this._matchHistory.getScore();
var c = score[1], p = score[0];
if (p > c) {
//player wins
//$gameSwitches.setValue(ID, true/false);
//$gameVariables.setValue(12, $gameVariables.value(12)+1);
this._log.setText(victoryText[0], victoryText[1]);
} else if (p < c) {
//player loses
//$gameSwitches.setValue(ID, true/false);
//$gameVariables.setValue(ID, value);
this._log.setText(lossText[0], lossText[1]);
} else {
//player ties
//$gameSwitches.setValue(ID, true/false);
//$gameVariables.setValue(ID, value);
this._log.setText(tieText[0], tieText[1]);
}
this._replayCmd.open();
this._replayCmd.activate();
this._shouldProcessEnd = false;
And I'm not good at code... so needless to say, it didn't work. -
@IssaMeMino No, you're right!
You see the "//"? Those are "comments". So you need to uncomment them by removing the // in front of the lines you changed, otherwise, the code won't even run. -
Oh! Thank you so much! Is it okay if the rest of the (ID, value) are left blank? Sorry for holding my hand through this- I'm not code savvy.
-
@IssaMeMino It's alright, don't worry xD
Yeah, you can actually delete the rest of those commented lines. You don't really need them, they don't really do anything. -
@mjshi Thanks!
So I think I might swap that variable code to have the player receive a token with $game_party.gain_item($data_items[id], amount).
Now I just need to figure out how to make playing cost one ticket and keep them from playing if they don't have one. I'm making a speakeasy style tavern in my game with your match card lottery, wuxing and Galv's spinning wheel.
But, that's something to figure out in the morning!
Update: I've got it altered so the game gives the player a token if they win! I can't seem to find script that just closes the game or find where it's located in the plugin file. -
Works great, thanks!
-
@SimProse You're welcome ^^
@IssaMeMino The start/quit game things are here:
Start game
Scene_WuxingMG.prototype.initVariables = function() {
this._currentRound = 1;
this._totalRounds = WuxingMG.rounds;
this._shouldProcessResults = false;
this._shouldProcessEnd = false;
(... you get the point xD)
Quit game
Scene_WuxingMG.prototype.cancelCommand = function() {
//add stuff here
this.popScene();
};
Also, here, if you add a condition to check:
Window_WXCommand.prototype.makeCommandList = function () {
this.addCommand(replayText.again, 'ok', condition);
this.addCommand(replayText.quit, 'cancel');
};
The ok command will only be enabled if that condition is true (ex. # of tokens in inventory is > 0). -
Thank you so much! I'll take a stab at it tomorrow - my fragile newbie skills might take some time. Your mini-game plugins are fantastic. I'm making some custom art (for the mini game) for my game and I'll be sure to post a preview when I have it all finished up.
You know what game is still missing? Dice. *wink wink* -
good job!!! is there a prize system ???:wink:
-
@Lionheart_84 No, but you could implement something based on these replies I made:
https://forums.rpgmakerweb.com/index.php?threads/wuxing-minigame.77758/page-2#post-785373
https://forums.rpgmakerweb.com/index.php?threads/wuxing-minigame.77758/page-2#post-786342 -
Hi Mjshi, thanks for a really good plugin. Very well made and extremely easy to install.
For those who are asking how to build rewards into the system:
You can easily just add the variables as Mjishi suggested earlier in the threat. This will allow you to make a "points" or a "coin" variable which the Wuxing game can control. This can be the same unit of credit you use inside your casino or whatever you are building. This works great if you want to incorporate several different mini games.
You can also connect this variable directly to your characters wallet/gold. This is easily done under events. See example in this photo:
This way the character can only start the game if he has enough money to play. I had set the minimum bet to 5 gold (the same amount I had instructed the variable in the plugin to deduct from my gold in case I lost the game). If the came is won it will add 5 gold to my wallet. -
-
@B34RxJ3W I'll be available the 21st of May, but you shouldn't post commission request stuff here on a plugin thread. PM me?
-
Hi mjshi! I love your plugins! This wuxing one will actually play really well into my game as I am implementing this elemental structure. But I was wondering, how can I change the script so that the game doesn't ask if you want to replay? If I can't, that's OK. Thanks!! And you're awesome!
-
@Galaxyglow Hey, glad you liked the plugin!
Short answer: yes, go ahead!
Long(er) answer--
My terms on my site/GitHub state that
You are free to use, modify and redistribute my resources wherever and for whatever you please so long as you credit me (mjshi) as the original author. -
plugin mouse in video ?
-
@TenTranVN Correct me if I'm not understanding you correctly, but no, the plugin doesn't include the mouse that's in the video xD
-
Hey @mjshi ! Is there a way to limit the elements to be just 3 elements? Permanently. There is an option to choose how many you start with, which makes the rest of the elements greyed out. I want it to be literally more like ROCK, PAPER, SCISSORS, if its possible?