BABS maplinks (Resolved)

Started by ojp2010, September 12, 2010, 07:00:55 pm

Previous topic - Next topic

ojp2010

September 12, 2010, 07:00:55 pm Last Edit: September 13, 2010, 08:21:14 pm by ojp2010
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

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

September 12, 2010, 08:25:24 pm #2 Last Edit: September 12, 2010, 08:48:48 pm by ojp2010
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.


nathmatt

I completely overlooked that in ur first post
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010


The Niche

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.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Ryex

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 no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ojp2010

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

nathmatt

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
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

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

Blizzard

September 14, 2010, 02:24:12 am #10 Last Edit: September 14, 2010, 02:28:39 am by Blizzard
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.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

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
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />