[ACE]Parallel process events that move and also hurt you? I need help!

never_alone

Villager
Member
Joined
Feb 14, 2016
Messages
5
Reaction score
0
First Language
English
Primarily Uses
I've looked and asked just about everywhere for help on this and its starting to get a bit frustrating.
please understand that I'm fairly new to RPG maker and need extensive detailed explanations that I can understand.
I'm making an endless runner type of game and need an event to:
  • move at random a few times
  • move all the way down the screen
  • hurt the player if touched
  • then teleport back to the top of the screen and repeat
I've gotten the event to do everything but hurt the player.
here's a picture.
please remember to explain in detail!
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Since this looks like very basic stuff I recommend to check Andar's tutorial for beginners in my signature. It explains everything you have to know in a very detailed way. I am not sure you can find anything more detailed than that for beginners.

The only thing that is not explained there is how to check if the event is outside your screen. That can be done by checking the event screen_x and screen_y coordinates in a conditional branch. You have to store them in a variable (or two variables, up to you) and then perform a check using a conditional branch.

How to use conditional branches and how to store things in variables is part of the tutorial I mentioned. If you combine what I said with the informations you find there you should be able to achieve what you want.
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
338
Reaction score
200
First Language
Portuguese
Primarily Uses
RMVXA
So the only thing you're not getting to work is the hurt?
If it affects the actor's HP, you can use this command in page 1 of Event Commands:
upload_2019-5-13_0-29-54.png
Where the constant is how much of the character's HP you want to be damaged

My suggestion would be to make the event movement in other event with Parallel Process that moves the chaser, and then in it's event you can change Parallel to Touch Event and make the HP damage and the relocation of the event to the beginning of the map on the chaser. The said Parallel event would only make it to move and would not interfere with the damage.
 

never_alone

Villager
Member
Joined
Feb 14, 2016
Messages
5
Reaction score
0
First Language
English
Primarily Uses
thats not necessarily telling me what im asking. if anything i'd want a tutorial on how to make moving events hurt you on contact. since thats exactly what ive been looking for.
this user asked a similar question but im still stumped on how they solved the problem.

heres a video of the game btw

So the only thing you're not getting to work is the hurt?
If it affects the actor's HP, you can use this command in page 1 of Event Commands:
View attachment 115541
Where the constant is how much of the character's HP you want to be damaged

My suggestion would be to make the event movement in other event with Parallel Process that moves the chaser, and then in it's event you can change Parallel to Touch Event and make the HP damage and the relocation of the event to the beginning of the map on the chaser. The said Parallel event would only make it to move and would not interfere with the damage.
"in other event" as in make a new event page?
 
Last edited by a moderator:

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
There are a couple of ways to hurt the player on contact using a parallel process event:
  1. check player and event position and if they are the same inflict damage;
  2. use the code snipped provided in this post (it was from a previous version of the forum so the formatting is gone, you have to add new lines on your own).
In the thread you linked they solved this using the latter, if you want to use the former you can just store player coordinates and event coordinates in variables. When they are the same you deal damage.
Code:
same_x = ($game_player.x == $game_map.events[your_event_id].x)
same_y = ($game_player.y == $game_map.events[your_event_id].y)
$game_switches[pick_a_switch_id] = same_x && same_y
You can then check your switch value in a conditional branch.
Code:
@> Conditional Branch: Switch [pick_a_switch_id] is ON
  @> Change HP (the amount you want to the actor you want)
@> End of Conditional Branch
I recommend using another switch (or self switch) to prevent the damage to be triggered multiple times, but this is the basic skeleton of how the event should be.

The code snipped, on the other hand, changes how events trigger so it should solve the problem without having to add a check in the parallel process event. However, once you have a parallel process running I see no harm in putting the damage check in it as well, you have to be a little careful when handling the move route but it can definitely be done.
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
338
Reaction score
200
First Language
Portuguese
Primarily Uses
RMVXA
No, you will need to make another event in parallel process.

upload_2019-5-13_0-53-56.png

Where EV001 is the ID of the event that is the chaser.
And then in the chaser event, set it by Event Touch and paste this in it's commands:

upload_2019-5-13_0-55-36.png

Where Set Event Location will move it to the top of the map.
You mentioned you wanted the event to go back to the top of the screen, but I suppose you meant map?

As for the topic you linked, the user there solved the problem with the snippet Archeia posted. Here it is:
Code:
class Game_Event < Game_Character  
  def check_event_trigger_touch(x, y)  
    return if $game_map.interpreter.running?  
    if @trigger == 2 && $game_player.pos?(x, y)    
      start  
    end
  end  
 
alias testtee_move_straight move_straight
def move_straight(d, turn_ok = true)  
  testtee_move_straight(d, turn_ok)  
  check_event_trigger_touch(@x, @y)
end
end

class Game_Player < Game_Character  
  def start_map_event(x, y, triggers, normal)  
    return if $game_map.interpreter.running?  
    $game_map.events_xy(x, y).each do |event|    
      if event.trigger_in?(triggers)      
        event.start    
      end  
    end
  end
end
Open the Script Editor and place it under Materials but above Main
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[dpost]never_alone[/dpost]
In fact it was a triple post, which I have merged for you this time.

If you want to add something, and no one has posted after you and it's less than 72 hours since your post, please use the Edit button to provide the additional info/comment.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
That happens because collisions are based on the 32x32 grid, when they are moving they are considered to be standing in the square below their real position, and if they keep moving they only stay there for one frame when reaching it, this is why you take damage when going back. Unless you want to use a different type of collision you have to deal with it or use a different approach.

The check to verify if the event coordinates are the same as the player coordinate should work though.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
im still lost
I think you should NOT use parallel process set move route for this.

usually this should be done with the trigger set to event touch and the content of the event only being the hurt sequence when the event moves on the player.
The event movement itself should be done by autonomous movement (especially the move down).
And if the event should get a different starting point for the move down, then you should use a controlling event to check the moving event's position and set event location to change the starting point at the appropiate times.

Your main problem is trying to do everything in the event content - there are reasons why the other options exist.
And that is also why people refer you to general tutorials - you need to know what parts exist in the editor to be able to use them.
It has been proven again and again that the game development is a lot faster if you take a month to just learn the engine (not doing any single step on your game in that time), because then the game development itself will be much faster.

Or in another form: what do you prefer: taking a month to learn and then be able to complete a game in one year, or taking three years to complete the game because you'll stumble along all the time without really understanding what you're doing?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top