[RMVX ACE] PROPERLY WORKING MOVING PILLAR PUZZLES

Posts

Pages: 1
Never thought I would be coming back here of all places, but I need help with this NOW.

I'm trying to put in some moving pillar puzzles for Maradice Isle, using an event that tracks the pillar's position in the room with the X and Y coordinates using a pair of variables which go up and down depending on which direction the pillars are moved. It works okay so far, but there's just one problem: If the pillars are up against an object and the player attempts to move them into an area they can't go, not only does the top part of the pillar become detached from the bottom part ( there's 2 parts to the pillar that are supposed to move together ), but the variables that track the X and Y position of the pillar is thrown completely out of whack, because the numbers are still going up and down even though the pillar isn't moving.

Is there a specific script I can use to fix these problems, or rework the system in general? I've tried to fix it using other means, but this usually results in incorrect codes being processed, and an eventual crash.

AND NO, I will NOT upload any work-in-progress builds for anyone to work on! The games filesize is simply too big to allow that to happen! We'd be here for DAYS if I tried that!
Marrend
Guardian of the Description Thread
21781
I kinda feel that it might behoove you do perform a "virtual move" on the base of the pillar to check that it can be moved into various spaces before actually moving the event(s) in question.

I've done this kind of check in a few games, and it might look something like...


#Comment: I'm assuming this event is run either as a Common Event, or on the base pillar's event, itself.
Control Variables [0002]: This event's x
Control Variables [0003]: This event's y
Conditional Branch: Player is facing Down
Script: $game_variables[4] = $game_variables[2]
$game_variables[5] = $game_variables[3] + 1
Conditional Branch: Player is facing Left
Script: $game_variables[4] = $game_variables[2] - 1
$game_variables[5] = $game_variables[3]
Conditional Branch: Player is facing Right
Script: $game_variables[4] = $game_variables[2] + 1
$game_variables[5] = $game_variables[3]
Conditional Branch: Player is facing Up
Script: $game_variables[4] = $game_variables[2]
$game_variables[5] = $game_variables[3] - 1
#Comment: Are the "new" coordinates viable for a move?
Script: x = $game_variables[4]
y = $game_variables[5]
d = $game_player.direction
#Comment: Replace "event_id" below with the base pillar's event's ID value.
Conditional Branch: Script: $game_map.events[event_id].passable?(x, y, d)
#Comment: If the above is true, the tile is passable. Move both events "1 tile away from Hero" via Move Route.
#Comment: Ensure only one Move Route has "wait until done" checked.

...this in your case?

*Edit: Why does the code-tag force hard returns? This edit should fix that.
SunflowerGames
The most beautiful user on RMN!
13323

Did you try=
Check the box that says, "skip if cannot move."
I like that script idea above, but I'll need a step-by-step tutorial on how to import it into the project WITHOUT causing it to crash.

I really don't think this simple event setup is going to work in the long run: https://ibb.co/dcCfbfT

The system will need to be completely redone from scratch.
Marrend
Guardian of the Description Thread
21781
If you're talking about my post, I was actually referencing event-commands. Granted, I use the Script event-command, or use the Script option in a Conditional Branch. However, the actual code used by those options/commands should be usable without additional scripts. As far as I'm aware, the only thing you'd need is to make sure is that the variables are being referenced correctly for your project.


That aside, the image explains exactly why the variable isn't matching the actual coordinate of the pillar.


Set Move Route: This Event (Skip)
Move Right
Set Move Route: PillarBTop (Skip, Wait)
Move Right
Control Variables [0021]: += 1

The x-coordinate of the base pillar is being incremented regardless of whither or not the base pillar actually moves. My guess is that the top half moves regardless of passability. There is never a check to see if the base pillar actually moved, and if so, move the top half with it. I'm not 100% sure about how long the process will take to do the Conditional Branch on the base pillar, and move the top half accordingly. That's why I'm suggesting a "virtual move" check first. Then, if it's possible to move, do the Move Route on both events as simultaneously as possible.

*Edit: For what is is worth, the Move Routes should look pretty much what you already have. You wouldn't have to set the "old" coordinate variables afterward, as they should be set each time the event is activated.
I guess that kind of makes sense, but I'm still %120 lost on how to properly set this up.
Marrend
Guardian of the Description Thread
21781
It didn't work quite the way I thought. The "passible?" function does a virtual move, which means the original eventing/code I wrote would be "looking" two tiles ahead instead of one. However, this screencap has eventing/code that was tested, and confirmed to move a two-tile high pillar, with both events moving at the same time:




*Edit: For full disclosure, I did try doing the "Move away from Player" trick on both events. However, they moved in separate directions. For example, if I faced left, the base moved left (as it was supposed to), but the top moved up.
I can't see the full script there; Part of the script on the 4th line there is going off-screen. Can you display the full thing?
Marrend
Guardian of the Description Thread
21781
author=bulldozerman185
I can't see the full script there; Part of the script on the 4th line there is going off-screen. Can you display the full thing?

I'm aware. Hence, the comment just below the Conditional Branch. That's what's in the Conditional Branch. Probably should have mentioned that.

However, for the sake of completeness:

$game_map.events[2].passable?($game_variables[2],$game_variables[3],$game_player.direction)

I also forgot to mention that, in my tests, the upper pillar's event had "through" checked as a precaution.
SIGH... still no dice. This error message keeps popping up when I go to move the pillar: https://ibb.co/QQbWqcv

Now what's wrong?
Marrend
Guardian of the Description Thread
21781
Let's do a little cross-referencing. Game_Interpretor line 543...

#--------------------------------------------------------------------------
# * Control Variables
#--------------------------------------------------------------------------
def command_122
  value = 0
  case @params[3]  # Operand
  when 0  # Constant
    value = @params[4]
  when 1  # Variable
    value = $game_variables[@params[4]]
  when 2  # Random
    value = @params[4] + rand(@params[5] - @params[4] + 1)
  when 3  # Game Data
    value = game_data_operand(@params[4], @params[5], @params[6])
  when 4  # Script
    value = eval(@params[4])      # <-line 543
  end
  (@params[0]..@params[1]).each do |i|
    operate_variable(i, @params[2], value)
  end
end


...is run when the Control Variables event-command is used. From the error message, and where it lies in the code, you're trying to set the variable using a scrpit. The "unterminated string" part seems to be suggesting to me that the script that is being evaluated included a string-variable that only had quotation marks on one side, but not the other. I'm a bit curious as to why the script option is being used for a Control Variables event-command, but, I'm not going to question it further.

In any event, the best suggestion I can make for now is to check the base-pillar event(s), and the Control Variable event-commands that you are using to get their positions. My suggestion above was to use the "Game Data" option for Control Variables. The "Game Data" option opens it's own window, and you should be able to find "This event's Map X" and "This event's Map Y" (for getting both x and y coordinates respectively) there.
I really wish there were a video tutorial on how to set all this up somewhere. That would make it twenty times easier.
Marrend
Guardian of the Description Thread
21781
author=bulldozerman185
I really wish there were a video tutorial on how to set all this up somewhere. That would make it twenty times easier.


I've already given you a screencap with event-commands that would move both pillar events. I confirmed it, myself, with a test-project. I noted that I had the "through" checkbox enabled with the upper pillar's event. That was to ensure it could move into/along walls, or other obstructions. When you had a question about what, exactly, the script to insert for the Conditional Branch was, I gave it to you. When you encountered an error, you didn't try to research it yourself. You came here. I did what I could with the information at hand. To say that you'd like a video tutorial on top of this assistance I'm giving you? I have to ask myself: Do you really need a step-by-step process of what event-commands to select and what options to use, when they are in my screencap? I just... don't know what to make of that comment, outside of taking it as an insult to the time I've used in trying to help you.



Sorry. I think this comment is triggering unhealthy amounts of anger from me. I do hope you do find an answer that works for you. However, I think I have to step away from this for a time.
Marrend
Guardian of the Description Thread
21781
I gave this a few more thought cycles before I remembered Dragon's Gate. I don't recall if that game is encrypted or not, but, the trick that game used that might be useful for you is to just not move two events.

You move one event.





How workable this solution is depends on your comfort level in grabbing graphics from whatever the tileset you're using. In this case, I used GIMP, as it retains transparencies, and is a free graphics editing program.
I am sorry if my comment is triggering some anger in you, and if it feels like I'm insulting you for helping me. I do appreciate the help. It's just that no matter how hard I try, I just can't get this stupid thing to work. Am I really just lacking the skill to do this? This is borderline aggravating.

I think perhaps I should just abandon the idea of moving pillar puzzles altogether, before my anger reaches a boiling point and things turn ugly.
Pages: 1