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.
Tournament System

0 Members and 1 Guest are viewing this topic.

Level 88
Ladies and gentlemen. Let me present...
   The tournament. *dramatic music*
   This is an elaborate system of switches and variables that simulates a real-world tournament, with many characters duking it out, you among them. Please note that this is a moderately advanced piece of eventwork, and beginners are suggested to learn about variables, switches, common events and the like before trying to understand this.
   Some background information first. For the purpose of this tuorial, I shall make this a Monsters-only tournament, since monster troops and enemies come predefined in the RTP. (The main character is a Daemon named Bob.) However, I insist that you make full-out human characters from scratch and use them in your tournaments, as what I'm doing is lazy. All I've done is turned the single actor into a demon and given it demon moves. Also, if you see any bugs in here, fix them yourself, please. I fixed all the bugs in the game itself, but I took screenshots of the bugged version, before I fixed them.
   All right. First, start off by making a few maps for the tournament to happen in. I made a reception room, waiting room and a tournament room, respectively (excuse my mapping, BTW):
   If you're wondering, the dragon thingy in the tournament room is the commentator.
   Now, the way the tournament will work is this. Out of six competitors, three will be chosen to participate, and you will be the fourth. You will battle with one NPC, and the other two NPCs will battle with each other. Note that the NPCs won't have a full-out batte, the winner will be calculated based on probability. The victors out of those two matches will battle each other, and that victor will be the final winner. You can make this more elaborate and have many competitors with many rounds, but I'll keep it simple for this tutorial.
 First, we need to make the events that select the three NPC participants. Thus, set up an event like so.
 This event should have no trigger, but you can name it as you like as long as you know what it does.
 Let me explain this here. There are three positions in the first round of the tournament I've made, Vs. Player, Vs. NPC, and Vs. NPC 2. These positions are registered in the game as variables. The value of the variable determines the participant in the position that the variable represents. So, for example, if variable Vs. Player is set to 2, the participant battling with the player will be a Sahagin, since I'll program the game to recognize number two as the ID of a Sahagin. Likewise, if Vs. NPC and Vs. NPC 2 are both set to 0, the participants battling with each other in Round 1 willl be Ghosts.
 What this Common Event essentially does is randomly select the participant who'll battle with the player. If you're still reading this, you should be smart enough to figure out how it does that. After it's done, it calls the second Common Event, which calls the third Common Event in turn.
 The other two Common Events are exactly like the first Common Event, except they work with different variables. I'll still post pictures of them.
 Now that this little building block is assembled, we could make an event that implements this in the game, but I'll leave that for later. We still have other building blocks to make.
 Now we deal with making the NPCs battle with each other. As I said before, this uses probability to emulate a real battle; since I know nothing about scripting, I can't actually make them battle against each other. Thus, the events are like so:
 In the part that's too wide to fit in the screen in 2 and 3, the variable is a random number between 0 and 23.
 Every possible participant has a random number associated to it. The stronger the participant, the more the range of that number and the higher the possibilities. When a strong particpant is pitted against a weaker one, the stronger usually prevails, but there is a chance that the weaker one goes against all odds. Thus, I've simulated something like that. The winner of the emulated battle is the one with the higher number. While, say, a Sahagin (with an ID of 2) will usually have a very high number, much higher than the highest possible number of, say, a Ghost, there is a possibility that it gets a number that is one or lesser. In that case, the Ghost might go against all odds and have a higher number than the Sahagin, i. e., 2. If you're smart enough, you'll understand how the events work now.
 Now for assembling all of this in the game. Hoo, boy. If you thought that was long and complex, wait until we present this data in a player-friendly manner.
 We should fix up the reception counter first; it's small and easy. Select the imp behind the counter in the reception room (or whatever it is in your game) and feed something like the following into it.
 As you can see, it asks you if you want to join, and if you do, it starts up the first Common Event we made. This Common Event automatically calls the other two in order if you did it correctly, so this is all you need to do. Lastly, the imp transfers you to the waiting room.
 Here come the big parts. The goblin in the waiting room/whatever the hell you made it should be edited accordingly:
 The first part is self-explanatory; let me explain starting from the option [Tell me about the battlers.]
 The current round is stored in the form of a switch because there are only two rounds anyway. When this switch is off, it's round one; when it's on, it's round 2. Therefore, in the event, if it's round one, the goblin tells the player about the NPC battling the player and the two other NPCs battling each other. In round two, the goblin tells you the "winner of the last round, and (the player's) next opponent," which are both, of course, the same participant. With a little effort, you should be able to get how it works.
 If you choose, "Start the battle," the goblin transfers you to the tournament room, and when you choose "Leave me alone," it, of course, leaves you alone.

Now to the tournament room. Select the commmentator and give this to it. Also, make a blank event, no graphics, no commands, in the spot opposite to where the player is standing. You can make an audience out of events, too, but I'm not worrying about the details here.

First, I tell it what to do if it's Round 2, or if the Round switch is ON. There are many alternatives on that, depending on the nature of the player's opponent, but the basic skeleton is this: The commentator introduces the player, and tells the opponent to come onto the stage. Then it changes the graphic of the blank event according to the winner of the emulated battle we made before, and gives it a corresponding fancy animation, so that it looks like the opponent just recently teleported onto the stage. Then it processes a battle against the opponent chosen, and lastly sets all the switches and variables to the default zero, transferring the player back to the reception room.

If it's Round 1, the commentator introduces the player and opponent as before, except this time it is introducing the participant chosen to battle the player in the first round, not the winner of the emulated battle that is allegedly going on while the player battles. Then, after the battle, it calls the three events that emulate the other battle going on, and lastly teleports the player back to the waiting room. And we're done with our tournament!

Please note that, though this tutorial may seem restricting, elaboration, improvement, condensation, editing and the like are strongly recommended. I didn't give a glance to the finer details of this tournament, mainly because my focus was in the system itself, not the added bells and whistles. Thus, I urge you to make your own creative editions of this and come up with something much more brilliant than this.

Well, I hope this tutorial was interesting. If you want to check out the game itself, here is the download.

Ancient Mummy
Level 90

Anyways VERY NICE !!!!!

Level 88
I'm not sure how to make them bigger, actually. I believe imageshack or the forum sized it down for some reason. Still, the quality if fine; if your browser has a zoom feature, you can see it fine.

pokeball :)OfflineMale
Level 95
right click, view image, zoom
Watch out for: HaloOfTheSun