Simple Move Route And Event Touch Script?

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
So I wan't to know can someone make me a super simple script that lets
move route's "For the player" touch events. Can someone make like a notetag
or a comment you could put into an event so that the player can touch it if
even if the player is in a moveroute... I would also like it to stop the player untill
the event is finished...
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
First, please refrain from using the word "super simple" because most of the time, it is not. Unless you know what you're talking about.

Second, it might not what you're looking for, but someone might able to manipulate it(?)
https://github.com/theoallen/RGSS3/blob/master/Event Queues.rb
It's an event queue to run the next event when the current event is done.
 

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
681
Reaction score
446
First Language
English
Primarily Uses
RMVXA
So you want the event to start if the player touches it during the move route? Does the player continue with their move route after the event has finished, or is the move route interrupted?
 

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
So you want the event to start if the player touches it during the move route? Does the player continue with their move route after the event has finished, or is the move route interrupted?
The move route is interrupted...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I think you need to clarify this.

In your first post you said the move route should be stopped until the event is finished which sounds like you want it to complete. But in your post just then, you were asked if the move route should continue afterwards, or if it should be interrupted (the opposite of continue - to stop completely) and you said it should be interrupted. I think you may be placing a different meaning on the word interrupted than @A-Moonless-Night is, and it needs to be clear.

If you have a move route to move forward 5 times, and the player encounters a Player Touch event on move 3, after the event executes, do you want the player to move the other 2 spaces forward?
 

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
I think you need to clarify this.

In your first post you said the move route should be stopped until the event is finished which sounds like you want it to complete. But in your post just then, you were asked if the move route should continue afterwards, or if it should be interrupted (the opposite of continue - to stop completely) and you said it should be interrupted. I think you may be placing a different meaning on the word interrupted than @A-Moonless-Night is, and it needs to be clear.

If you have a move route to move forward 5 times, and the player encounters a Player Touch event on move 3, after the event executes, do you want the player to move the other 2 spaces forward?
No it just stops the player...
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
681
Reaction score
446
First Language
English
Primarily Uses
RMVXA
All right, see if this works for you:
Code:
=begin
#==============================================================================#
#   AMN Interrupt Events
#   Version 1.01
#   Author: AMoonlessNight
#   Date: 23 Feb 2019
#   Latest: 23 Feb 2019
#==============================================================================#
#   UPDATE LOG
#------------------------------------------------------------------------------#
# 23 Feb 2019 - created the script
#==============================================================================#
#   TERMS OF USE
#------------------------------------------------------------------------------#
# - Please credit AMoonlessNight or A-Moonless-Night
# - Free for non-commercial use
# - Contact for commercial use
# - I'd love to see your game if you end up using one of my scripts
#==============================================================================#

This script makes it so that the player can trigger specific 'player touch'
events while moving via move route.

Use the following notetag in a comment inside the event:
<interrupt>
 
=end

#==============================================================================
#  Please do not edit below this point unless you know what you are doing.
#==============================================================================
class RPG::Event::Page
  def note
    @note = ""
    return @note if !@list || @list.size <= 0
    note_list = []
    @list.each { |item|
      next unless item && [108, 408].include?(item.code)
      note_list << item.parameters[0]
    }
    @note = note_list.join("\r\n")
    return @note
  end
end

class Game_Player < Game_Character

  def check_event_trigger_touch_interrupt
    x2 = $game_map.round_x_with_direction(@x, @direction)
    y2 = $game_map.round_y_with_direction(@y, @direction)
    start_map_event_interrupt(x2, y2, [1,2])
  end
 
  def start_map_event_interrupt(x, y, triggers)
    return if $game_map.interpreter.running?
    $game_map.events_xy(x, y).each do |event|
      if event.trigger_in?(triggers) && event.normal_priority? && event.can_interrupt?
        event.start
      end
    end
  end
 
  def update_routine_move
    if @wait_count > 0
      @wait_count -= 1
    else
      @move_succeed = true
      command = @move_route.list[@move_route_index]
      if command
        check_event_trigger_touch_interrupt
        process_move_command(command)
        advance_move_route_index
      end
    end
  end
 
end

class Game_Event < Game_Character
  attr_reader   :event
 
  def note
    return "" if !@page || !@page.list || @page.list.size <= 0
    @page.note
  end
 
  def can_interrupt?
    note.include?("<interrupt>")
  end
end

I used it like so:
Untitled-1.png
 

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
All right, see if this works for you:
Code:
=begin
#==============================================================================#
#   AMN Interrupt Events
#   Version 1.01
#   Author: AMoonlessNight
#   Date: 23 Feb 2019
#   Latest: 23 Feb 2019
#==============================================================================#
#   UPDATE LOG
#------------------------------------------------------------------------------#
# 23 Feb 2019 - created the script
#==============================================================================#
#   TERMS OF USE
#------------------------------------------------------------------------------#
# - Please credit AMoonlessNight or A-Moonless-Night
# - Free for non-commercial use
# - Contact for commercial use
# - I'd love to see your game if you end up using one of my scripts
#==============================================================================#

This script makes it so that the player can trigger specific 'player touch'
events while moving via move route.

Use the following notetag in a comment inside the event:
<interrupt>
 
=end

#==============================================================================
#  Please do not edit below this point unless you know what you are doing.
#==============================================================================
class RPG::Event::Page
  def note
    @note = ""
    return @note if !@list || @list.size <= 0
    note_list = []
    @list.each { |item|
      next unless item && [108, 408].include?(item.code)
      note_list << item.parameters[0]
    }
    @note = note_list.join("\r\n")
    return @note
  end
end

class Game_Player < Game_Character

  def check_event_trigger_touch_interrupt
    x2 = $game_map.round_x_with_direction(@x, @direction)
    y2 = $game_map.round_y_with_direction(@y, @direction)
    start_map_event_interrupt(x2, y2, [1,2])
  end
 
  def start_map_event_interrupt(x, y, triggers)
    return if $game_map.interpreter.running?
    $game_map.events_xy(x, y).each do |event|
      if event.trigger_in?(triggers) && event.normal_priority? && event.can_interrupt?
        event.start
      end
    end
  end
 
  def update_routine_move
    if @wait_count > 0
      @wait_count -= 1
    else
      @move_succeed = true
      command = @move_route.list[@move_route_index]
      if command
        check_event_trigger_touch_interrupt
        process_move_command(command)
        advance_move_route_index
      end
    end
  end
 
end

class Game_Event < Game_Character
  attr_reader   :event
 
  def note
    return "" if !@page || !@page.list || @page.list.size <= 0
    @page.note
  end
 
  def can_interrupt?
    note.include?("<interrupt>")
  end
end

I used it like so:
Wow this works great!!! Thanks alot!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top