• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Scripting Question] Region Map Extras question

  • 132
    Posts
    10
    Years
    How can I use a variable instead of a switch for when an extra graphic appears on the region map?
    This is what it looks like in PScreen_RegionMap:
    Code:
    for hidden in REGIONMAPEXTRAS
          if hidden[0]==mapindex && ((@wallmap && hidden[5]) ||
             (!@wallmap && hidden[1]>0 && [COLOR="Red"]$game_switches[hidden[1]][/COLOR]))
            if !@sprites["map2"]
              @sprites["map2"] = BitmapSprite.new(480,320,@viewport)
              @sprites["map2"].x = @sprites["map"].x
              @sprites["map2"].y = @sprites["map"].y
            end
            pbDrawImagePositions(@sprites["map2"].bitmap,[
               ["Graphics/Pictures/#{hidden[4]}",hidden[2]*SQUAREWIDTH,hidden[3]*SQUAREHEIGHT,0,0,-1,-1]
            ])
          end
        end
    [hidden[1] being what's referenced from the Settings section. It'd be nice if I could just do
    Code:
    $game_variables[74]==hidden[1]
    but altering anything seems to put the secret graphic on the map regardless of variables.

    Thx!
     
    That wasn't the problem, since that line was part of the conditional. Here's what I changed it to if anyone's wondering:
    Code:
    for hidden in REGIONMAPEXTRAS
          if hidden[0]==mapindex && (@wallmap && hidden[5]) ||
             (!@wallmap && hidden[1]>0)
             if $game_variables[75]==hidden[1]
              if !@sprites["map2"]
                @sprites["map2"] = BitmapSprite.new(480,320,@viewport)
                @sprites["map2"].x = @sprites["map"].x
                @sprites["map2"].y = @sprites["map"].y
              end
              pbDrawImagePositions(@sprites["map2"].bitmap,[
               ["Graphics/Pictures/#{hidden[4]}",hidden[2]*SQUAREWIDTH,hidden[3]*SQUAREHEIGHT,0,0,-1,-1]
             
            ])
            end
          end
        end
     
    Back
    Top