On map teleport encounters.

Snuper1234

Villager
Member
Joined
Apr 24, 2020
Messages
12
Reaction score
2
First Language
Eng
Primarily Uses
RMMV
Hello.
On the world map I want to have areas (region ID) that will have random encounters.
But the problem is that I don't want a battle to happen, I want a teleport to happen to a specific map.
Like traveling merchant, or Ambush.(Like dragon age origins random encounters).
I know i can fill the entire map with events with random variables and conditional branch on every step instead of using the Region ID but that might be a problem.

And another question a parallel event that will save the player location every time on the world map can cause problems?
 
Last edited:

Hyouryuu-Na

Procrastinator
Veteran
Joined
Jun 15, 2017
Messages
791
Reaction score
1,793
First Language
Not English
Primarily Uses
RMMV
In a parallel event, check for this condition:
$gamePlayer.regionId()==x
If Player is in region X, then transfer to a particular area.

You can have a parallel event that store's player location. It won't cause problems unless you have too many parallel events.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,954
Reaction score
13,587
First Language
English
Primarily Uses
RMMV
You only need to save the player location when you're about to transfer to a different map.
 

Snuper1234

Villager
Member
Joined
Apr 24, 2020
Messages
12
Reaction score
2
First Language
Eng
Primarily Uses
RMMV
In a parallel event, check for this condition:
$gamePlayer.regionId()==x
If Player is in region X, then transfer to a particular area.

You can have a parallel event that store's player location. It won't cause problems unless you have too many parallel events.
That helped.. But the problem is that the encounter happen no matter if the player is moving on it or standing still. ( I used random variable for X to happen on region Y).
There is no way to manipulate the Encounters in the edit map without starting a battle?
Worse case ill just start a battle that will say Encounter and teleport from that battle.

You only need to save the player location when you're about to transfer to a different map.
Yeah i know, but i wasn't sure how to do it if there will be a way to activate the teleport encounter in the edit map part instead of parallel event like hyouryuu suggested
 

Hyouryuu-Na

Procrastinator
Veteran
Joined
Jun 15, 2017
Messages
791
Reaction score
1,793
First Language
Not English
Primarily Uses
RMMV
Maybe these script calls can help:
check if player is walking: $gamePlayer.isMoving()
check if player is dashing: $gamePlayer.isDashing()
 

Snuper1234

Villager
Member
Joined
Apr 24, 2020
Messages
12
Reaction score
2
First Language
Eng
Primarily Uses
RMMV
Maybe these script calls can help:
check if player is walking: $gamePlayer.isMoving()
check if player is dashing: $gamePlayer.isDashing()
Thank you very much :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,954
Reaction score
13,587
First Language
English
Primarily Uses
RMMV
Can you show a screenshot of your event so we can see how you're doing it?
 

Snuper1234

Villager
Member
Joined
Apr 24, 2020
Messages
12
Reaction score
2
First Language
Eng
Primarily Uses
RMMV
Can you show a screenshot of your event so we can see how you're doing it?
You mean after I added $gamePlayer.isDashing() and $gamePlayer.isMoving()?
because im doing parallel event and not from the encounter in edit map.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Here is a rudimentary Setup, maybe it helps.
randomencounterteleport01.PNG
Edit: Variable40 is named terrain id, but it stores the player region id, it is just named wrong.
Edit2: Maybe Add a 60 Frames Wait command after the Teleport Commands.
Edit3: Turn Self Switch A Off before teleporting to other map, because else a battle will start if you come back , because you most likely moved on the other map and therfor the player steps increased...

Edit4: The Above Code Teleports the Player after he moved between 25 to 40 Maptiles.
The Teleport Destination is choosen by the Region Id the Player is Moving to.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,954
Reaction score
13,587
First Language
English
Primarily Uses
RMMV
I would like to see what you are already doing to try and get random "encounters" that are not battles working.
 

Snuper1234

Villager
Member
Joined
Apr 24, 2020
Messages
12
Reaction score
2
First Language
Eng
Primarily Uses
RMMV
I did it like that.. Im not sure if it's the best option though.
and i didnt managed to get random "encounters"(From edit map, right?) to work. so i went to parallel event.. i prefer the random encounter but no idea how to do it and if its even possible.
Test.png
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,954
Reaction score
13,587
First Language
English
Primarily Uses
RMMV
So let's step through this bit by bit ...

If the player is on region 1 and is moving, you are setting a 1 in 300 chance of an encounter happening. Is this what you want?

Why do you have an extra test for dashing? Do you see that if the player is not moving, but is dashing (can that even be possible?) then the variable is not being changed, as that control variables is only happening in the isMoving block?


So what is happening when this runs, and what do you expect to happen?

Is the rest of the event just a repeat of what's on the screen here? Are you setting variable 5 in every block after checking IsMoving?
How much of your map do you have covered with regions?

Perhaps to simplify things, use a test map that is ALL painted with region 1, then run this event in it and see if it works as you expect. Once you get a simple version working, then start adding a bit more complexity.
 
  • Like
Reactions: Bex

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

Latest Threads

Latest Posts

Latest Profile Posts

Been working on my game's menu since the past few days. :D
Game Title: ⟁False Server
Hello world! I just remembered statuses were a thing, I rarely have ever used in my long history here :kaoswt2:
I got a new username. I now greet you as LRDean_Socks!:kaohi: You can call me Socks.
"Let us be absolutely clear about this: "
Miss posting updates of my projects here...miss having time to work on my projects
I'm not sure if it's okay or not, I update it often because I think it's not.

Forum statistics

Threads
103,359
Messages
999,004
Members
134,870
Latest member
Mrmew750
Top