RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RM2K3/9U] CBS Speed Calc - Project Included (PLEASE HELP, OH GOSH)

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 68
RMRK Junior
Project: http://www.mediafire.com/?sf2sk51af52cbtz
Size: 2.5mb

I need a way to solve tiebreakers and return a series of 2-6 variables with differing values between 0 and 5. Need to be able to solve 2-way, 3-way, etc... up to 6-way tiebreakers. By "solve", I mean using the variable(random) function, adding on numbers so the returned set (say, 0,0,0,0,0,0) looks more like (0,1,2,3,4,5) or (5,3,4,2,0,1) and such.

The first map has the speed calculator on auto-start. In Common Events, the speed calculator is number 12. Comments are laden throughout. Someone, please help me.

Before I go insane in my main brain. And my secondary.

**
Rep:
Level 66
RPG2k3 Meowster
Project: http://www.mediafire.com/?sf2sk51af52cbtz
Size: 2.5mb

I need a way to solve tiebreakers and return a series of 2-6 variables with differing values between 0 and 5. Need to be able to solve 2-way, 3-way, etc... up to 6-way tiebreakers. By "solve", I mean using the variable(random) function, adding on numbers so the returned set (say, 0,0,0,0,0,0) looks more like (0,1,2,3,4,5) or (5,3,4,2,0,1) and such.

The first map has the speed calculator on auto-start. In Common Events, the speed calculator is number 12. Comments are laden throughout. Someone, please help me.

Before I go insane in my main brain. And my secondary.

I'm having a very hard time reading your coding. XD
I'm not sure exactly what you want, but if you want 6 different random numbers between 0-5 here ya go.
This probably isn't the best way but this should get that job done.

Code: [Select]
Variable Oper: [random number 0] Set Rnd [0-5]
Variable Oper: [random number 1] Set Rnd [0-5]
Variable Oper: [random number 2] Set Rnd [0-5]
Variable Oper: [random number 3] Set Rnd [0-5]
Variable Oper: [random number 4] Set Rnd [0-5]
Variable Oper: [random number 5] Set Rnd [0-5]
Loop:
  Branch if Var [random number 0] is V[random number 1] Equal
     Variable Oper: [random number 1] Set Rnd [0-5]

  Else Handler
     Break loop
  End

End Loop

Loop:
  Branch if Var [random number 0] is V[random number 2] Equal
     Variable Oper: [random number 2] Set Rnd [0-5]

  Else Handler
     Break loop
  End

End Loop

Loop:
  Branch if Var [random number 0] is V[random number 3] Equal
     Variable Oper: [random number 3] Set Rnd [0-5]

  Else Handler
     Break loop
  End

End Loop

Loop:
  Branch if Var [random number 0] is V[random number 4] Equal
     Variable Oper: [random number 4] Set Rnd [0-5]

  Else Handler
     Break loop
  End

End Loop

Loop:
  Branch if Var [random number 0] is V[random number 5] Equal
     Variable Oper: [random number 5] Set Rnd [0-5]

  Else Handler
     Break loop
  End

End Loop

Loop:
  Branch if Var [random number 0] is V[random number 6] Equal
     Variable Oper: [random number 6] Set Rnd [0-5]

  Else Handler
     Break loop
  End

End Loop

Repeat for all instances.....

**
Rep: +0/-0Level 68
RMRK Junior
Ah, yeah, it is pretty hard to understand. Basically the first loop does Battler1's SPD Vs Battler2's SPD, the second does Battler1 vs Battler3 (or Battler2 vs Battler1, if there's a two-battler limit), and so on.

Although fork conditions can't directly use [Value Stored in Index], you can fake it by loading said value into a pair of variables and comparin them. This allows for fluid and non-bloated code, since you only need one main compare command, all the other values will be calculated automatically by the loop.

For the draw thing... it's like this. Let's say two players in a two player battle tie on speed. That's 0,0. So the computer has to decide which one wins the tie, so it randomly picks one, and adds 1 to it.

Now, let's say there's a three-way tie. 0,0,0, or 1,1,1 or something. The computer has to randomly pick one to add 1 to, but also one to add 2 to, without being able to add both to the same number. The end result should be 2,1,0 or 0,2,1 or something. If it could add to the same number, the result could end up like 3,0,0... which apart from causing another draw, if there was a forth battler (3,0,0,0 would become 3,0,0,3 or something), also doesn't fix the problem. In fact, this is basically what it does already, with my current draw system.

Finally, let's say there was the maximum, a six-way tie. 0,0,0,0,0,0. Now 5 needs to be added to one of them, then 4, then 3, then 2, and finally 1, without being added to the same number.

And preferably, it'd do this in the same way as the speed engine itself, a fluid system that doesn't require loads of different fork conditions, since you'd need around 216 different forks to take into account every possible combination. Apart from feasible lag that could cause, it would also be beyond tedious to make.

Still, admittedly, it's not a priority. My game is a Pokémon sim, so 1vs1 is the default battle, and the current tiebreak system I have in place works fine for ties between two battlers (it just breaks on three or more). That's the routine at the end of the Speed code, by the by. The one that checks if VAR is equal to VAR, and then does a rand function.

Now, tell me where your brain gave up and died. Mine gave up a couple of days ago when I made this topic...

**
Rep:
Level 66
RPG2k3 Meowster
Still can't figure out a answer for you. I have been thinking about it. You might be stuck with having to use fork conditions. If worse comes to worse, you might be better off having a said Pokemon having a priority, like Pokemon 0 goes first if it's a tie every time over 1,2,3,4,5 if it's a tie. 1 going second over 2,3,4 and 5 and so on for a tie. May not be fair, but that is a fix for it.

Maybe you can check code for games with other custom based systems and see what they did. o-o;

**
Rep:
Level 66
RPG2k3 Meowster
Okay sorry for the double post, but I think I solved the answer.
Go to common events. Then Random numbers 2. There are I think... 15 conditional branches (least it's not.. 200 ish). There are no else statements in them. It's very easy to understand. There are also technically no loops. Also, there is room for improvement (I coulda did it better, I think I did some unnecessary stuff, but I'm too lazy to fix it).
6 random number's are generated, they will always be different. It's pretty much instant.
I hope this helps you. ^^;;;

http://www.mediafire.com/?1v5b49bjwhs14m6

What I would do is make a 2 (guess not needed), 3, 4, 5 and 6 version of this.
Call which one is needed for each type of tie. Shouldn't be too difficult and I don't think it'll cause lag cause a 6 way tie with this isn't big at all.
« Last Edit: September 03, 2011, 03:46:46 AM by RikaPSO »