Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Conditional Branch Script When player moves 1 space

Script Title:
Conditional Branch Script Option, When player moves 1 space in certain direction.
Detailed Description:
Is there a way to make the conditional branch check if a player moves 1 space in a certain direction? I want to have an NPC/object to move 1 space in a certain direction when the player moves 1 space in a certain direction. For example, if the player moves 1 space up, the event will do the same. I've tried doing this with "when up button is being pressed, event will move 1 space up," but every time, the event moves an extra space up.

Basically, I just need the conditional branch to check if the player moved 1 step up, down, left, or right. Any help will be appreciated. :3
 

teth

Member

I think it would be easy and can be made with common events as parallel.
Just do some if's for example :

Conditional Branch: The Down Button is Being Pressed
Set Move Route : (NPC)
Move Down
end

As i said it can be done with common event as parrallel.
Be healthy.
Teth
 
Yeah, in my post, i said that I tried that approach already. The npc always moves an extra space, so I thought I could fix it if i used a script command for the conditional branch to detect when the player moves 1 space in a certain direction. That way, I can have it so when the player moves 1 space up, the event will only move 1 space up.

Is there a script command to put in the conditional branch that can detect if the player moves 1 space in a certain direction?
 
SephirothSpawn":fj00x2kg said:
Code:
$game_player.moving? ^^ $game_player.drection == n

n: 2-down, 4-left, 6-right, 8-up

I was really sure that this script command would fix this problem. I tried out the script command that you gave me, like this

2iafmzb.png


This approach ended up being the same as when I set the conditional branch to "When 'up/left/right/down' button is being pressed.." The event still moved an extra step when I tried to get it to mimmick my movements.

I feel like this is headed in the right direction though. Is there a script command that would detect if a player is moving '1 space' in a certain direction rather than just moving in a certain direction?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top