EDIT: RESOLVED.
I will probably make a post to help others with the same problem. Sometime. Now I have to celebrate.
Messing around with pixelmovement in the Moving Platform script, I noticed a problem: when you set a passable event to Player Touch, the event commands do not execute.
I believe (correct me if I'm wrong) the player touch trigger refers to check_event_trigger_here. However, this does not seem to activate do to a strange error with last_moving not being set correctly.
The RGSS (only relevant chunks, including self edits) are below.
Thanks for any assistance.
I will probably make a post to help others with the same problem. Sometime. Now I have to celebrate.
Messing around with pixelmovement in the Moving Platform script, I noticed a problem: when you set a passable event to Player Touch, the event commands do not execute.
I believe (correct me if I'm wrong) the player touch trigger refers to check_event_trigger_here. However, this does not seem to activate do to a strange error with last_moving not being set correctly.
The RGSS (only relevant chunks, including self edits) are below.
Code:
class Game_Player < Game_Character
def check_event_trigger_here(triggers)
result = false
if $game_system.map_interpreter.running?
return result
end
for event in $game_map.events.values
m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
if (m - 0.749 <= @x) and (m + 0.749 >= @x) and (n - 0.999 <= @y) and
(n + 0.374 >= @y) and triggers.include?(event.trigger) and
not event.jumping? and event.over_trigger?
if $game_variables[50] != event.id # for testing purposes only
event.start # will replace variable 50 with class variable
$game_variables[50] = event.id
result = true
else
$game_variables[50] = 0
end
end
end
return result
end
#--------------------------------------------------------------------------
def check_event_trigger_there(triggers)
result = false
if $game_system.map_interpreter.running?
return result
end
new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
for event in $game_map.events.values
m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
if (m - 0.749 <= new_x) and (m + 0.749 >= new_x) and (n - 0.999 <= new_y) and
(n + 0.374 >= new_y) and triggers.include?(event.trigger)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
if result == false
if $game_map.counter?(new_x, new_y)
new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
for event in $game_map.events.values
m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
if (m - 0.749 <= new_x) and (m + 0.749 >= new_x) and (n - 0.999 <= new_y) and
(n + 0.374 >= new_y) and triggers.include?(event.trigger)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
end
return result
end
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
result = false
if $game_system.map_interpreter.running?
return result
end
for event in $game_map.events.values
m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
if (m - 0.749 <= x) and (m + 0.749 >= x) and (n - 0.999 <= y) and
(n + 0.374 >= y) and [1,2].include?(event.trigger)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
return result
end
#--------------------------------------------------------------------------
def update
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case Input.dir8
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
when 1
move_lower_left
when 3
move_lower_right
when 7
move_upper_left
when 9
move_upper_right
end
end
last_real_x = @real_x
last_real_y = @real_y
super
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
$game_map.scroll_down(@real_y - last_real_y)
end
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
$game_map.scroll_left(last_real_x - @real_x)
end
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
$game_map.scroll_right(@real_x - last_real_x)
end
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
$game_map.scroll_up(last_real_y - @real_y)
end
unless moving?
if @x.to_i != $game_variables[8] or @y.to_i != $game_variables[9]
result = check_event_trigger_here([1,2])
end
if Input.trigger?(Input::C)
return false if self.action != nil
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
$game_variables[8] = @x.to_i # Player Map X
$game_variables[9] = @y.to_i # Player Map Y
end
#--------------------------------------------------------------------------
end
Thanks for any assistance.