• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

Gen 2 Style Dark Maps 1.0.0.0

Pokémon Essentials Version
v18.1 ➖
Gen 2 Style Dark Maps

Here is a short tutorial on how you can get Gen 2 Style Dark Maps really easily. It has the following advantages:
  • All tiles are black, but remain their priority, so the player will notice if they are behind something
  • The darkness level can be adjusted or be every other color
I haven't tested it with every possible scenario, but Flash works just fine.

Only delete code if you are sure, that you won't need it anymore!

Instructions

1) In PField_FieldMoves:
Replace the HiddenMoveHandler::UseMove for Flash with the following

Ruby:
HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon|

  next false if $PokemonGlobal.flashUsed

  if !pbHiddenMoveAnimation(pokemon)

    pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))

  end

  $PokemonGlobal.flashUsed = true

  next true

})

2) In PField_Field:
Delete or comment out all of the following code:

Ruby:
# Display darkness circle on dark maps

  darkmap = pbGetMetadata($game_map.map_id,MetadataDarkMap)

  if darkmap

    if $PokemonGlobal.flashUsed

      $PokemonTemp.darknessSprite = DarknessSprite.new

      scene.spriteset.addUserSprite($PokemonTemp.darknessSprite)

      darkness = $PokemonTemp.darknessSprite

      darkness.radius = darkness.radiusMax

    else

      $PokemonTemp.darknessSprite = DarknessSprite.new

      scene.spriteset.addUserSprite($PokemonTemp.darknessSprite)

    end

  elsif !darkmap

    $PokemonGlobal.flashUsed = false

    if $PokemonTemp.darknessSprite

      $PokemonTemp.darknessSprite.dispose

      $PokemonTemp.darknessSprite = nil

    end

  end

3) (Optional) In PField_Visuals:
Delete or comment out the whole class class DarknessSprite < SpriteWrapper

4) In Tilemap_XP:
Add the following methods at the very end, right before the last end


Ruby:
def isDarkMap

    return pbGetMetadata($game_map.map_id,MetadataDarkMap)

  end

  def isDark

    return isDarkMap && !$PokemonGlobal.flashUsed

  end

  def updateColor

    @color =  Color.new(0,0,0,0)

    @color =  Color.new(0,0,0,255) if isDark

  end

5) Still in Tilemap_XP:
Right after def refresh(autotiles=false) add updateColor


Tipps:
  • You can change the color defintion at @color = Color.new(0,0,0,255) if isDark in defUpdateColor to get a different color a less black screen
  • To make the entrances visible, place an event that has a light sprite

Images:
[2021-03-17] 15_32_00.247.png

Player behind a rock, partially covered

[2021-03-17] 15_32_03.447.png

Player normally visibile
Credits
Not required
Author
Hollow_Ego
Views
3,174
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Hollow_Ego

Back
Top