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 Profile Posts

Sharing my past was a mistake. Will delete the post when I get access to a working internet connection again.
TFW you get a plugin working correctly with your other plugins ♡\( ̄▽ ̄)/♡

(CW for minor gore - Einar's Y incision is gone for his test portrait)

Cs5kAbZ.png
Doing some winter related edits for a cozy cottage!
I think it's the third time I am changing my skill info plugin, but as I get better at programming, I want to fix the trash I made earlier :p

Streaming while I am programming the plugin. Join in if you wish :)
Currently working on a side game for the One Map Game Challenge. :kaoblush:
3H2mUEI.png

As you can see, the game will be called "Welcome To November". Hopefully, I'll finish it before November ends. :dizzy:

Forum statistics

Threads
116,980
Messages
1,103,492
Members
152,844
Latest member
schuzz6
Top