Tutorials :: 2 Player System in rm2k(3) :: Ultima Island: A friendly online community focusing on game development. Games, Tutorials, Resources, Articles, and much much more...

Welcome Guest [Submit Content] [Log In][Register]
Working on a game project? Why not sign up and start your own upcoming project site for free!
Tutorials :: 2 Player System in rm2k(3)
2 Player System in rm2k(3)
9 Comments, 2553 Views
 rating: (32 votes)
2 Player System in rm2k(3)

This Tutorial is designed to let you know how to make a game that features 2 players in rpg maker 2003.

For this Tutorial, you may need:

  • - Some Knowledge of Switches
  • - Some Knowledge of Variables
  • - Some Knowledge of Fork Conditions
  • - Some Knowledge of Move Events
  • - Some Knowledge of Loops or Parrallel Process Events


This tutorial will just tell you how to make a 2Player system on one map only. From here you should be able to pick up everything that's been done (it's all explained) and transfer the system onto any map that you want.

Okay, the first thing we need to do is make our blank map. Make it the default 20x15 tiles in size. The chipset isnt important - just make a blank grassy map and add a couple of walls/obstacles.

Now you make the player 2 character. For this tutorial make an event called "chara2" on your map, and set its graphic to the character set of your player 2 character. It can be anything, a village man will do. For the events conditions, set it to Action Key, Same Layer As Hero.

Next, we need to set up the controls. Rm2k3 uses the arrow keys as the default movement buttons for the hero, and there's no way of changing this. Player 1 is going to be the hero anyway, so we don't want to change it. For player 2 it would be good in theory to use the arrows on the numpad, but we can't since these arrows are also used to control the hero (player 1). Instead we will use the set of keys in the upper-right corner of the numpad: / * - 9.

  • / = Move Left
  • * = Move Up
  • - = Move Right
  • 9 = Move Down


To go about setting up the controls, make a common event in the database and call it something along the lines of "P2 Controls". It needs to be a parrallel process event, and there is just one command in this event - an Enter Password command. In the possible ticked boxes you should tick the number 0-9 keys and the symbol keys at the bottom, but make sure that the other options are all left unchecked. At the top where it says "change received keycode" (or some other rough translation) select a new variable, and call this variable "P2 Buttons".



You can also make use of the wait 0.0 seconds trick in this event if you wish, but I personally don't. This trick is great, however, if your 2-Player system is lagging at all. All you have to do is put a wait command in the event:

[Code]:
wait (0.0secs)


You have just created the first common event, which is used to collect your instructions. All this event does is watch out for any key presses and, when it notices that a key has been pressed, changes the value of our "P2 Buttons" variable. Next we need to make an event to read this variable and act on its value.

Okay, now, make a new common event and, again, set it to a parrallel process. Call this event "P2 Movement". This event is going to use quite a few forks, so get ready for it. Here's the hard part.

First of all is put a wait 0.0 second command in there. The purpose of this is to prevent lag, as mentioned earlier in the tutorial.

Now put in a Fork Condition to check the value of the "P2 Buttons" variable. First lets check if it's value is 19, and be sure to include an case. If it is 19, the player must have pressed 9 on the numpad, hence want to move down. So as the instructions in the fork put Move Event, and move the event "chara2" down one square. When putting in the command for the character movement, be sure to tick the box that says "Ignore Impossible Moves", this is to prevent player 2 from walking through walls and such things. And that's the principal! Repeat the fork for the different directions, taking into account that the value of "P2 Control" has to be different. Also, put a wait 0.1seconds command after each move event.



Notes: Since these events are common events, you have to keep some constants. If you want this 2 player system to work on more than one map, you'll have to ensure that "chara2" has the same event ID on every single map or else you will get unwanted movement from other events. I hope this tutorial helps!
submitted by Seraph
You are not permitted to rate tutorials...
 
Latest Comments
Carius (Offline)
Not any more Heya!
Seraph (Offline)
Cocky. This one is still 5 stars Heya!
eric12321 (Offline)
Good tut
El_Dorado (Offline)
FOCKING AWESOME!!!

If I make a Two Player RPG because of this, be proud of yourself.

Hell yeah.
voodooKobra (Offline)
Sweet.
kid27 (Offline)
This is an extremely good tutorial, but I think it's being slightly over-rated. It's a fairly clever idea, but I reckon most intermediate RM2k/3 users (including me Grinning) could've thought of this eventually. Also; /, *, - and 9 are rather messy to use as arrow keys mainly because of the way they are layed out next to each-other - the normal arrow keys are layed out with three at the bottom and one at the top.

Sorry if I'm being negative, it's just that this tutorial seemed to be rated a bit too perfectly. Nonetheless...
4 stars!

PS: There's an RM2k package somewhere that some German dude made that contains LOADS of cool things (including a platformer system and a point-and-click system [YES! It works!]), one of them being a 2-player mini-game. He uses some kind of system where you can set any key on the keyboard to do something... Shock
SuperSaiyanSonix (Offline)
Freaking sweet.
Wish that could have 2-P battle system too.
That would be awesome.
Indra Kurniawan (Offline)
Awesome!,
but i have pact key for RM2k(3)
Quick User Panel
Username:

Password:

Welcome Guest, please login or register

Change Style:
Shout Box
Gretgor says:
You did it wrong, man. Anyways, you turned a frog into a screwdriver.
dragoniqbal says:
LOLZ! I tried.. Ayy Gretgor, i can turn a frog into a
Gretgor says:
MAY A NEW WORLD OF GAMING BE BORN FROM THE ASHES OF... UHHH.... Someone finish this sentence for me, thanks.
Lemon_EX says:
Sorry, wrong web site.
Gretgor says:
Well, fix that, then.
Miscellaneous

Donate

RSS Feed

Play-Asia.com - Buy Video Games for Consoles and PC - From Japan, Korea and other Regions!