Hey guys. I'm trying to create a method that simply creates a very basic event at some co-ordinates in the current map. Here's what I have so far.
Now I have done this all while keeping an eye on the RPG reference manual (you know, the one you get when you press 'help'), and it seems that the initialize method of RPG::Event's subclasses (ie; RPG::Event::Page, RPG::Event::Page::Condition, RPG::Event::Page::Graphic and RPG::EventCommand) take care of themselves, in that they create very basic versions of themselves, hence why they are not really addressed in my method.
Also, I have created attribute accessors for @map_id and @events.
Problem is that just nothing happens when the script is run. No errors are thrown, just nothing happens. But at the co-ordinates given when I call the script, I can't walk over that tile. It's like an event is there, just transparent. I tried also putting "Graphics/Characters/Leon.PNG" but that didn't work either. Any help? I'm not sure what I'm doing wrong, here.
Code:
def VoodooDoll.create_clone(x,y)
clone = RPG::Event.new(x,y)
clone.name = "LEON_VOODOO_CLONE"
clone.id = $game_map.events.size + 1
clone.pages[0] = RPG::Event::Page.new
clone.pages[0].graphic.character_name = "Leon"
$game_map.events[clone.id] = Game_Event.new($game_map.map_id, clone)
end
Now I have done this all while keeping an eye on the RPG reference manual (you know, the one you get when you press 'help'), and it seems that the initialize method of RPG::Event's subclasses (ie; RPG::Event::Page, RPG::Event::Page::Condition, RPG::Event::Page::Graphic and RPG::EventCommand) take care of themselves, in that they create very basic versions of themselves, hence why they are not really addressed in my method.
Also, I have created attribute accessors for @map_id and @events.
Problem is that just nothing happens when the script is run. No errors are thrown, just nothing happens. But at the co-ordinates given when I call the script, I can't walk over that tile. It's like an event is there, just transparent. I tried also putting "Graphics/Characters/Leon.PNG" but that didn't work either. Any help? I'm not sure what I'm doing wrong, here.