SOLVED Trying to make a "blink" spell

tomexplodes

Veteran
Veteran
Joined
Oct 15, 2012
Messages
32
Reaction score
6
First Language
English
Primarily Uses
And in fact I succeeded, it wasn't hard to make a common event out of it. My "issue" is, I don't know how to make it conditional via how close you are to something you'll get stuck in. I just make the spell turn you transparent, speed you up, turn on through, then you move forward a few spaces and go back to normal. Is there any easy way to make it so you can't blink if you're too close to somewhere to get stuck? Maybe a region ID setting or something? If there isn't, I can just take it out as a spell and make it so there's an event to use it whenever you're in a place where it would be useful, but making it work all the time would be better. Thanks in advance if anyone can help! If not, no big deal!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,298
Reaction score
8,366
First Language
German
Primarily Uses
RMMV
in the common event that moves the player, use control variables to get the target coordinates and then get location info of that target location before deciding what to do
 

tomexplodes

Veteran
Veteran
Joined
Oct 15, 2012
Messages
32
Reaction score
6
First Language
English
Primarily Uses
in the common event that moves the player, use control variables to get the target coordinates and then get location info of that target location before deciding what to do
I can't see a way to do that in control variables.
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
680
Reaction score
320
First Language
PT-BR
Primarily Uses
RM2k3
Are you using "Set Movement Route ..."?
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
680
Reaction score
320
First Language
PT-BR
Primarily Uses
RM2k3
You can try to use javascript to check:
JavaScript:
$gameMap.isPassable(x, y, direction)
x -> Set the number of the "X" coordinate
y -> Set the number of the "Y" coordinate

direction -> Set the number of direction
  • Down = 2
  • Left = 4
  • Right = 6
  • Up = 8
Player coordenates:
JavaScript:
$gamePlayer.x
$gamePlayer.y

Player direction:
JavaScript:
$gamePlayer.direction()

Reference:
RPG MAKER MV / MZ Script Calls
 

tomexplodes

Veteran
Veteran
Joined
Oct 15, 2012
Messages
32
Reaction score
6
First Language
English
Primarily Uses
I appreciate knowing the commands, but I don't know how to apply them

EDIT: What I mean is, do I make a conditional branch like
if $gamePlayer.direction(2)
if $gameMap.isPassable($gamePlayer.y +4)

then do the movement?
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
680
Reaction score
320
First Language
PT-BR
Primarily Uses
RM2k3
If you know how to use "Conditional Branch" just put the command in the space for Script.
MV-Condition-Script_rez.png

About your system, I didn't understand the purpose of your event system, but I would do it differently to avoid conflicts with other systems.
 

tomexplodes

Veteran
Veteran
Joined
Oct 15, 2012
Messages
32
Reaction score
6
First Language
English
Primarily Uses
Unfortunately I'm not sure what you're telling me. I know how to enter scripts, but I don't know how to apply them in this case. I'm using a common event that occurs when you cast the spell, and I'm not sure how that conflicts with other events. I don't know scripting very well. I'm getting better at eventing, but scripting is a little out of my league if I don't know where to put the scripts, when, and why.

EDIT If it seems like I am kinda slow and maybe a little stupid, it's because I am. MS does wonders for your cognitive abilities.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,298
Reaction score
8,366
First Language
German
Primarily Uses
RMMV
I can't see a way to do that in control variables.
it's in the game data section, the line that defaults to "Map ID" but has literally thousands of other options. And then just mathematics (adding numbers to the coordinates you get)

Control Variable is probably the most important command in the engine, because you can't do much without handling variables.
If you're new to the engine, I strongly suggest you take a month or so to work through tutorials to learn how the engine handles things.
Please follow the link to the "starting point" in my signature, all those tutorials listed there will work for Ace, MV and MZ because the event commands haven't changed in that time.
 

tomexplodes

Veteran
Veteran
Joined
Oct 15, 2012
Messages
32
Reaction score
6
First Language
English
Primarily Uses
No, I know how to use variables, but I run into problems putting everything together when I don't yet know how to do a specific thing. I now have a working day/night cycle, random monster events that appear and wander around the map (thanks to some help), and a hunger system (also thanks to help). The basic stuff I can do, no problem. But when I go to game data, Map X of player, what do I DO with that variable? Do I set it to map X of the player/Y of the player depending on what direction I'm facing and then add an amount to it? After I do that, how do I check if the place it's targeting is walkable or not? These are the things that I'm bashing my head against because I know it's simple, I know it's right there, but I don't know how to make what I want to happen happen. A simple "here's how to do it" is all I really need. If you don't want to take the time, I understand! That's fine, you don't have to! But if you can't or don't want to help me, why are you here?

EDIT: That isn't meant to sound as rude as it sounds. I'm leaving it intact for full disclosure, but I am not attacking you! I'm not mad! I'm just frustrated that no matter how hard I try I can't do what I want. I've been using RPG makers since 95 or 2000, but I put them down for years inbetween. Tutorials on how to do the basics don't help me because I know the basics. It's the specific math and specific interactions that baffle me, and no amount of tutorials will help with that. My brain just doesn't work that way. If you can tell me how to do what I want to do, please do! And then I will look at it and go AHA that's how it works! And I will remember. And the next time I want to do something similar, I'll be able to. But my retention is shot to hell these days. I have to ask because I can't brute force it no matter how hard I try. Thank you for your time!
 
Last edited:

Jragyn

JABS codemonkey
Veteran
Joined
Aug 14, 2012
Messages
221
Reaction score
172
First Language
English
Primarily Uses
RMMZ
what do I DO with that variable?
I think where he was going was suggesting you leverage the "control variables" event command to gain access to the player's x:y coordinates, then using the script command (the .isPassable() one) to check if the tile is passable. The function returns a boolean (true/false) as to whether or not the player can actually travel to the designated point (x,y), and you can step 1 step at a time until you reach the farthest the player can go or you reach your hard-coded limit of 3 or whatever steps.

...I think that is what they meant, at least.

I think that event might looking something like this (untested, but hopefully enough to get the ball rolling):
1620768479497.png
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,699
Reaction score
2,800
First Language
English
Primarily Uses
RMMZ
I think where he was going was suggesting you leverage the "control variables" event command to gain access to the player's x:y coordinates, then using the script command (the .isPassable() one) to check if the tile is passable. The function returns a boolean (true/false) as to whether or not the player can actually travel to the designated point (x,y), and you can step 1 step at a time until you reach the farthest the player can go or you reach your hard-coded limit of 3 or whatever steps.

...I think that is what they meant, at least.

I think that event might looking something like this (untested, but hopefully enough to get the ball rolling):
You don't seem to be using variable 21 anywhere there, so wouldn't that blink you as many spaces forward as there was available space on the map to move?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,298
Reaction score
8,366
First Language
German
Primarily Uses
RMMV
But when I go to game data, Map X of player, what do I DO with that variable? Do I set it to map X of the player/Y of the player depending on what direction I'm facing and then add an amount to it? After I do that, how do I check if the place it's targeting is walkable or not?
That part is what I shortened to "mathematics" in my post above.
Basically yes, using the facing direction (in conditional branch) to determine wether you have to add or substract from x or y to find the target coordinates. Then either with scripts like above or with the get location info command you determine the data you want from the target position.
sometimes the script is easier, sometimes get location info is easier - you can for example check the region ID or if there is an event or other options with get location info, although passability is easier to check with the script command.
 

tomexplodes

Veteran
Veteran
Joined
Oct 15, 2012
Messages
32
Reaction score
6
First Language
English
Primarily Uses
EDIT: Nevermind.

In any event, it works PERFECTLY now. I have a blink spell that does exactly what I want it to do! Thanks everybody!

What I needed to understand was that &gamemap.IsPassable needed an X, a Y and a D number to work.

EDIT AGAIN: Here's a picture of the first part of the script, in case anyone needs to recreate it.

Untitled.png
 
Last edited:

tomexplodes

Veteran
Veteran
Joined
Oct 15, 2012
Messages
32
Reaction score
6
First Language
English
Primarily Uses
that cracked me up way too hard- idk why :aswt:
I'm writing an Ultima fan game, hence the odd phrasing. Also, yeah sounds like "you can't blink (your eyes) there", it is pretty amusing. :rhappy:
 

Latest Threads

Latest Profile Posts

My mom is finally coming home tonight! In the meantime, Wishful Wanda is back in production.
SA51K_SHADER_IDLE.gifZombie is not the only thing people turned into in this town. There is also something else here. Something has many different names in history, the plague, the black oil, the purity, the filth. And now, it's called the shade.
(Maybe too much X-File reference. :kaojoy:)
Thanks, google for putting together a random pixel art Olympics game in your logo that puts everything I've ever done to shame in pretty much every aspect. ;)
Chizuru
chizuru.png


anyway, i just recovered from Covid.
Work's been delayed for a month but now i'm back drawing again.
Ah yes i learned how to make name boxes Im now profeshonal

Forum statistics

Threads
113,616
Messages
1,076,251
Members
147,631
Latest member
pictureperfect
Top