I just want my character to move a boulder to a corner then just have it say, "can't move it anymore". Instead of having it still make the sound and movement effect. The tutorials have been unhelpful.
Having trouble with simple moving boulder puzzle.
RPG Maker VXAce SupportYou can try a conditional statement inside the boulder code, so when it reaches that point it will activate a self switch and you can add the message.
we can't tell you what you are doing wrong without you showing us what you did.
Because the tutorials (especially those of Degica) are correct, so you have to be doing something wrong with your events.
please show us screenshots of those event pages
Because the tutorials (especially those of Degica) are correct, so you have to be doing something wrong with your events.
please show us screenshots of those event pages
You need to do a check first to see if the boulder CAN move, before you move it.
Try this:
Try this:
Code:
Conditional Branch: Script: evt = get_character(0); evt.passable?(evt.x, evt.y, $game_player.direction)
Script: get_character(0).move_straight($game_player.direction)
Else
Show Text: Can't move it anymore
End
This is correct, you just need to set variables to the map's X and Y coordinates.
I tried something like that.
I wasn't watching Degica tutorials. I tried 3 different ones on youtube.
The problem is you can still push against the boulder when it is against the corner. I want them to stop trying to push it once it reaches the corner. The boulder moves as intended.
Yeah, I did that.
Did you actually try my suggestion? Or did you just assume it won't work?
var 84 and 85 are set correctly, but just enter the values there, no need to read a new variable.
if the corner of the map is 14,18. then just put in:
cond branch:
if var 84 == 14
if var 85 == 18
then turn switch 304 on
if the corner of the map is 14,18. then just put in:
cond branch:
if var 84 == 14
if var 85 == 18
then turn switch 304 on
Did you mean did I try the thing I told you wasn't the problem? No. I didn't.
Can you show me a screenshot?
It's frustrating to give what I believe is something that works, and see you here still struggling to get it, when you haven't even tried my suggestion.
I get that you have a few suggestions and you can't try all of them, but maybe you can make a new test map to avoid messing up anything else you're trying. It is MUCH more simple than what you're trying above.
Based on your boulder.jpg file, you are checking if he has equipped the work boots, and if he does you immediately play the sound.
Meaning, you are not playing the sound if he moves the boulder, but if he has the working boots when reaching that spot.
Upon reading all files, I think you overthink the process because what you want to do could fit in a simple event.
Upon reaching the event, you want :
Set variables to take "This event's map X and Y".
Then check if a border has been reached with said event.
Let's say you want the boulder to be able to move on a grid from x2 to x4 and y2 to y4.
So you get something like this :
boulderX = this event map X position
boulderY = this event map Y position
minRangeX = 2
minRangeY = 2
maxRangeX = 4
maxRangeY = 4
(or you can manually input the range in the condition)
if boulderX <= minRangeX
elseif boulderY <= minRangeY
elseif boulderX >= maxRangeX
elseif boulderY >= maxRangeY
"Boulder can't move"
else
play sound
set move route = move away from player
You can engulf all of this in one condition similar as your boulder.jpg file
"If user has work boots equipped, then check coordinates and do the next condition."
There is no need for multiple pages or switches.
Because when you reach the event, you want to know its position, so checking the position can be done every time before you engage into the condition so its up to date.
Then, based on the location, engage in said condition and add desired effects based on outcome.
Edit, just noticed you have a timer, this can be trigerred whenever you want, let's say you want him to be able to push the boulder for 10 seconds after first push, you can add one more conditionnal branch before you play the sound effect. :
if isTimerRunning = OFF
isTimerRunning = ON
setTimer 10 seconds
And then add one more conditionnal branch right after this one :
if timer = 0
"Can't move any more"
else
play sound
set move route = move away from player
Meaning, you are not playing the sound if he moves the boulder, but if he has the working boots when reaching that spot.
Upon reading all files, I think you overthink the process because what you want to do could fit in a simple event.
Upon reaching the event, you want :
Set variables to take "This event's map X and Y".
Then check if a border has been reached with said event.
Let's say you want the boulder to be able to move on a grid from x2 to x4 and y2 to y4.
So you get something like this :
boulderX = this event map X position
boulderY = this event map Y position
minRangeX = 2
minRangeY = 2
maxRangeX = 4
maxRangeY = 4
(or you can manually input the range in the condition)
if boulderX <= minRangeX
elseif boulderY <= minRangeY
elseif boulderX >= maxRangeX
elseif boulderY >= maxRangeY
"Boulder can't move"
else
play sound
set move route = move away from player
You can engulf all of this in one condition similar as your boulder.jpg file
"If user has work boots equipped, then check coordinates and do the next condition."
There is no need for multiple pages or switches.
Because when you reach the event, you want to know its position, so checking the position can be done every time before you engage into the condition so its up to date.
Then, based on the location, engage in said condition and add desired effects based on outcome.
Edit, just noticed you have a timer, this can be trigerred whenever you want, let's say you want him to be able to push the boulder for 10 seconds after first push, you can add one more conditionnal branch before you play the sound effect. :
if isTimerRunning = OFF
isTimerRunning = ON
setTimer 10 seconds
And then add one more conditionnal branch right after this one :
if timer = 0
"Can't move any more"
else
play sound
set move route = move away from player
So how would checking for a boulder I have no trouble moving check to see if it has trouble moving? Ok, I added it. It did nothing.
All that work boots stuff works as intended. The entire level is on a count-down clock that restarts during dialogue and lighting torches. Otherwise, a battle happens. The tutorial I was watching had it so you could push a crate onto a button and it would reveal a treasure chest. So I turned the 'crate' to a 'boulder' and the 'button' to a 'corner' of the walkway. All I'm trying to do is once the boulder is in the corner when the character interacts with it a message will pop up and say,"You can't move this anymore.' Instead of it repeating the pushing sound effect and the boulder moving in place graphic. Boulder is at 022,006 and the corner is at 027,006. IDK where min/max range is at in the condition branch. Can you provide screenshots of what your suggestion looks like?
There are a lot of things I would do differently in your case.
First, the control variable to check boulder position should NOT be in a parallel process, they should be after the boulder moved.
Unless it moved, there is no need to update the coordinates sixty times a second after all, that only creates lag.
Then, still in the same event, I would check if the boulder is at target and if yes, switch the event page to an unmoving one.
The command sequence for this would be (inserted into your event)
set moveroute this event away from player
control variable boulder x
control variable boulder y
conditional branch boulder x == 27
> conditional branch boulder y ==6
>>show text "boulder at target"
As for preventing move when the boulder is already at a wall - you have to check if the event can move there before tryying to move it.
There are several ways to do this, depending on what your map and the possible paths are.
In a simple map without obstacles simply check the coordinates - if the y value tells you the boulder is already up to the wall, skip the move.
If the map is more complex, you'll have to target the "get location info" command on the projected destination and use the return to decide if the boulder can move or not.
First, the control variable to check boulder position should NOT be in a parallel process, they should be after the boulder moved.
Unless it moved, there is no need to update the coordinates sixty times a second after all, that only creates lag.
Then, still in the same event, I would check if the boulder is at target and if yes, switch the event page to an unmoving one.
The command sequence for this would be (inserted into your event)
set moveroute this event away from player
control variable boulder x
control variable boulder y
conditional branch boulder x == 27
> conditional branch boulder y ==6
>>show text "boulder at target"
As for preventing move when the boulder is already at a wall - you have to check if the event can move there before tryying to move it.
There are several ways to do this, depending on what your map and the possible paths are.
In a simple map without obstacles simply check the coordinates - if the y value tells you the boulder is already up to the wall, skip the move.
If the map is more complex, you'll have to target the "get location info" command on the projected destination and use the return to decide if the boulder can move or not.
It checks to see if the boulder CAN move away from the player, without actually trying to move it. If it determines the move is possible, then it moves it. If it determines the move isn't possible, then it shows the message. If the sprite changes because it's turning toward the player when you interact with it, check the Direction Fix box, then in your move route, turn direction fix off at the start, then on again at the end.
The alternative is to simply check the location of the boulder after each move, and when it reaches the desired location, turn on a self switch that stops it being moved any more. You could do this by either checking the coordinates, or by using a region. The problem with this method is if you push it up against a wall but NOT in the corner, you can continue pushing it towards the wall, and it will animate and you'll hear the SE, but it won't move. My method doesn't have that issue.
The guy on youtube said to have a parallel process on for the cords check. I didn't experience any lag. I tried it. Didn't work. Can you give me a screenshot?
Gonna need some screenshots.
This is it - one small event, one page. (You might want to add an extra page for the first move, as you're showing a message about what they can do if they have the boots equipped, and you'll add an extra condition surrounding the whole thing in this image, to check that they still have the boots equipped).
But this will let you push it in any direction you want to, until you come up against something that you can't push it into. Here, I can push it into the wall, then it won't allow me to push any further in that direction. But I can move around to either side and push it along the wall until I hit a corner.
No move possible, no animation. Note the Direction Fix box below the sprite is checked.
But this will let you push it in any direction you want to, until you come up against something that you can't push it into. Here, I can push it into the wall, then it won't allow me to push any further in that direction. But I can move around to either side and push it along the wall until I hit a corner.
No move possible, no animation. Note the Direction Fix box below the sprite is checked.
There are a lot of things wrong with that sentence.
If a random person on the street tells you to chop off your right hand, do you follow their advice without thinking as well?
For any tutorial to really work, you need to not only follow their steps but also understand why those steps were made - you'll never finish your own game by only aping things others do.
From what you have done there are two possibilities about the tutorial:
Either it was designed for a moving target instead of a fixed position (that would be the reason to have an event there as well as the parallel process, even if that PP has other problems), or the producer of that video tutorial didn't know what he was doing either.
Just because someone posts a video tutorial does NOT mean that someone is an expert on the theme.
Two of the reasons why I hate video tutorials are 1) they are usually too short to explain anything and 2) there is no quality or bug control, and some tutorials are plain wrong and spouting nonsense.
I have a problem with making screenshots, which is why I gave you only a text sequence before.
That sequence doesn't work alone, it has to be inserted at a specific point - which was indicated by the first line.
I'll use Shaz' screenshot to show that place:
And only the four new lines without the set move I used as a pointer:
control variable boulder x
control variable boulder y
conditional branch boulder x == 27
> conditional branch boulder y ==6
>>show text "boulder at destination"
Well, it's been a few days. How did it go?
It's working now thanks. Was finally able o get back on my computer today.
Alternative option using only events:
Original thread: https://forums.rpgmakerweb.com/threads/having-trouble-with-simple-moving-boulder-puzzle.141001/