interactive moving events 'above character'

Status
Not open for further replies.

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
140
Reaction score
10
First Language
English
Primarily Uses
RMVXA
hi,

so in my game, the monsters you encounter are events (not random encounters) - and they are land, sea or air-based. So, for birds, for example, I want them to be able to fly over the scenery (e.g. trees), but still engage in battle with the character on contact. (some move randomly, some towards the char, but that's not really important)

If I set the event to 'above character', and 'through', they fly as I want them to, but the 'Event touch' doesn't trigger very reliably.
If I set the event to 'same as character', and 'through', they end up flying behind certain parts of the scenery and over others.

Without through, they just don't fly over anything at all.

Is there a way to do this? Am I missing something?

Thanks in advance.
 
Last edited:

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
34
First Language
Bulgarian
Primarily Uses
RMVXA
Try adding this snippet in your project.
Code:
class Game_CharacterBase
 
#======================New method==========================================
  def above_priority?
    @priority_type == 2
  end
#=========================================================================

#=====================Original method edit================================
    def move_straight(d, turn_ok = true)
    @move_succeed = passable?(@x, @y, d)
    if @move_succeed
      set_direction(d)
      @x = $game_map.round_x_with_direction(@x, d)
      @y = $game_map.round_y_with_direction(@y, d)
      @real_x = $game_map.x_with_direction(@x, reverse_dir(d))
      @real_y = $game_map.y_with_direction(@y, reverse_dir(d))
      increase_steps
      check_event_trigger_touch(@x, @y) if above_priority?
    elsif turn_ok
      set_direction(d)
      check_event_trigger_touch_front
    end
  end
#===========================================================================

end

class Game_Event < Game_Character
 
#=====================Original method edit================================
  def check_event_trigger_touch(x, y)
    return if $game_map.interpreter.running?
    if @trigger == 2 && $game_player.pos?(x, y)
      start if !jumping? &&   (normal_priority? || above_priority? )
    end
  end
#===========================================================================
end
Seems the default engine checks for event touch only with normal priority events, which is why I edited it a little. And for being a "Through" event, I altered it so it checks for touch event even in succeseful movement, as long the moving event is above player priority. Hope it helps.
 

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
140
Reaction score
10
First Language
English
Primarily Uses
RMVXA
Hey. Thanks for the reply. It looks great.

I'm not so hot when it comes to scripts, so can you tell me where i should put this? It looks like it's more than just a copy/paste job :)
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
34
First Language
Bulgarian
Primarily Uses
RMVXA
It is just copy and paste job :). It is in Tools > Script editor, under ▼ Materials, above ▼ Main Process.
Copy paste it there, then try again. The event must be above player priority, "event touch" trigger, and "Through" enabled so the event(your flyer monster) is able to fly over other events and the player.
 

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
140
Reaction score
10
First Language
English
Primarily Uses
RMVXA
The 'through' is still causing me problems. Without it, it works perfectly with 'above character' selected, but when i put 'through' on, i still find it hard to make contact with the event - the event literally goes 'through' me when i approach it. after a few tries, i can make contact, but it's not ideal :(
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
34
First Language
Bulgarian
Primarily Uses
RMVXA
Wait, did you added my snippet?
It won't work if you don't.
 

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
140
Reaction score
10
First Language
English
Primarily Uses
RMVXA
yes, I added it :) My comments were about the game after I added the snippet.
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
34
First Language
Bulgarian
Primarily Uses
RMVXA
That's weird. For me it works perfectly. Every single touch activates the event's active page.
Edit: Is your game with enabled diagonal movement? Or other script?
 
Last edited:

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
140
Reaction score
10
First Language
English
Primarily Uses
RMVXA
I think I've fixed it now.

Thanks so much for your help - that was awesome :)
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top