VX Ace Save Event Location between maps

CodeHunterEx

Hunter of the Perfect Code
Veteran
Joined
Nov 26, 2016
Messages
133
Reaction score
64
First Language
English
Primarily Uses
RMVXA
Here is the idea:
When the game starts, it randomly places 3 animals (chosen at random) on the screen at random locations. The locations are chosen so that none of them can bump into the other.

As the intro plays the animals are walking around the pen.

I would like to get the location of the animals before the player is transfered from the intro map to the game map.

You can get what the effect will be. The lower area changes, but the pen and animals don't.

Is this possible?
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
You can always take a xposition and y postiin and use move events that target them to place them at the right place I suppose.

But you can also use a plugin to actually spawn events, being set to a dummy map.
I think Shaz made it.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
What are you doing with the positions after you obtain them? I don't understand what your "You can get what the effect will be. The lower area changes, but the pen and animals don't" means. How are you achieving that?

I don't think either my event clone or save event position scripts will help here, and I kind of think you are going to another map and want to place events on that map based on where they are on the current one. If that's the case, I'd just use two variables for the X and Y positions of each animal (6 variables in total), and before you transfer from the map, set the variables (using Control Variables > Game Data > Character [Event #]'s Map X/Y), and as soon as you transfer to the new map, use Set Event Location for each event, getting the X and Y locations from the variables.
 

CodeHunterEx

Hunter of the Perfect Code
Veteran
Joined
Nov 26, 2016
Messages
133
Reaction score
64
First Language
English
Primarily Uses
RMVXA
Lets see if this helps:

Before.png

Here are the animals positions before the player transfers from the starting map to the game map. When the player transfers I would like the animals in those same positions.

Right now when the player transfers off the starting map, the animals are placed where the events are and I would like to save the animals current positions and then place them exactly where they were before the player changed map.
 

Shiro-chan

Friendly Neighbourhood Neppy Maid
Veteran
Joined
Aug 7, 2018
Messages
151
Reaction score
42
First Language
German
Primarily Uses
RMVXA
You must save the event locations' x and y coordinates when exiting the map in specifically asigned variables.

Change the variables and events as required:
Code:
$game_variables[11]=$game_map.events[1].x
$game_variables[12]=$game_map.events[1].y
$game_variables[21]=$game_map.events[2].x
$game_variables[22]=$game_map.events[2].y
$game_variables[31]=$game_map.events[3].x
$game_variables[32]=$game_map.events[3].y
Remember to put this code into your event that takes you off the map BEFORE the teleport.

You can then set the teleport to this map:
-fade out
-teleport to map with animals, no fading
-run3 Set Event Location calls, each for one of the animals, coordinates are "Designation with variables" and plug the correct variables in
-fade in

Then it should work the way you intend.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If the animals are also moving randomly, they could be facing a different direction, so you might also need to save the event's direction and restore that on the new map too.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top