Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: ojp2010 on September 12, 2010, 07:00:55 pm

Title: BABS maplinks (Resolved)
Post by: ojp2010 on September 12, 2010, 07:00:55 pm
This has been brought up before one this forum and another I found. I been playing around with map-links to get it to work with BABS to no anvil, I posted what I have come up with so far and what I was able to get from the other forum I found. I am not getting any errors, just isn't working now. I am not sure what else to do. I am using RMX-OS which continuous maps isn't compatible with unfortunately, any help would be greatly appreciated. <3

Code:
Spoiler: ShowHide
=begin
============
Maplinks - version 0.95 (2005-11-10)
============
by Wachunga

This script simplifies linking maps together: a single event sets up an
entire edge of the map as a teleport to another map. Players trying to
leave that edge of the current map are automatically teleported.

(This can also be achieved with many copies of teleport events along the edges
of a map or with a parallel-process event that sets variables and uses them to
teleport, but these methods are not optimal -- causing lag and/or inconvenience
for the mapper.)

To link a map with another on a specific edge (north, east, south or west),
create an event with <maplink> included in its name on the appropriate edge of
the map. (To avoid confusion, maplink events on corners of the map are
not valid.) Then, add a teleport ("Transfer Player") command to the event
to specify the destination map and other details (e.g. player direction,
fading on/off). If the destination is an east or west edge, then the Y
coordinate is calculated based on the player's Y coordinate when
teleporting; likewise, the X coordinate is calculated automatically when
the destination is a north or south edge.

Note: unlike normal teleport events, maplinks are activated when the player
tries to leave the screen instead of when stepping on the last tile. This
behaviour could be changed, but I feel that it's more natural this way:
it leaves the whole map open for actual exploration, instead of "wasting"
the outer tiles of a map.

=end

#-------------------------------------------------------------------------------

class Game_Event
alias ml_ge_init initialize
def initialize(map_id, event)
ml_ge_init(map_id, event)
if @event.name.upcase.include?('<MAPLINK>')
dir = nil
if @event.y == $game_map.height-1
dir = 2 unless @event.x == 0 or @event.x == $game_map.width-1
elsif @event.x == 0
dir = 4 unless @event.y == 0 or @event.y == $game_map.height-1
elsif @event.x == $game_map.width-1
dir = 6 unless @event.y == 0 or @event.y == $game_map.height-1
elsif @event.y == 0
dir = 8 unless @event.x == 0 or @event.x == $game_map.width-1
end
if dir != nil
@list.each { |command|
if command.code == 201
# make sure new location isn't be specified by variables
if command.parameters[0] == 0
$game_map.maplinks[dir] = Maplink.new(command.parameters)
break
end
end
}
end
end
end
end

#-------------------------------------------------------------------------------

class Game_Map
attr_accessor :maplinks

alias ml_gm_setup setup
def setup(map_id)
@maplinks = {}
ml_gm_setup(map_id)
end

def width(map_id = @map_id)
if map_id == @map_id
return @map.width
else
return load_data(sprintf("Data/Map%03d.rxdata", map_id)).width
end
end

def height(map_id = @map_id)
if map_id == @map_id
return @map.height
else
return load_data(sprintf("Data/Map%03d.rxdata", map_id)).height
end
end

end

#-------------------------------------------------------------------------------

class Maplink

def initialize(parameters)
@param = parameters
end

def activate
width = $game_map.width(@param[1])
height = $game_map.height(@param[1])
# modify x (p[2]) or y (p[3]) coordinates appropriately
if @param[2] == 0 or @param[2] == width-1
@param[3] = $game_player.y
elsif @param[3] == 0 or @param[3] == height-1
@param[2] = $game_player.x
end
# set up a dummy interpreter just for teleport
interpreter = Interpreter.new
interpreter.parameters = @param
interpreter.index = 0
interpreter.command_201
end

end

#-------------------------------------------------------------------------------

class BlizzABS::Controller

 alias ml_cett check_event_trigger_touch
 def check_event_trigger_touch(x, y)
   check_maplinks(x,y)
   ml_cett(x,y)
 end

 def check_maplinks(x,y)
   return if $game_map.valid?(x, y)
   if y == $game_map.height
     dir = 2
   elsif x == -1
     dir = 4
   elsif x == $game_map.width
     dir = 6
   elsif y == -1
     dir = 8
   else
     dir = nil
   end
   if dir != nil && $game_map.maplinks[dir] != nil
     $game_map.maplinks[dir].activate
   end
 end
 
end
#-------------------------------------------------------------------------------

class Interpreter
attr_accessor :parameters
attr_accessor :index
end
$BlizzABS = BlizzABS::Processor.new
Title: Re: BABS maplinks
Post by: nathmatt on September 12, 2010, 08:05:40 pm
http://forum.chaos-project.com/index.php/topic,5161.0.html
Title: Re: BABS maplinks
Post by: ojp2010 on September 12, 2010, 08:25:24 pm
Continuous map isn't compatible. With RMX-OS, what blizzard told me.

Edit:

Quote from: Blizzard on August 26, 2010, 03:46:18 pm

2. Continuous Maps does not work with RMX-OS (and it never will). In fact it's buggy right even without RMX-OS, I didn't have time to fix it yet. When you fix the version bug, the game will either automatically crash or start behaving weird before it crashes. It might not crash, but it will definitely not work with RMX-OS.

Title: Re: BABS maplinks
Post by: nathmatt on September 12, 2010, 09:03:22 pm
I completely overlooked that in ur first post
Title: Re: BABS maplinks
Post by: ojp2010 on September 13, 2010, 02:51:32 pm
Quote from: nathmatt on September 12, 2010, 09:03:22 pm
I completely overlooked that in ur first post


No problem <3
Title: Re: BABS maplinks
Post by: The Niche on September 13, 2010, 03:03:02 pm
Quote from: ojp2010 on September 12, 2010, 07:00:55 pm
This has been brought up before one this forum and another I found. I been playing around with map-links to get it to work with BABS to no anvil, I posted what I have come up with so far and what I was able to get from the other forum I found. I am not getting any errors, just isn't working now. I am not sure what else to do. I am using RMX-OS which continuous maps isn't compatible with unfortunately, any help would be greatly appreciated. <3

Code:
Spoiler: ShowHide
=begin
============
Maplinks - version 0.95 (2005-11-10)
============
by Wachunga

This script simplifies linking maps together: a single event sets up an
entire edge of the map as a teleport to another map. Players trying to
leave that edge of the current map are automatically teleported.

(This can also be achieved with many copies of teleport events along the edges
of a map or with a parallel-process event that sets variables and uses them to
teleport, but these methods are not optimal -- causing lag and/or inconvenience
for the mapper.)

To link a map with another on a specific edge (north, east, south or west),
create an event with <maplink> included in its name on the appropriate edge of
the map. (To avoid confusion, maplink events on corners of the map are
not valid.) Then, add a teleport ("Transfer Player") command to the event
to specify the destination map and other details (e.g. player direction,
fading on/off). If the destination is an east or west edge, then the Y
coordinate is calculated based on the player's Y coordinate when
teleporting; likewise, the X coordinate is calculated automatically when
the destination is a north or south edge.

Note: unlike normal teleport events, maplinks are activated when the player
tries to leave the screen instead of when stepping on the last tile. This
behaviour could be changed, but I feel that it's more natural this way:
it leaves the whole map open for actual exploration, instead of "wasting"
the outer tiles of a map.

=end

#-------------------------------------------------------------------------------

class Game_Event
alias ml_ge_init initialize
def initialize(map_id, event)
ml_ge_init(map_id, event)
if @event.name.upcase.include?('<MAPLINK>')
dir = nil
if @event.y == $game_map.height-1
dir = 2 unless @event.x == 0 or @event.x == $game_map.width-1
elsif @event.x == 0
dir = 4 unless @event.y == 0 or @event.y == $game_map.height-1
elsif @event.x == $game_map.width-1
dir = 6 unless @event.y == 0 or @event.y == $game_map.height-1
elsif @event.y == 0
dir = 8 unless @event.x == 0 or @event.x == $game_map.width-1
end
if dir != nil
@list.each { |command|
if command.code == 201
# make sure new location isn't be specified by variables
if command.parameters[0] == 0
$game_map.maplinks[dir] = Maplink.new(command.parameters)
break
end
end
}
end
end
end
end

#-------------------------------------------------------------------------------

class Game_Map
attr_accessor :maplinks

alias ml_gm_setup setup
def setup(map_id)
@maplinks = {}
ml_gm_setup(map_id)
end

def width(map_id = @map_id)
if map_id == @map_id
return @map.width
else
return load_data(sprintf("Data/Map%03d.rxdata", map_id)).width
end
end

def height(map_id = @map_id)
if map_id == @map_id
return @map.height
else
return load_data(sprintf("Data/Map%03d.rxdata", map_id)).height
end
end

end

#-------------------------------------------------------------------------------

class Maplink

def initialize(parameters)
@param = parameters
end

def activate
width = $game_map.width(@param[1])
height = $game_map.height(@param[1])
# modify x (p[2]) or y (p[3]) coordinates appropriately
if @param[2] == 0 or @param[2] == width-1
@param[3] = $game_player.y
elsif @param[3] == 0 or @param[3] == height-1
@param[2] = $game_player.x
end
# set up a dummy interpreter just for teleport
interpreter = Interpreter.new
interpreter.parameters = @param
interpreter.index = 0
interpreter.command_201
end

end

#-------------------------------------------------------------------------------

class BlizzABS::Controller

  alias ml_cett check_event_trigger_touch
  def check_event_trigger_touch(x, y)
    check_maplinks(x,y)
    ml_cett(x,y)
  end

  def check_maplinks(x,y)
    return if $game_map.valid?(x, y)
    if y == $game_map.height
      dir = 2
    elsif x == -1
      dir = 4
    elsif x == $game_map.width
      dir = 6
    elsif y == -1
      dir = 8
    else
      dir = nil
    end
    if dir != nil && $game_map.maplinks[dir] != nil
      $game_map.maplinks[dir].activate
    end
  end
 
end
#-------------------------------------------------------------------------------

class Interpreter
attr_accessor :parameters
attr_accessor :index
end
$BlizzABS = BlizzABS::Processor.new



Level up.

OT: I have no idea. Quite honestly, I think your best bet is not to bother with it and link your maps via tunnels or something.
Title: Re: BABS maplinks
Post by: Ryex on September 13, 2010, 06:39:53 pm
Continuous maps aren't compatible with RMX-OS period. the way the system is set up it just won't work. this means the RMX-OS is incompatible with ANY script implements  Continuous maps, there is just no way to do it without rewriting the system entirely
Title: Re: BABS maplinks
Post by: ojp2010 on September 13, 2010, 08:20:50 pm
Quote from: Ryexander on September 13, 2010, 06:39:53 pm
Continuous maps aren't compatible with RMX-OS period. the way the system is set up it just won't work. this means the RMX-OS is incompatible with ANY script implements  Continuous maps, there is just no way to do it without rewriting the system entirely


I see, thank you for making the clear for me, I guess I will be using tunnels and such. Thanks guys <3
Title: Re: BABS maplinks (Resolved)
Post by: nathmatt on September 13, 2010, 08:23:46 pm
I just posted a script that should work for what you want look at event map linker I would link you to it but I'm on a I pod
Title: Re: BABS maplinks (Resolved)
Post by: ojp2010 on September 13, 2010, 09:21:31 pm
Quote from: nathmatt on September 13, 2010, 08:23:46 pm
I just posted a script that should work for what you want look at event map linker I would link you to it but I'm on a I pod


Did you script it from your Ipod too? <3
Title: Re: BABS maplinks (Resolved)
Post by: Blizzard on September 14, 2010, 02:24:12 am
Quote from: Ryexander on September 13, 2010, 06:39:53 pm
Continuous maps aren't compatible with RMX-OS period. the way the system is set up it just won't work. this means the RMX-OS is incompatible with ANY script implements  Continuous maps, there is just no way to do it without rewriting the system entirely


It's not that the system had to be rewritten entirely, but changes require a change in the data the is transferred between players. That kind of thing needs to be tested thoroughly and that can't be done so quickly if you have nobody to go online with you. Besides, it's a nasty piece of code you need to rewrite. The biggest problem would be different players on different map segments and all of them had to have their events running properly from the neighbor maps, etc.
Title: Re: BABS maplinks (Resolved)
Post by: Ryex on September 16, 2010, 03:32:59 am
in other words, the system changes from a map based event/player instance system where the client can do a lot of the processing for events as it knows where everything is, to a system that is far more complex. a system where the server is doing the processing and syncronising, controlling each event and determining what area is available to the player. kinda like what runescape dose where it has one big map but sends data only for what is happening around that player. this means that the server is keeping track of every player and syncing events between them server load and bandwidth usage skyrocket compared RMX-OS as it is now