Help - Search - Members - Calendar
Full Version: Player-switching in real time
RPG RPG Revolution Forums > Scripting > Script Development and Support > Script Requests
Tsukihime
Suppose you have two heroes in your game.
Each hero comes with their own unique skill on the map.

One hero specializes in pushing boulders around
The other hero specializes in pulling levers.

For reasons unknown, the boulder-pushing hero breaks levers quickly so he cannot pull levers.
Similarly, the lever-puller is not fit enough to push boulders.

Now you are in a dungeon where you need to push boulders and pull levers in order to proceed.
Both heroes must work together in order to complete the task.



The dungeon is split into two branches, and each branch comes with a set of obstacles that only the specific hero can overcome.
However, as you go deeper into the dungeon, things become trickier. Obstacles in one branch can only be cleared in the other branch, and some of them are timed as well. For example, pulling a level brings down a bridge, but only for a couple seconds before the bridge goes back up.

So you need to be able to switch control between the two heroes as you proceed through the dungeon.
How would you even begin to try to solve this problem?
Pharonix
QUOTE (Tsukihime @ Apr 25 2012, 10:53 PM) *
Suppose you have two heroes in your game.
Each hero comes with their own unique skill on the map.

One hero specializes in pushing boulders around
The other hero specializes in pulling levers.

For reasons unknown, the boulder-pushing hero breaks levers quickly so he cannot pull levers.
Similarly, the lever-puller is not fit enough to push boulders.

Now you are in a dungeon where you need to push boulders and pull levers in order to proceed.
Both heroes must work together in order to complete the task.



The dungeon is split into two branches, and each branch comes with a set of obstacles that only the specific hero can overcome.
However, as you go deeper into the dungeon, things become trickier. Obstacles in one branch can only be cleared in the other branch, and some of them are timed as well. For example, pulling a level brings down a bridge, but only for a couple seconds before the bridge goes back up.

So you need to be able to switch control between the two heroes as you proceed through the dungeon.
How would you even begin to try to solve this problem?


I wanted to do this in VX but it was impossible.

I'm guessing you have x players at the time so here's what you do.

Make a note of which players are in which party, THIS WILL HAVE TO BE SET UP BY YOU. Choosing party members here would be much
more difficult

now you need a parallel or common event

Here's what you do.
You set aside button [button of choice] for the switch.
Then if button[] is pressed.
check who the party consists of.
if boulder man is in party.
perform all the necessary swaps to the second party.
and if lever girl is in party
perform all necessary swaps to the first party.
You will also need 4 variables. - two to 'remember' the x and y of the first party.
and two to remember the x and y of party 2.


I don't think this needs a script.
If you want I can try to event this out for you.

EDIT: Here you go.
It works. Just look through and see what it does.
Hope it helps.

http://www.mediafire.com/?i0y1cvo5y2def0p
Not stated in demo but you need to set up the second ally's position first. otherwise it's not gonna work and you're
going to end up at position 0,0 after the switch.
Tsukihime
Someone on RMVXA forum actually posted an event solution where you store the coords of the "inactive" player and then just transfer back and forth, replacing character as necessary.

But ya, I posted this up just to see what kind of things people have already tried.

Essentially, I am going to be extending the $game_player and $game_party to include a set of players and parties (conveniently called $game_players and $game_parties)

Then I can keep track of separate instances of player and re-assign it back and forth.

I've managed to switch between muiltiple parties across different maps (eg: switch party --> transfer to party location), so it is likely the same idea with player objects.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.