Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Scripting I think
#1
Hi! I'm completely new to this so I apologize if this is in the wrong area. I was wondering if anyone knew what
Script 'Game_Event' line 30: NoMethodErroroccured
undefined method 'moveto' for #<Game_Event:ox19e9eeo
meant?
Reply }
#2
Your script is trying to call a method "moveto" in the script at line 30, but that method does not exist in the Game_Event class. Paste the code here if you can't fix it yourself and I'll see what I can do.
Reply }
#3
#--------------------------------------------------------------------------
# * Object Initialization
# map_id : map ID
# event : event (RPG::Event)
#--------------------------------------------------------------------------
def initialize(map_id, event)
super()
@map_id = map_id
@event = event
@id = @event.id
@erased = false
@starting = false
@through = true
# Move to starting position
moveto(@event.x, @event.y)
refresh
end
Reply }
#4
can anyone at least tell me what a method is? I really don't want to lose all of the work I've done.
Reply }
#5
Whenever you see a block of code in a 'class', it is referred to as a method.
Code:
class My_Example
  def my_method(variable)
    statement in the method
    statement in the method
    statement in the method
  end
end

You showed the initialize method in Game_Event. It calls forth the moveto method as it should.

So, I have a couple questions. Are you using a new script? Are you directly editing the scripts in your project? and Did you delete/change the moveto method in Game_Event?
Reply }
#6
The only new script i was trying was one for staring items but i could get it to work so i deleted it. I tried opening a new project and looking at the script in case it was affected but it is the same as the default. I didn't directly touch anything either
Reply }
#7
First, check to make sure that Game_Event starts with 'class Game_Event < Game_Character'
If it doesn't, there's your problem.
If it does, open the script editor, ctrl+shift+f, type 'def moveto', then hit 'start search'.
If no results show up for Game_Character, there's your problem.
If a result shows up for Game_Character, I have no idea.
Reply }
#8
Hey, spazfire. I got your demo. Wow... big.

Check the name of your Game_Character classes. I am afraid that you had inadvertently renamed the first one:
Code:
#==============================================================================
# ** Game_Character (part 1)
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Shota
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :id                       # ID
  attr_reader   :x                        # map x-coordinate (logical)
See?

It just so happens that THIS class holds the moveto method you lost. Rename the class back to Game_Character and it should be fine
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   RGSS scripting dissections and explinations Siletrea 97 87,744 03-18-2019, 06:46 AM
Last Post: Siletrea
   Scripting in VX vs VX Ace Miharu 5 8,057 02-21-2015, 10:10 AM
Last Post: Taylor
   Combat animations via scripting; How? ZeroSum 2 4,479 09-20-2013, 06:58 PM
Last Post: ZeroSum
   Beginner Scripting Tuts? KDawg08 1 3,601 03-31-2010, 11:03 PM
Last Post: Hsia_Nu



Users browsing this thread: