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
6,491
Reaction score
8,308
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
695
Reaction score
451
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,160
Reaction score
15,541
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
695
Reaction score
451
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!
 

Latest Threads

Latest Posts

Latest Profile Posts

Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!
So much game make... I needs to rest. The foods call.
-Casino with bunnysuit green check.png
1638563168795.png

Forum statistics

Threads
117,171
Messages
1,105,123
Members
153,259
Latest member
litespace
Top