Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: G_G on July 08, 2011, 03:07:39 pm

Title: Event not activating
Post by: G_G on July 08, 2011, 03:07:39 pm
For my Secret Base script I need to generate a touch event that transfers you out of the base. The event does indeed get placed on the map as I can see the event when I'm in the base. However, when I walk over the event nothing happens. I added the right interpreter code and parameters, but nothing.
class Game_Map
 
  alias gg_setup_base_events_lat setup
  def setup(map_id)
    gg_setup_base_events_lat(map_id)
    if GG_Base.map?(map_id)
      if $game_system.map_data[map_id] == nil
        data = GG_Base::Maps[map_id]
        $game_system.map_data[map_id] = {'events' => {}, 'objects' => {}}
        event = RPG::Event.new(data[0][0], data[0][1])
        event.id = 1
        graphic = RPG::Event::Page::Graphic.new
        graphic.character_name = "001-Fighter01"
        page = RPG::Event::Page.new
        page.graphic = graphic
        page.through = true
        page.trigger = 1
        teleport = RPG::EventCommand.new
        teleport.code = 201
        teleport.parameters = [0, data[1][0], data[1][1], data[1][2], 2, 0]
        page.list = [teleport]
        event.pages = [page]
        $game_system.map_data[map_id]['events'][1] = event
      end
    end
    if $game_system.map_data.include?(map_id)
      @map.events = $game_system.map_data[map_id]['events']
      @events = {}
      for i in @map.events.keys
        @events[i] = Game_Event.new(@map_id, @map.events[i])
      end
    end
  end
 
end


Title: Re: Event not activating
Post by: ForeverZer0 on July 08, 2011, 03:28:20 pm
Are you started the event?

event.start
Title: Re: Event not activating
Post by: nathmatt on July 08, 2011, 03:31:45 pm
the info used from the GG_Base module might help
Title: Re: Event not activating
Post by: winkio on July 08, 2011, 05:23:46 pm
You did everything exactly correctly.  However, you forgot to account for the fact that RMXP is bullshit, and thus ignores the last command in every event page command list.  Just stick a new blank command on the end and you should be fine:

page.list = [teleport, RPG::EventCommand.new]
Title: Re: Event not activating
Post by: G_G on July 08, 2011, 06:10:44 pm
Quote from: nathmatt on July 08, 2011, 03:31:45 pm
the info used from the GG_Base module might help


If you must know here's the config with no instructions at all.
module GG_Base
  Objects = {}
  Objects[32] = ['200-Support08', 0, 0, false, 8, 0]
  Maps = {}
  Maps[2] = [[16, 13], [1, 0, 0]]
 
  def self.map?(id)
    return Maps.include?(id)
  end
 
end


Quote from: winkio on July 08, 2011, 05:23:46 pm
You did everything exactly correctly.  However, you forgot to account for the fact that RMXP is bullshit, and thus ignores the last command in every event page command list.  Just stick a new blank command on the end and you should be fine:

page.list = [teleport, RPG::EventCommand.new]



Ha! Thanks winkio, worked perfectly. :3
Title: Re: Event not activating
Post by: nathmatt on July 08, 2011, 06:14:19 pm
lol if winko's solution worked then i didn't need it