RMMZ Events and Movement Core VisuStella - Spawn Event in X,Y plus Terrain.

Status
Not open for further replies.

WesdrasLink

Veteran
Veteran
Joined
Jan 2, 2013
Messages
44
Reaction score
61
First Language
Portuguese
Primarily Uses
RMMZ
Hello everyone,

I want to make the Player spawn a event in front of him but only in a defined terrain tag, however, the plugin command in the script/plugin have only the two options separated, so i can only choose between Player Position or Terrain Tag.
I did this:

Spawn in Terrain Tag 1 (Random), then the event has a autorun event to set position to the player coordinates, but this won't do, the event will glitch somehow and stay above another spawned event.
The other solution that i tried is to disable the command to spawn when the player is above a certain terrain tag, but i have to do a lot of checks, like player position and direction, setting switches to turn on and off the ability to spawn a event, so much trouble to not work.

So i was wondering if it's possible to make the event spawn in $gamePlayer.frontX() | $gamePlayer.frontY() but only in a region tag, at the same time.

Thank you for you time.
 

shockra

Bored Code Guy
Veteran
Joined
Feb 16, 2016
Messages
472
Reaction score
219
First Language
English
Primarily Uses
RMMZ
First, get the X and Y position of the space in front of the player. This should be pretty straightforward with eventing, but if you need help with this step, let me know.

Next, check that space's terrain tag using an if condition.

If the terrain tag is correct, spawn the event in front of the player.
 

WesdrasLink

Veteran
Veteran
Joined
Jan 2, 2013
Messages
44
Reaction score
61
First Language
Portuguese
Primarily Uses
RMMZ
Since i am using a plugin command, i can't change via events, but i think that something like this can work.

Condition if:
$gamePlayer.frontX() && $gamePlayer.frontY() == RegionID(1)
In another words, adjacent tile is within region 1
But i don't know what to do. Thats why i wish i could do this all in plugin command.
 

shockra

Bored Code Guy
Veteran
Joined
Feb 16, 2016
Messages
472
Reaction score
219
First Language
English
Primarily Uses
RMMZ
We need to get the space in front of the player to get the region first. Try this for the if statement script:

$gameMap.regionId($gamePlayer.frontX(), $gamePlayer.frontY()) == 1;

That should check the space in front of the player for the region. If that part is true, play the spawn event.
 

WesdrasLink

Veteran
Veteran
Joined
Jan 2, 2013
Messages
44
Reaction score
61
First Language
Portuguese
Primarily Uses
RMMZ
It works perfectly! Thank you very much.
I also used this with Terrain Tags.

$gameMap.terrainTag($gamePlayer.frontX(), $gamePlayer.frontY()) == 1;
It really works well, thanks again.

All my doubts were resolved!
Best regards!

BWT, sorry for the late reply, i was sleeping xD
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,112
Reaction score
5,963
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts


Finally was able to record the rest of the game demo! I added some edits here and there, this is why it takes me so long to do stuff cuz I find a problem and have to fix it asap. x.x
Game: https://dj990j.itch.io/region-of-mythos
Databasing. Just with what I consider "bare minimum", I have listed over 200 skills. That's not all of it, and isn't even considering skills that only 1 class would realistically have. lol

It's a Spanish devlog don't get scared!.
Just read the forum rules just for kicks and rule 14 reminds me of this:
150.jpg
I'm in the process of converting all locks and intimidate/persuade dialogue options into D20 DC based success/fail (modified by player skill). Before, it required a certain flat amount you had to meet, but with rolls, it offers more freedom. For instance, you can repeatedly try to unlock a door instead of just not meeting the requirement to unlock it.

Forum statistics

Threads
117,059
Messages
1,104,188
Members
153,025
Latest member
PHzinho
Top