Kain Nobel
Member
Upon writting my Order command, I keep getting an error on this line
The error it pops is...
For one, its not supposed to be a method, its defined within a method... I don't know what this error is trying to tell me.
Any idea why it would pop such a weird error?
This is the actual portion of the script, if you need to look at it (search for '# KN: Error', its that line.)
Code:
def update_status
#..Some code
if @actor01 < @actor02
#...Does something
end
#...More code
end
The error it pops is...
NoMethodError":381m9qpy said:Script 'CMS::Scene_Menu' line 389: NoMethodError occured
undefined method '<' for#<Window_Base:0x29a12a8>
For one, its not supposed to be a method, its defined within a method... I don't know what this error is trying to tell me.
Any idea why it would pop such a weird error?
This is the actual portion of the script, if you need to look at it (search for '# KN: Error', its that line.)
Code:
class Scene_Menu
#Other stuff
#------------------------
# * Update Status Method
#------------------------
def update_status
# If C button is pressed
if Input.trigger?(Input::C) or Input.trigger?(Input::RIGHT)
# Play Decision SE
$game_system.se_play($data_system.decision_se)
case @window_command.index
# Other stuff
when CMS_Index_Order
if Input.trigger?(Input::B)
# Unless the actor isn't nil
unless @actor01 != nil
# Play Decision SE
$game_system.se_play($data_system.decision_se)
@window_command.active = true
@window_status.active = false
@window_status.index = -1
return
end
@actor01 = nil
return
end
# [If C button is pressed]----------------------------------------------
if Input.trigger?(Input::C)
# Unless Actor01 is nil
unless @actor01 != nil
# Play Decision SE
$game_system.se_play($data_system.decision_se)
# Status index determines first actor to swap
@actor01 = @window_status.index
return
end
# If Actor01 is equal to the Status Window's Index
if @actor01 == @window_status.index
# Play Decision SE
$game_system.se_play($data_system.decision_se)
# Actor01 is nil
@actor01 = nil
return
end
party = []
# For the actor within the Game Party's actor array.
for actor in $game_party.actors
party.push(actor.id)
end
# Actor02 is equal to the Status Window's Index
actor02 = @window_status.index
# If Actor01's index is less than Actor02's index
if @actor01 < actor02 # KN: Error
# For information in Actor01 index vs party size
for i in @actor01...party.size
# Remove Actor
$game_party.remove_actor(party[i])
end
# Add Actor02 to the party
$game_party.add_actor(party[actor02])
# For the information in the Actor01 within the party size
for i in (@actor01 + 1)...party.size
# If Actor01 and Actor02 is the same actor
unless i == actor02
# Add current actor
$game_party.add_actor(party[i])
else
# Add Actor01
$game_party.add_actor(party[@actor01])
end
end
else
# For information Actor02 within the party size
for i in actor02...party.size
# Remove Actor
$game_party.remove_actor(party[i])
end
# Add Actor01 to the party
$game_party.add_actor(party[@actor01])
# For the information in Actor02 within the game party
for i in (actor02 + 1)...party.size
# If Actor01 and Actor02 is the same actor
unless i == @actor01
# Add current actor
$game_party.add_actor(party[i])
else
# Add Actor02
$game_party.add_actor(party[actor02])
end
end
end
# Actor01 is returned as nil
@actor01 = nil
# Refresh the Status Window
@window_status.refresh
return
end
# If pressing LEFT or RIGHT
if Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT)
# If the Actor01 is nil and Window_Command's index is 'Order'
if @actor01 == nil and @window_command.index == CMS_Index_Order
$game_system.se_play($data_system.cursor_se)
@window_command.active = true
@window_command.index = CMS_Index_Order
@window_status.active = false
@window_status.index = -1
end
end
end
end
end
end