Jump to content


Photo

Player Switch - Multiple players


  • This topic is locked This topic is locked
55 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 22 May 2012 - 09:38 PM

Player Switch
Author: Tsukihime

Posted Image

Overview

This script provides you the ability to switch players in-game.
Unlike adding/removing party members to give the illusion that you're working with different people, this script allows you to create completely separate players that have nothing to do with each other.

All inventories are separate from each other (until I implement shared inventory), they have their own parties, possibly even their own HUD's.

Features
  • Real-time player switching
  • Other players are drawn on the map where you left them
  • Idle players move around randomly
  • Can set up players to say random things
  • Check whether any player is at an event position, or whether a specific player is at an event position.

Usage

By default, you have one player: you.
You begin by creating a new player, giving an actor ID as the party leader for that player

$game_players.create_player(2)

You can also choose some custom start position (map Id, x, y) by specifying them when creating the player

$game_players.create_player(2, 1, 5, 6)

This means you want the player initialized with actor 2 to be placed at map 1 at position (x=5,y=6)

Once your player is created, the script will set up all of your party information and your actor information for your new player.

Now on the game map, when you press the A key (in-game "X"), it will open the player-switch menu where you can switch players

Your other players on the same map will randomly move around and you can even talk to them!

Posted Image

The script also supports managing multiple players when it comes to eventing.

Spoiler


You also have the option of using moghunter's character select scene for the player switching.

Posted Image

You'll need to download a modified char select script as well as placing the resources inside the Graphics/System folder.

The actor pictures should be placed in the Pictures folder, using the following filename format

<FACE_NAME>-<FACE_INDEX + 1>

For example

"Actor4-1"
"Monster2-2"

It relies on the face pictures, which I think makes sense because if you don't have a face picture, what's the point in having a portrait?

Note that ruby is 0-indexed, so the first face is index 0, so I just increased it by 1.

Download

Script: http://db.tt/WpTtP2yA

Modified moghunter's character select: http://db.tt/D6gYYMVF
Resources for the character select scene: http://db.tt/k7zRv7Wl

Notes

This script provides the basic functionality for player-switching.
I am aiming for full switching functionality where all of the other players are treated as events and you can talk to them and stuff.

I would like to create puzzles where you have to control multiple players. For example, maybe you need to step on two buttons at the same time, but this clearly isn't possible with only one player. The solution would be to switch players and coordinate them together. However, that will have to wait until I work out the details.

Edited by Tsukihime, 12 August 2012 - 02:08 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#2 Novem

Novem

    Author

  • + Sponsor
  • 2,679 posts
  • LocationTonawanda, New York
  • RM Skill - Writer

Posted 23 May 2012 - 10:28 AM

This is brilliant! I don't think I've ever seen anything like this Tsukihime! Nice work.
Hey there. I'm Novem, author and a long time veteran of this community (previous known under names such as Nine or Obrusnine). 
 
If you're interested in my books, you can find them on amazon in the links in this spoiler.
 

 
Quotes:
Spoiler


uUftBOz.png

#3 Wendell

Wendell

    The Persona Lover

  • Ace Member
  • 507 posts
  • RM Skill - Eventer

Posted 23 May 2012 - 01:16 PM

Amazing, I've never seen anything like this before. Imagine which type of puzzles you can do with this.

zexeriA.png


#4 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 23 May 2012 - 02:21 PM

I've set it up so that if there are only two players in the game, then pressing the player-switch button will immediately switch to the other player.

This allows you to develop fast-paced puzzles where you need to be able to coordinate players quickly and accurately. Like maybe when you push a button, a door opens for 5 seconds and you need to get the other player through.

I'm thinking of binding the 1,2,3,4,5 keys to each player as well, but not sure.

I'm currently looking into ways to "un-group" and "re-group" actors into separate players and back into a single player. When you talk to one of your other members, they will ask whether you want to "join up" or something.

You should also be able to disable certain players from being selected, for example if they are unavailable in the story.

Also, two new features available for events.
These are meant for event conditional branches.

1: check for players at position

If you want to check whether there are any players at the event's position, you can write

any_players_here?

This allows you say, have one player stand on a button to keep a door open, switch to another player, and then walk through the door before it closes.

Posted Image

2: check for specific player's position

Maybe that button can only be pressed by a specific player.
You would write

player_here?(player_id)

The condition is only satisfied when the specific player is standing at the current event's position.

Edited by Tsukihime, 23 May 2012 - 02:50 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#5 Sly

Sly

    Advanced Member

  • Ace Member
  • 128 posts
  • LocationChicago
  • RM Skill - Writer

Posted 25 May 2012 - 02:16 PM

I was going to do this using events. I wonder if the script will be easier?
Good work.

#6 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 25 May 2012 - 02:49 PM

I think an evented solution to replicate the "any player here?" functionality would be a little messy because it's basically activating a switch when you stand on the button, and then turning it off when you move away from the tile ONLY if you move away through normal walking means...not actor switching or anything.

This script also seems to be unsafe. I have experienced crashing and not sure if it's because my computer sucks or the script is doing bad things. I really should let the interpreter handle the switching.

Edited by Tsukihime, 25 May 2012 - 02:50 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#7 Maus Merryjest

Maus Merryjest

    Magister Contrapunctis

  • Ace Member
  • 138 posts
  • RM Skill - Jack of All Trades

Posted 19 June 2012 - 12:19 PM

This is a brilliant script, Tsukihime. Is there any chance there could be an offshoot of it for different party groups? Instead of multiple individual players, the gamer could switch between, say, parties A, B and C which already have a pre-determined number of members?
Posted Image

#8 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 19 June 2012 - 12:49 PM

Not for this script, since it is completely separating players and storing all of the players' information in each player object (eg: what party they control)

Here is one of the first scripts I wrote: http://www.rpgmakerv...agement-script/
But I pretty much abandoned it.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#9 Novem

Novem

    Author

  • + Sponsor
  • 2,679 posts
  • LocationTonawanda, New York
  • RM Skill - Writer

Posted 08 August 2012 - 02:43 AM

I was wondering, is it possible to disable random movement by inactive players? The puzzle I'm planning is all about positioning, and if they are moving it eliminates the point. I haven't actually used the script yet, so maybe it's already in there. I was just wondering pre-download.
Hey there. I'm Novem, author and a long time veteran of this community (previous known under names such as Nine or Obrusnine). 
 
If you're interested in my books, you can find them on amazon in the links in this spoiler.
 

 
Quotes:
Spoiler


uUftBOz.png

#10 Xypher

Xypher

    Advanced Member

  • Ace Member
  • 946 posts
  • RM Skill - Jack of All Trades

Posted 08 August 2012 - 03:28 AM

There's a setting in the module to turn off idle wandering

#11 Novem

Novem

    Author

  • + Sponsor
  • 2,679 posts
  • LocationTonawanda, New York
  • RM Skill - Writer

Posted 08 August 2012 - 03:32 AM

Gotcha, thanks Xypher!
Hey there. I'm Novem, author and a long time veteran of this community (previous known under names such as Nine or Obrusnine). 
 
If you're interested in my books, you can find them on amazon in the links in this spoiler.
 

 
Quotes:
Spoiler


uUftBOz.png

#12 MizukiH

MizukiH

    Newbie

  • Ace Member
  • 4 posts

Posted 09 August 2012 - 01:29 PM

I'm not really aware of using scripts... do you simply add the script into the script editor, under materials...and then you do the call? (also the call means adding "$game_players.create_player(2)" into the "script" within events...? )...and if i just said is correct and that is all you must do ...i get an error saying something about the game_interpreter...saying there's an error, "that i cannot add a new key into hash during iteration". Maybe i'm missing something? Or a lot of "somethings" xD...... please enlighten me if you may ^u^? if not... ok :< :3

#13 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 09 August 2012 - 02:05 PM

Yes, that's all you do.

I've seen that error before but not sure why it would occur when you're creating a new player. Do you have parallel events running in the background? What scripts are you using.

Edited by Tsukihime, 09 August 2012 - 02:07 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#14 MizukiH

MizukiH

    Newbie

  • Ace Member
  • 4 posts

Posted 09 August 2012 - 05:13 PM

...actually ...the event itself was on parallel event ;-;...>u<'...didn't know that shouldn't be there >u>'' ...but THANK YOU VERY MUCH ^u^. It works now :3...though i have to "talk to the event" to make it occur, is there any way to make it start at the beginning?(since autorun and parallel process are a no) and again thank you, also an awesome script :3. I might use it when i learn some more about rpg maker, and actually make a game, if that is ok ^u^...of course will give credits :3. Again awesome job :3, will check more of your scripts :D

#15 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 09 August 2012 - 05:27 PM

Just turn on a self-switch after you create the players, create a new page with no commands but require self-switch to be turned on.

Edited by Tsukihime, 09 August 2012 - 05:28 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#16 MizukiH

MizukiH

    Newbie

  • Ace Member
  • 4 posts

Posted 09 August 2012 - 05:52 PM

Thank you, solved that :3...and hopefully last question. The players do not appear on screen until i click the "A" button, then all three are on screen. Is it supposed to be that way? ^^

#17 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 09 August 2012 - 06:10 PM

Fixed the bug. I commented out some code that refreshed the map for some reason but I don't remember why.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#18 MizukiH

MizukiH

    Newbie

  • Ace Member
  • 4 posts

Posted 10 August 2012 - 05:26 AM

works perfectly now, thank you ^^, stay awesome : D

#19 Dark Messiah

Dark Messiah

    Rude Dude

  • Ace Member
  • 32 posts
  • LocationOhio
  • RM Skill - Writer

Posted 10 August 2012 - 03:28 PM

I've seen this before in a PS2 game called Obscure 2, and I thought it was pretty awesome. Especially when each party member had their own special traits that you could utilize for the puzzle. I don't have much use for this in my current project, but I will say I think this is an excellent concept.
Posted Image

#20 Elise-chan

Elise-chan

    Hello^_^

  • Ace Member
  • 62 posts
  • LocationTokyo, Taitō
  • RM Skill - Writer

Posted 11 August 2012 - 08:46 AM

Brilliant script, gives me the tool to make the puzzles I always wanted(^;_;^)
Will try this out ASAP when I get homeOwO
Currently Working on:

Rebirth Fantasy
Alice




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users