Arena Betting Event

I've officially bogged myself down trying to figure this one out. I'm trying to event an arena betting side-game in which the player character can bet on other gladiator matches while he, himself, is not fighting, while simultaneously learning more about the fighting styles of the other gladiator to his advantage. What I'd like to do is choose a fighter from the upcoming featured fight to bet on, place any bet I choose up to the amount of gold carried, and then actually force the battle to happen between the two with a random outcome, like an auto-battle the player can watch, and receive gold or not based on the results.

I understand the betting mechanics so far as using a variable to equal the game data gold, and I kind of understand how to pay out odds. What I don't know how to do is make a bet on a specific fighter, then have the fight play out, then get paid.

I think I'm just overwhelmed, and can't seem to separate the pieces enough to go step by step. Can anyone make sense of it for me?

I'll try to post some screens once I get htings moving along, but right now my brain is in a knot.
I think you'd need a plugin to do this. For the auto battle bit I can't think of anything that'd let you in the base program.

Eventwise, I'd set up some betting tiers (i.e. a 50 gold bid, a 500 gold bid, and 1000 gold bid), it might be easier from here to let the plugin work take over from there, call like "Scene_Betting" or something after submitting a bet tier, have the plugin pick some enemies in a set list that you specify in notetags as gladiators and for each one generate a random opponent, have some kinda power level notetag for the enemies and have the plugin generate the odds based on that, call on the special battle scene(there's no way the plugin maker doesn't have a lot of work here lol.) have the NPC's fight, save the result, compare it to the bet of the player and payout (or don't) and then maybe a script call form there for like a "Congrats!" text or a "Better luck next time, kid" depending on the outcome. It's a great idea but yeah, there's no way you can do that without a specially made plugin
I myself would do this by setting the odds for the bet, then rolling a random number. If the random number is above x value (x is what you set based on the odds), then you win. Else, you lose. Only problem is, you can't see the fight this way.

I do agree it will probably take a plug-in to watch the battle between both as an auto-battle. However, maybe you could transfer the player to an arena screen where the battle plays out on the map instead? After all, you can show animations on the map via a command. You'd just have to manually keep track of HP of each battler, as well as a lot of if/else conditions to do the AI (if one is desired).
Ugh, I can't find anything that does what I want. That's okay, though, I'll do it without the visual arena battle. Instead, I'm trying to use common events for the arena betting mechanic. I'm still stuck on a couple of things.

I have the fights basically randomized within the variable for Arena Fight. 1 is if fighter 1 wins, 2 is if fighter 2 wins. How do I reflect the player's choice within the result, though? And how can i have the fighter names show up in the common event instead of fighter 1/fighter 2? (To be more specific, can I use one common event for all of the fighters, and just have something overwrite the fighter 1/fighter 2 with a specified variable. Say "Brondo (fighter 1)VS Kelvin(fighter 2)" is fight 1 and "Melbor(fighter 1) VS Pantaloons(fighter 2)" is fight 2, is there a way to store the names in the common event properly without making a different event for each fight, and have it show in a text box as the announced winner?)

Who do you want to bet on?
Fighter 1
Fighter 2

How much do you want to bet?
player input

THEN, how do I pay out appropriately? Do I just use a ton of if/else branches?
Okay, so I've got it working, albeit in an extremely simplified manner. Here's what I did:

Spoiler
lpXWwQ.png
yb5VdU.png
6baAdA.png
c9DJp5.png

If anyone has a better way of doing what I need, please let me know, as this is super generic and kind of silly, in my opinion. Please keep this thread open for future options, mods. thanks.
This is quick and dirty but it works and allows you to have the autobattle, note it requires you to make stats identical actors for each arena fighter with the autobattle flag on so a plugin will still probably work better but I remember doing something like this before.

Spoiler
arenatest1.png
arenatest2.png
Basically whatever fighter the player picks to bet on is selected as an actor doppleganger with autobattle on, that way it's easily distinguishable whether they won or lost the bet based on the "If Win/If Lose" conditional under the battle processing. The opponent is selected as a random variable between the remaining ones, requiring you to change up the events slightly for each iteration so that the player's champ is no longer in the roster of opponents. I forgot to do it but obviously make sure you reset all the variables to 0 at the end where the player's party is added back and the doppleenemy is removed to prevent screwy things like cumulative bets/losses but other than that it's just setting the same scenario up for each fighter until you've covered all bets.

It'll certainly work better in conjunction with plugins that make the autobattle smarter like Yanfly's A.I. core but the fighting itself can absolutely be evented. Let me know if you have any questions or if there is anything I missed that you're trying to do, I sort of ran out of time in the middle of trying to work it all out but will be more than happy to get back to you later this evening if you still have any problems to sort through.
@Alexander Amnell I'll give this a try tomorrow to see if I can get the hang of it. I was at the doctors and sleeping through most of today. Thanks for the tips!
I'm trying to do something similar but for a horse race, and thinking i could play a movie of a horse race and then the results show, I just dont know how I'd name the horse or if I just go by Jockey 1, Jockey 2, Jockey 3, ect. It'd be hard to have a lot of different horse names, and randomize it without a plugin i think

@denny400 , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Please make a new thread with your problem.

Original thread: https://forums.rpgmakerweb.com/threads/arena-betting-event.74845/