REQUESTING ASSISTANCE WITH FIXING A PROBLEM.
Posts
Pages:
1
In a game I am making, there is a 'monster' that throws a boulder at a player.
I have the movements down for the boulder:
(page1) (parallel process)
@>Set Move Route: This Event (Ignore If Can't Move)
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
@>Wait for Move's Completion
@>Control Self Switch: A =ON
@>
(page2) (parallel process)
#image is invisible so that boulder can go back into place without being seen
@>Set Event Location: This Event,(019,012)
@>Wait: 50 frame(s)
@>Control Self Switch: A =OFF
@>
So, as you can see, the movement is working fine, but what my complication is, is that nothing HAPPENS if the boulder hits the player.
Is there any way that the movement can stay, and I can add some sort of extra conditional branch triggered only through the player being touched by the event?
Thank you very much for your time.
I have the movements down for the boulder:
(page1) (parallel process)
@>Set Move Route: This Event (Ignore If Can't Move)
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
: :$>Move toward Player
@>Wait for Move's Completion
@>Control Self Switch: A =ON
@>
(page2) (parallel process)
#image is invisible so that boulder can go back into place without being seen
@>Set Event Location: This Event,(019,012)
@>Wait: 50 frame(s)
@>Control Self Switch: A =OFF
@>
So, as you can see, the movement is working fine, but what my complication is, is that nothing HAPPENS if the boulder hits the player.
Is there any way that the movement can stay, and I can add some sort of extra conditional branch triggered only through the player being touched by the event?
Thank you very much for your time.
If the boulder is on the Hero's layer, doesn't making it Collision with Hero do anything if you put something in the event commands? Otherwise, have a parallel event that tracks the X & Y coordinates of both the Hero and the boulder, and if they match up make something happen.
This sounds like a similar problem to one I helped fix a couple of weeks ago where the issue was that the boulder event had a fixed direction; if an event collides with the player but its direction isn't towards the player, the code won't trigger.
author=Milennin
If the boulder is on the Hero's layer, doesn't making it Collision with Hero do anything if you put something in the event commands? Otherwise, have a parallel event that tracks the X & Y coordinates of both the Hero and the boulder, and if they match up make something happen.
That seems to have almost worked, but the boulder isn't supposed to go through the player, it is simply supposed to touch the character.
the x or y coordinates would have to be 1 square off instead of being equal to the character's placement - but I have no idea how to do that.
author=firevenge007
the x or y coordinates would have to be 1 square off instead of being equal to the character's placement - but I have no idea how to do that.
You would have a branch for each possible direction of the boulder.
When moving right, you would get the x and y coordinates of the boulder. then add 1 to that x coordinate. then compare those altered coordinates to the hero.
So basically after getting the correct coordinates of the boulder, you add or subtract 1 to, in effect, place it one space in any direction.
to the right is +1 to x
to the left is -1 to x
to the top is -1 to y
to the bottom is +1 to y
You should be able to do this without that though. If you are tracking the x,y of the boulder and hero, then use a branch to see if they are equal, it should trigger the event when the boulder is on top of the hero. Not past the hero. What I just described would make it so that the boulder triggers in front of the hero, instead of on top. As long as there is a small wait and you hide the boulder right away, it will look okay.
author=Link_2112author=firevenge007You would have a branch for each possible direction of the boulder.
the x or y coordinates would have to be 1 square off instead of being equal to the character's placement - but I have no idea how to do that.
When moving right, you would get the x and y coordinates of the boulder. then add 1 to that x coordinate. then compare those altered coordinates to the hero.
So basically after getting the correct coordinates of the boulder, you add or subtract 1 to, in effect, place it one space in any direction.
to the right is +1 to x
to the left is -1 to x
to the top is -1 to y
to the bottom is +1 to y
You should be able to do this without that though. If you are tracking the x,y of the boulder and hero, then use a branch to see if they are equal, it should trigger the event when the boulder is on top of the hero. Not past the hero. What I just described would make it so that the boulder triggers in front of the hero, instead of on top. As long as there is a small wait and you hide the boulder right away, it will look okay.
I tried the first way, but I don't really understand how I am supposed to do that.
There is:
-if the boulder is facing to the right (didn't work)
-if the player is facing to the right (didn't seem to work either)
-if the button right is touched (only works when button is pressed in that directions, and if standing still, nothing happens)
The problem with the player x = boulder x, player y = boulder y situation is that the boulder can't go through things, and if it would, it would go through all the scenery.
If there is a way that the boulder can go through me and only me rather than noclipping through the walls and such, that would be the way to go!
I'll make a test project.
Hmm, that's weird. I never realized that using collision with hero or touched by hero doesn't work this way. It doesn't trigger unless you walk into it. Lame.
Ok, I'll set up the coordinate checks.
http://rpgmaker.net/media/content/users/9179/locker/Example.zip
One big difference is how I setup the movement. If it's full of move towards hero, then you've got a homing boulder. It's fine if you want that but a more realistic boulder is one that moves toward hero once, and moves forward after that.
Hmm, that's weird. I never realized that using collision with hero or touched by hero doesn't work this way. It doesn't trigger unless you walk into it. Lame.
Ok, I'll set up the coordinate checks.
http://rpgmaker.net/media/content/users/9179/locker/Example.zip
One big difference is how I setup the movement. If it's full of move towards hero, then you've got a homing boulder. It's fine if you want that but a more realistic boulder is one that moves toward hero once, and moves forward after that.
Hmm, it shouldn't matter. As long as you have the same commands I used in the example, it will work the same in XP. The concept is universal.
I assumed you were working in 2k3. I guess those strange symbols in your example should have clued me in.
Page one of this event is totally empty with no graphic.
This code doesn't have to be on the monster event, and depending on the circumstance, I would suggest not putting something like this on the monster. Also, it would need to be altered to fit your situation.
Does this makes sense? Do you need me to explain anything?

Page one of this event is totally empty with no graphic.

This code doesn't have to be on the monster event, and depending on the circumstance, I would suggest not putting something like this on the monster. Also, it would need to be altered to fit your situation.
Does this makes sense? Do you need me to explain anything?
Pages:
1
















