• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script changing map connection

12
Posts
6
Years
    • Seen Mar 28, 2022
    Hi, I am trying to create a map that changes at a certain point in the game. I am aware that I could do this by creating multiple versions of the map and be transferred to different versions depending on a switch. Unfortunately, the area I'm trying to change is part of quite a large connected area, and there is only a small bit I'm trying to change. I could create a copy of the entire connected area, but every map transfer from every door will have to have the same conditions, and any changes I make on one map, I will have to make on others.

    I have created a short script that actually manipulates the connections.dat file and it works, but only when I close and open the game. Even leaving the map and returning doesn't work. I have noticed that when I update a connection through the debug menu, the connection changes in real time when I exit the menu. I was wondering what I need to add to my script to make this change? The player will not be on any part of the connected map when the change is made. The connections will be reset when the player starts a new game, so I am not worried about it being permanently changed.

    Code:
    def switchconnection(originalmap,newmap)
      
      data = load_data("Data/connections.dat")
      newdata= load_data("Data/connections.dat")
      for i in (0...data.length)
        if data[i][0]==originalmap #|| data[i][3]==originalmap
          newdata[i][0]=newmap
        elsif data[i][3]==originalmap
          newdata[i][3]=newmap
        else
          next
        end
        
      end
      if newdata!=data
        save_data(newdata,"Data/connections.dat")
      end
      
    end
     
    Last edited:
    Hi, I am trying to create a map that changes at a certain point in the game. I am aware that I could do this by creating multiple versions of the map and be transferred to different versions depending on a switch. Unfortunately, the area I'm trying to change is part of quite a large connected area, and there is only a small bit I'm trying to change. I could create a copy of the entire connected area, but every map transfer from every door will have to have the same conditions, and any changes I make on one map, I will have to make on others.

    I have created a short script that actually manipulates the connections.dat file and it works, but only when I close and open the game. Even leaving the map and returning doesn't work. I have noticed that when I update a connection through the debug menu, the connection changes in real time when I exit the menu. I was wondering what I need to add to my script to make this change? The connections will be reset when the player starts a new game, so I am not worried about it being permanently changed.

    Code:
    def switchconnection(originalmap,newmap)
      
      data = load_data("Data/connections.dat")
      newdata= load_data("Data/connections.dat")
      for i in (0...data.length)
        if data[i][0]==originalmap #|| data[i][3]==originalmap
          newdata[i][0]=newmap
        elsif data[i][3]==originalmap
          newdata[i][3]=newmap
        else
          next
        end
        
      end
      if newdata!=data
        save_data(newdata,"Data/connections.dat")
      end
      
    end

    You should have created the thread in the Pokemon Essentials forum.

    What changes are going to be happen on the map? Are there any new event introduction, or any new house introduction? How many tiles are going to be edited? Are there many buildings that are changed for the particular given time?
     
    12
    Posts
    6
    Years
    • Seen Mar 28, 2022
    I will post it over there if to think I'll get a better response.

    Basically I'm trying to replicate a flood in part of the map. Events will be different, but everything else on the wider connected map will be the same.

    This solution will work, like I said it works if I close it and open it. I just need to figure out why it refreshes from the debug menu but not when the change is forced.
     
    Last edited:
    Back
    Top