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,115
Reaction score
5,968
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

I'm just so close to replacing LUK with a different stat, maybe DEX but we'll see.
Slapped together a title screen and working on some dungeon clutter + portraits for Dubhghaill and Einar. Usual CW for minor body horror wrt Einar
QVLJIgD.png

OaPcYUy.png

r55FiUJ.png

EIgO94y.png
cT1V4nb.png
>studying for months for an exam
>does exam
>waits 3 months for the results to come out
>me trying to login, incorrect password
>I get recovery password
>me trying to login, incorrect password

What the heck. As a son of a Karen, I'm going to file a few complaints.
Apparently Amazon Prime users get free Genshin Impact stuff like primogems and whatnot every month, but I'm not sure I ever want to fall into the abyss of F2P ever again.

Forum statistics

Threads
117,148
Messages
1,104,950
Members
153,221
Latest member
Kostec
Top