Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: Ryex on July 17, 2009, 09:08:59 pm

Title: finding the event name string[Resolved]
Post by: Ryex on July 17, 2009, 09:08:59 pm
can some one quickly tell me where I can find the string storing an events name?
I know that events are stored in
$game_map.events
but I can't figure out how to find the name (the one you enter into the editor) I need it so I can contemplate the tini little add-on I making for the UMS
Title: Re: finding the event name string
Post by: nathmatt on July 17, 2009, 10:28:53 pm
heres what blizzard used

Spoiler: ShowHide
def check_event_name(event_id)
      # temporary variable
      event = $game_map.map.events[event_id]
      # initialize
      enemy, time, attr, id, group, lock, drop = 0, 5, 0x00, nil, nil, nil, nil
      move = immortal = object = full_passable = false
      # if lock setting exists
      if event.name.clone.gsub!(/\\lock\[(\d+)\]/) {"#[$1]"}
        # get lock setting
        lock = $1.to_i
      end


so id sugest u def something  (event_id) then u would go  event = $game_map.map.events[event_id] so it would know what events name to check then  if event.name.clone.gsub to do the checking
Title: Re: finding the event name string
Post by: winkio on July 18, 2009, 12:29:14 am
in other words, .name.  You probably could have saved yourself some time by just searching the help file.  It's right there, I found it in 17 seconds...
Title: Re: finding the event name string
Post by: Ryex on July 18, 2009, 12:39:44 am
how... odd... I looked at the Game_Event class and didn't see it declared so I thought it wasn't there... *Slaps self* [resolved]