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,952
Reaction score
13,586
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,952
Reaction score
13,586
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,952
Reaction score
13,586
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,952
Reaction score
13,586
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 Profile Posts

Ami
--- Cheating Part 2 ---

F.Healer: Ahh,This item really expensive!
F.Mage: What should we do?
Hero: Don't worry,i can use this (Activate 999999999G,Suddenly The Game Police Is Watching)
Game Police:Ehem!!! (I See You Gesture)
Hero: (Gulp)...Just...forget it...

Second bust is almost ready. I have to stop for now, but I wanted to show him off. Just have to do a handful of edits and the rest of his expressions will be done.
Kupotepo wrote on casper667's profile.
Thank you @casper667 for make many amazing plugins. Do you see right @hiddenone make the blogs about your plugins?
Does anyone know where the MZ PluginEditorDemo.js can be found? It might be called SampleCoreScript now. I'd like to see what changed from MV.
Among Us w/friends stream

Forum statistics

Threads
103,337
Messages
998,864
Members
134,845
Latest member
nenektogel
Top