Special Comments
#6
Okay, you could do something like this

Code:
class Scene_Map
  def move_events_with_comments
    for a in $game_map.events.values
      next if a.list == nil
      for i in 0...a.list.size
        if a.list[i].code == 108 and a.list[i].parameters[0][0,4] == "MOVE"
        # something happens here
          substrings=a.list[i].parameters[0].split(' ')
          x=substrings[1].to_i
          y=substrings[2].to_i
          a.moveto(x,y)
        end
      end
    end
  end
end

and then call it with $scene.move_events_with_comments from an event.

Depending on how many events you want to use it for you could consider putting the values in variables, to be used after.

For example, if you know that only one event will have the comment, you could have:

Code:
class Scene_Map
  def move_events_with_comments
    for a in $game_map.events.values
      next if a.list == nil
      for i in 0...a.list.size
        if a.list[i].code == 108 and a.list[i].parameters[0][0,4] == "MOVE"
        # something happens here
          substrings=a.list[i].parameters[0].split(' ')
          $game_variables[30]=substrings[1].to_i
          $game_variables[31]=substrings[2].to_i
        end
      end
    end
  end
end
Reply }


Messages In This Thread
Special Comments - by PK8 - 03-16-2009, 02:46 PM
Special Comments - by Charlie Fleed - 03-16-2009, 03:27 PM
Special Comments - by PK8 - 03-17-2009, 05:58 AM
Special Comments - by Charlie Fleed - 03-17-2009, 01:54 PM
Special Comments - by PK8 - 03-17-2009, 07:49 PM
Special Comments - by Charlie Fleed - 03-18-2009, 03:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Special Items Separate Menu Diorm 41 42,423 02-10-2018, 06:06 PM
Last Post: Diorm



Users browsing this thread: 1 Guest(s)