I've got the whole MACL and 45 of my own scripts in my project and don't suffer from too much lag, except sometimes during $scene changes (although there is one compatibility error I haven't hunted down yet). However, dividing it up into its own library and calling sections with a require would probably be alot nicer.
I've added some methods to my copy of the MACL, you might want to add these in for everybody. They're simple little methods, but they do make life a little easier. I've got 4 simple additions, enjoy
MACL Section : RGSS.Map[code=$game_map.this_event]
#-----------------------------------------------------------------------------
# * Name : This Event
# Info : Simply returns event on, or event directly in front of you
# Author : Kain Nobel
# Call Info : None
#-----------------------------------------------------------------------------
def this_event
x, y, d = $game_player.x, $game_player.y, $game_player.direction
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
for event in @events.values
return event.id if event.x == x && event.y == y
return event.id if event.x == new_x && event.y == new_y
end
end[/code]
[code=$game_map.last_event]
#-------------------------------------------------------------------------
# * Name : Last event
# Info : Simply returns the last event in $game_map.events array
# Author : Kain Nobel
# Call Info : None
#-------------------------------------------------------------------------
def last_event
return @events[-1].id unless @events.empty?
end[/code]
[code=$game_map.event_count]
#-------------------------------------------------------------------------
# * Name : Event Count
# Info : Simply counts how many events are on the $game_map
# Author : Kain Nobel
# Call Info : None
#-------------------------------------------------------------------------
def event_count
return @events.empty? ? 0 : @events.size
end[/code]
MACL Section : Event_SpawnerAnd for the event spawner, I made a quick shortcut command to do call scripts. Instead of typing in...
add_event_command(355, [''])
Expand to see the code.
You just type...
call_script([''], indent) # Again, indent is default 0
Expand to see the code.
[code=Call Script]
#--------------------------------------------------------------------------
# * Add Call Script
#--------------------------------------------------------------------------
def self.call_script(parameters = [], indent = 0)
# Creates New Event Command
event_command = RPG::EventCommand.new
# Sets code, Parameters & Indent
event_command.code = 355
event_command.parameters = parameters
event_command.indent = indent
# Adds Call Script to page list
self.get_current_page.list.insert(-2, event_command)
end[/code]
As silly as it sounds, I want you to create an MInterpreter.call_script() for me, I really do need it for a user-defined module in my Vehicle system. I don't know how the Interpreter handles call script strings and converts them into actual code and evaluates them and all that, so I figured I'd just ask you to do it.