O TEMA DO FÓRUM ESTÁ EM MANUTENÇÃO. FEEDBACKS AQUI: ACESSAR

Dúvida/Pedido sobre a conexão de mapas.

Iniciado por Virgyl, 12/08/2017 às 22:37

12/08/2017 às 22:37 Última edição: 13/08/2017 às 17:48 por Virgyl
Boa-Noite caro(a) camarada.
Venho por meio desta fazer outro de meus intermináveis pedidos: Gostaria de saber se existe
algum sucessor deste script do nosso querido Ace para o MV.

Caso o mesmo não exista, venho cá com este grito no escuro, pedindo para que algum(a) programador(a)
de bom coração possa converter o mesmo s2

  Abraços ~Virgyl


Citação de: Virgyl online 12/08/2017 às 22:37
Boa-Noite caro(a) camarada.
Venho por meio desta fazer outro de meus intermináveis pedidos: Gostaria de saber se existe
algum sucessor deste script do nosso querido Ace para o MV.

Caso o mesmo não exista, venho cá com este grito no escuro, pedindo para que algum(a) programador(a)
de bom coração possa converter o mesmo s2

  Abraços ~Virgyl


Olá!^^ Bom amigo, eu andei procurando um pouco aqui e não achei nenhum plugin, sou programador de scripts do rmmv e sinceramente esse é um script que desejo muito fazer se possível for futuramente, mas agora estou cuidando de outros plugins que não me permitem trabalhar nisso agora, MAS, eu achei um tutorial na internet que pode lhe auxiliar com sua jornada!

https://www.youtube.com/watch?v=cgzHJG4ouZY

Esse tutorial mostra como mapear conectando os mapas, é MUITO simples, mas se você não entender pelo fato de ser de fora, vá no canal Drak Tutoriais que el explica como fazer também, esse tipo de mapeamento basicamente não requer plugin, não é tão pratico quanto no Plugin mas ainda sim vale a pena arriscar, espero ter ajudado! ;)

Pois é amigo, mas ainda assim tem um pequeno complicador nessa equação:
Esse sistema tem um bug terrível! Quando o jogador passa pelo evento, todos os membros da party se juntam na fila
e este é um detalhe que me dá nos nervos. Bom, mesmo assim agradeço pela resposta e pela preocupação :ok:

   Abraços ~Virgyl


20/08/2017 às 15:25 #3 Última edição: 20/08/2017 às 20:20 por Corvo
Ainda não fizeram um desse pro MV e dessa vez minhas gambiarras não podem ajudar. Eu tentei converter o script usando este site, mas obviamente não funcionou. Entretanto, para os programadores de plantão, aqui vai o código gerado:

/* Generated by Opal 0.10.3 */
(function(Opal) {
  function $rb_gt(lhs, rhs) {
    return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs);
  }
  function $rb_plus(lhs, rhs) {
    return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs);
  }
  function $rb_ge(lhs, rhs) {
    return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs);
  }
  function $rb_lt(lhs, rhs) {
    return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs);
  }
  var $a, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $gvars = Opal.gvars, $hash2 = Opal.hash2, $module = Opal.module, $klass = Opal.klass, $range = Opal.range;
  if ($gvars.imported == null) $gvars.imported = nil;

  Opal.add_stubs(['$nil?', '$[]=', '$load_notetag_connected_maps', '$scan', '$note', '$each', '$to_i', '$[]', '$==', '$downcase', '$width', '$height', '$push', '$update_page_events', '$p', '$parameters', '$code', '$===', '$>', '$+', '$offset', '$map_id', '$list', '$th_connected_maps_setup', '$add_connected_maps', '$width=', '$height=', '$th_connected_maps_width', '$th_connected_maps_height', '$load_data', '$sprintf', '$setup_connected_map', '$combine_maps', '$data', '$combine_encounters', '$encounter_list', '$combine_events', '$events', '$max', '$keys', '$connected_maps', '$>=', '$xsize', '$ysize', '$resize', '$zsize', '$<', '$concat', '$id=', '$x=', '$x', '$y=', '$y', '$update_for_map_connection', '$setup_new_events', '$new']);
  if ((($a = $gvars.imported['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {
    $gvars.imported = $hash2([], {})};
  $gvars.imported['$[]=']("TH_ConnectedMaps", true);
  (function($base) {
    var $TH, self = $TH = $module($base, 'TH');

    var def = self.$$proto, $scope = self.$$scope;

    (function($base) {
      var $Connected_Maps, self = $Connected_Maps = $module($base, 'Connected_Maps');

      var def = self.$$proto, $scope = self.$$scope;

      Opal.cdecl($scope, 'Recursive_Mode', true);

      Opal.cdecl($scope, 'Regex', /<connect[-_ ]map: (\d+)\s+(w|-?\d+)\s+(h|-?\d+)\s*(\d+)?>/im);
    })($scope.base)
  })($scope.base);
  (function($base) {
    var $RPG, self = $RPG = $module($base, 'RPG');

    var def = self.$$proto, $scope = self.$$scope;

    (function($base, $super) {
      function $Map(){};
      var self = $Map = $klass($base, $super, 'Map', $Map);

      var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3;

      def.connected_maps = nil;
      Opal.defn(self, '$connected_maps', TMP_1 = function $$connected_maps() {
        var $a, self = this;

        if ((($a = self.connected_maps['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {
          } else {
          return self.connected_maps
        };
        self.$load_notetag_connected_maps();
        return self.connected_maps;
      }, TMP_1.$$arity = 0);

      return (Opal.defn(self, '$load_notetag_connected_maps', TMP_3 = function $$load_notetag_connected_maps() {
        var $a, $b, TMP_2, self = this, res = nil;

        self.connected_maps = [];
        res = self.$note().$scan((((($scope.get('TH')).$$scope.get('Connected_Maps'))).$$scope.get('Regex')));
        return ($a = ($b = res).$each, $a.$$p = (TMP_2 = function(result){var self = TMP_2.$$s || this, $c, map_id = nil, offset_x = nil, offset_y = nil, recurse_limit = nil;
          if (self.connected_maps == null) self.connected_maps = nil;
if (result == null) result = nil;
        map_id = result['$[]'](0).$to_i();
          offset_x = (function() {if ((($c = result['$[]'](1)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
            return ((function() {if (result['$[]'](1).$downcase()['$==']("w")) {
              return self.$width()
              } else {
              return result['$[]'](1).$to_i()
            }; return nil; })())
            } else {
            return 0
          }; return nil; })();
          offset_y = (function() {if ((($c = result['$[]'](2)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
            return ((function() {if (result['$[]'](2).$downcase()['$==']("h")) {
              return self.$height()
              } else {
              return result['$[]'](2).$to_i()
            }; return nil; })())
            } else {
            return 0
          }; return nil; })();
          recurse_limit = (function() {if ((($c = result['$[]'](3)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
            return result['$[]'](3).$to_i()
            } else {
            return 1
          }; return nil; })();
          return self.connected_maps.$push([map_id, offset_x, offset_y, recurse_limit]);}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b);
      }, TMP_3.$$arity = 0), nil) && 'load_notetag_connected_maps';
    })($scope.base, null);

    (function($base, $super) {
      function $Event(){};
      var self = $Event = $klass($base, $super, 'Event', $Event);

      var def = self.$$proto, $scope = self.$$scope, TMP_5, TMP_7;

      def.pages = nil;
      Opal.defn(self, '$update_for_map_connection', TMP_5 = function $$update_for_map_connection(orig_map_id, ofs_x, ofs_y, ofs_id) {
        var $a, $b, TMP_4, self = this;

        return ($a = ($b = self.pages).$each, $a.$$p = (TMP_4 = function(page){var self = TMP_4.$$s || this;
if (page == null) page = nil;
        return self.$update_page_events(page, orig_map_id, ofs_x, ofs_y, ofs_id)}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($b);
      }, TMP_5.$$arity = 4);

      return (Opal.defn(self, '$update_page_events', TMP_7 = function $$update_page_events(page, orig_map_id, ofs_x, ofs_y, ofs_id) {
        var $a, $b, TMP_6, self = this;

        self.$p([orig_map_id, ofs_x, ofs_y, ofs_id]);
        return ($a = ($b = page.$list()).$each, $a.$$p = (TMP_6 = function(cmd){var self = TMP_6.$$s || this, $c, $d, params = nil, $case = nil;
          if ($gvars.game_map == null) $gvars.game_map = nil;
if (cmd == null) cmd = nil;
        params = cmd.$parameters();
          return (function() {$case = cmd.$code();if ((111)['$===']($case)) {if ((($c = (($d = params['$[]'](0)['$=='](6)) ? $rb_gt(params['$[]'](1), 0) : params['$[]'](0)['$=='](6))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
            return ($c = 1, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), self.$offset())))
            } else {
            return nil
          }}else if ((122)['$===']($case)) {if ((($c = (($d = params['$[]'](4)['$=='](5)) ? $rb_gt(params['$[]'](5), 0) : params['$[]'](4)['$=='](5))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
            return ($c = 5, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), self.$offset())))
            } else {
            return nil
          }}else if ((201)['$===']($case)) {if (params['$[]'](0)['$=='](0)) {
            if (orig_map_id['$=='](params['$[]'](1))) {
              params['$[]='](1, $gvars.game_map.$map_id());
              ($c = 2, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), ofs_x)));
              return ($c = 3, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), ofs_y)));
              } else {
              return nil
            }
            } else {
            return nil
          }}else if ((202)['$===']($case)) {if (params['$[]'](1)['$=='](0)) {
            if (orig_map_id['$=='](params['$[]'](2))) {
              params['$[]='](2, $gvars.game_map.$map_id());
              ($c = 3, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), ofs_x)));
              return ($c = 4, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), ofs_y)));
              } else {
              return nil
            }
            } else {
            return nil
          }}else if ((203)['$===']($case)) {if ((($c = $rb_gt(params['$[]'](0), 0)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
            ($c = 0, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), self.$offset())))};
          if ((($c = (($d = params['$[]'](1)['$=='](2)) ? $rb_gt(params['$[]'](2), 0) : params['$[]'](1)['$=='](2))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
            return ($c = 2, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), self.$offset())))
          } else if (params['$[]'](1)['$=='](0)) {
            ($c = 2, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), ofs_x)));
            return ($c = 3, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), ofs_y)));
            } else {
            return nil
          };}else if ((205)['$===']($case) || (212)['$===']($case) || (213)['$===']($case)) {if ((($c = $rb_gt(params['$[]'](0), 0)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
            return ($c = 0, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), self.$offset())))
            } else {
            return nil
          }}else if ((285)['$===']($case)) {if (params['$[]'](2)['$=='](0)) {
            ($c = 3, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), ofs_x)));
            return ($c = 4, $d = params, $d['$[]=']($c, $rb_plus($d['$[]']($c), ofs_y)));
            } else {
            return nil
          }}else { return nil }})();}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($b);
      }, TMP_7.$$arity = 5), nil) && 'update_page_events';
    })($scope.base, null);
  })($scope.base);
  return (function($base, $super) {
    function $Game_Map(){};
    var self = $Game_Map = $klass($base, $super, 'Game_Map', $Game_Map);

    var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9, TMP_10, TMP_12, TMP_13, TMP_17, TMP_18, TMP_20, TMP_22;

    def.map = def.new_width = def.new_height = nil;
    Opal.alias(self, 'th_connected_maps_setup', 'setup');

    Opal.defn(self, '$setup', TMP_8 = function $$setup(map_id) {
      var $a, $b, self = this;

      self.new_width = nil;
      self.new_height = nil;
      self.$th_connected_maps_setup(map_id);
      self.$add_connected_maps(self.map, $hash2([], {}));
      ($a = self.map, ((($b = $a.$width()) !== false && $b !== nil && $b != null) ? $b : $a['$width='](self.new_width)));
      return ($a = self.map, ((($b = $a.$height()) !== false && $b !== nil && $b != null) ? $b : $a['$height='](self.new_height)));
    }, TMP_8.$$arity = 1);

    Opal.alias(self, 'th_connected_maps_width', 'width');

    Opal.defn(self, '$width', TMP_9 = function $$width() {
      var $a, self = this;

      return ((($a = self.new_width) !== false && $a !== nil && $a != null) ? $a : self.$th_connected_maps_width());
    }, TMP_9.$$arity = 0);

    Opal.alias(self, 'th_connected_maps_height', 'height');

    Opal.defn(self, '$height', TMP_10 = function $$height() {
      var $a, self = this;

      return ((($a = self.new_height) !== false && $a !== nil && $a != null) ? $a : self.$th_connected_maps_height());
    }, TMP_10.$$arity = 0);

    Opal.defn(self, '$add_connected_maps', TMP_12 = function $$add_connected_maps(map, visited, ox, oy) {try {

      var $a, $b, TMP_11, self = this;

      if (ox == null) {
        ox = 0;
      }
      if (oy == null) {
        oy = 0;
      }
      return ($a = ($b = map.$connected_maps()).$each, $a.$$p = (TMP_11 = function(map_id, offset_x, offset_y, recurse_limit){var self = TMP_11.$$s || this, $c, $d, $e, conmap = nil;
        if (self.events == null) self.events = nil;
if (map_id == null) map_id = nil;if (offset_x == null) offset_x = nil;if (offset_y == null) offset_y = nil;if (recurse_limit == null) recurse_limit = nil;
      ($c = map_id, $d = visited, ((($e = $d['$[]']($c)) !== false && $e !== nil && $e != null) ? $e : $d['$[]=']($c, 1)));
        if ((($c = $rb_gt(visited['$[]'](map_id), recurse_limit)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) {
          Opal.ret(nil)};
        ($c = map_id, $d = visited, $d['$[]=']($c, $rb_plus($d['$[]']($c), 1)));
        conmap = self.$load_data(self.$sprintf("Data/Map%03d.rvdata2", map_id));
        self.$setup_connected_map(map_id, ox, oy, offset_x, offset_y);
        self.$combine_maps(conmap.$data(), $rb_plus(ox, offset_x), $rb_plus(oy, offset_y));
        self.$combine_encounters(conmap.$encounter_list());
        self.$combine_events(conmap.$events(), map_id, $rb_plus(ox, offset_x), $rb_plus(oy, offset_y), ((($c = self.events.$keys().$max()) !== false && $c !== nil && $c != null) ? $c : 0));
        return self.$add_connected_maps(conmap, visited, $rb_plus(ox, offset_x), $rb_plus(oy, offset_y));}, TMP_11.$$s = self, TMP_11.$$arity = 4, TMP_11), $a).call($b);
      } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; }
    }, TMP_12.$$arity = -3);

    Opal.defn(self, '$setup_connected_map', TMP_13 = function $$setup_connected_map(map_id, ox, oy, offset_x, offset_y) {
      var self = this;

      return nil;
    }, TMP_13.$$arity = 5);

    Opal.defn(self, '$combine_maps', TMP_17 = function $$combine_maps(new_data, ox, oy) {
      var $a, $b, $c, TMP_14, self = this, new_x = nil, new_y = nil, z = nil;

      new_x = (function() {if ((($a = $rb_ge($rb_plus(ox, new_data.$xsize()), self.$width())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {
        return $rb_plus(ox, new_data.$xsize())
        } else {
        return self.$width()
      }; return nil; })();
      new_y = (function() {if ((($a = $rb_ge($rb_plus(oy, new_data.$ysize()), self.$height())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {
        return $rb_plus(oy, new_data.$ysize())
        } else {
        return self.$height()
      }; return nil; })();
      self.new_width = new_x;
      self.new_height = new_y;
      self.map.$data().$resize(new_x, new_y, self.map.$data().$zsize());
      return ($b = ($c = $range(0, 4, true)).$each, $b.$$p = (TMP_14 = function($a){var self = TMP_14.$$s || this, $d, $e, $f, TMP_15, x = nil;
if ($a == null) $a = nil;
      z = $a;
        return ($e = ($f = $range(0, new_data.$xsize(), true)).$each, $e.$$p = (TMP_15 = function($d){var self = TMP_15.$$s || this, $g, $h, $i, TMP_16, y = nil;
if ($d == null) $d = nil;
        x = $d;
          return ($h = ($i = $range(0, new_data.$ysize(), true)).$each, $h.$$p = (TMP_16 = function($g){var self = TMP_16.$$s || this, $j, $k;
            if (self.map == null) self.map = nil;
if ($g == null) $g = nil;
          y = $g;
            if ((($j = ((($k = $rb_lt($rb_plus(ox, x), 0)) !== false && $k !== nil && $k != null) ? $k : $rb_lt($rb_plus(oy, y), 0))) !== nil && $j != null && (!$j.$$is_boolean || $j == true))) {
              return nil;};
            return self.map.$data()['$[]=']($rb_plus(ox, x), $rb_plus(oy, y), z, new_data['$[]'](x, y, z));}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $h).call($i);}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $e).call($f);}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $b).call($c);
    }, TMP_17.$$arity = 3);

    Opal.defn(self, '$combine_encounters', TMP_18 = function $$combine_encounters(new_enc_list) {
      var self = this;

      return self.map.$encounter_list().$concat(new_enc_list);
    }, TMP_18.$$arity = 1);

    Opal.defn(self, '$combine_events', TMP_20 = function $$combine_events(events, orig_map_id, ofs_x, ofs_y, ofs_evt) {
      var $a, $b, TMP_19, self = this, new_events = nil;

      new_events = $hash2([], {});
      ($a = ($b = events).$each, $a.$$p = (TMP_19 = function(id, event){var self = TMP_19.$$s || this, $c, $d, new_id = nil;
        if (self.map == null) self.map = nil;
if (id == null) id = nil;if (event == null) event = nil;
      new_id = $rb_plus(id, ofs_evt);
        (($c = [new_id]), $d = event, $d['$id='].apply($d, $c), $c[$c.length-1]);
        ($c = event, $c['$x=']($rb_plus($c.$x(), ofs_x)));
        ($c = event, $c['$y=']($rb_plus($c.$y(), ofs_y)));
        event.$update_for_map_connection(orig_map_id, ofs_x, ofs_y, ofs_evt);
        self.map.$events()['$[]='](new_id, event);
        return new_events['$[]='](new_id, event);}, TMP_19.$$s = self, TMP_19.$$arity = 2, TMP_19), $a).call($b);
      return self.$setup_new_events(new_events);
    }, TMP_20.$$arity = 5);

    return (Opal.defn(self, '$setup_new_events', TMP_22 = function $$setup_new_events(events) {
      var $a, $b, TMP_21, self = this;

      return ($a = ($b = events).$each, $a.$$p = (TMP_21 = function(i, event){var self = TMP_21.$$s || this;
        if (self.events == null) self.events = nil;
        if (self.map_id == null) self.map_id = nil;
if (i == null) i = nil;if (event == null) event = nil;
      return self.events['$[]='](i, $scope.get('Game_Event').$new(self.map_id, event))}, TMP_21.$$s = self, TMP_21.$$arity = 2, TMP_21), $a).call($b);
    }, TMP_22.$$arity = 1), nil) && 'setup_new_events';
  })($scope.base, null);
})(Opal);
[close]

Vocês sabem melhor que eu que isso não deve ajudar em nada. Eu tentaria substituir apenas os objetos ligados ao RGSS3 por seus respectivos no JavaScript do MV, porém eu não sei como reconhecê-los nessa bagunça - e provavelmente não funcionaria da mesma forma. Pro caso de servir para alguma coisa, está aí. Dessa vez fico no apoio moral.  :rick9:

Quem diria que haveria um dia em que tuas gambiarras falhariam xD
Engraçado pensar que nunca me passou pela cabeça sobre existir um programa ou site que converta
linhas de Ruby para JavaScript... Vou dar uma procurada nisso :derp:

   Abraços ~Virgyl