• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Dependent Events Use Running Sprites

Dependent Events Use Running Sprites 1.0

Pokémon Essentials Version
v17.2 ➖
Dependent Events Use Running Sprites
Current Version: 1.0

Al0WxBF.gif
*This script will work with both PE v16.2 and v17+!

-------
A small script tweak that makes a dependent event following you use a running sprite (if one exists).

See the notes at the top of the script for installation and usage instructions!

Script:
Code:
Expand Collapse Copy
#==============================================================================#
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
#==============================================================================#
#                     Dependent Events Use Running Sprites                     #
#                                    v1.0                                      #
#                             By Ulithium_Dragon                               #
#                                                                              #
#==============================================================================#
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
#==============================================================================#
# Makes a dependent event following you use a running sprite (if one exists).  #
#                                                                              #
#------------------------------------------------------------------------------#
#        :::::This script is compatible with both PE v16 and v17+:::::         #
#==============================================================================#
#                                                                              #
#------------------------------------------------------------------------------#
# **Place this script somewhere above Main and below PField_DependentEvents.   #
#------------------------------------------------------------------------------#
#                                                                              #
# You must create running sprites for any characters you want to use this with.#
#  They must be named as "<spritename> + _run".                                #
# Example: trchar000_run                                                       #
#                                                                              #
#==============================================================================#
#------------------------------------------------------------------------------#
# *NOTE: If no running sprite exists, this script will be ignored (obviously). #
#------------------------------------------------------------------------------#
#==============================================================================#
#                                                                              #
# If you have any additional dependent event checks (i.e. lava surfing,        #
#  rock climbing, etc.), put them into this constant.                          #
# Example: $PokemonGlobal.lavasurfing
ADDITIONAL_MOVEMENT_CHECKS = false  #Defaut: false
#                                                                              #
#------------------------------------------------------------------------------#
#==============================================================================#
#//////////////////////////////////////////////////////////////////////////////#
#==============================================================================#

class DependentEvents
  def updateRunningSprite
    return false if $game_temp.in_menu
    terrain=pbGetTerrainTag
    input=($PokemonSystem.runstyle==1) ? ($PokemonGlobal && $PokemonGlobal.runtoggle) : Input.press?(Input::A)
    events=$PokemonGlobal.dependentEvents
    return if events.length==0
    arrayloc = 0
    for i in events
      event=@realEvents[arrayloc]
      # Checks to see if the player is currently running.
      if Input.dir4!=0 && $game_player.moving? && input &&
            !pbMapInterpreterRunning? && !@move_route_forcing &&
            $PokemonGlobal && $PokemonGlobal.runningShoes &&
            !$PokemonGlobal.diving && !$PokemonGlobal.surfing &&
            !$PokemonGlobal.bicycle && !PBTerrain.onlyWalk?(terrain) &&
            !ADDITIONAL_MOVEMENT_CHECKS
        oldeventname = i[6]  #UNUSED
        # I can't imagine why anyone wouldn't be using PNGs, but just in case...
        if File.exists?("Graphics/Characters/" + i[6] + "_run.png") ||
          File.exists?("Graphics/Characters/" + i[6] + "_run.jpg")  ||
          File.exists?("Graphics/Characters/" + i[6] + "_run.jpeg") ||
          File.exists?("Graphics/Characters/" + i[6] + "_run.gif")
          event.character_name = i[6] + "_run"
        end
      else
        event.character_name = i[6]
      end
      arrayloc+=1
    end
  end
  
  alias loc_updateDependentEvents updateDependentEvents
  def updateDependentEvents
    updateRunningSprite
    loc_updateDependentEvents
  end
end
Credits
- This script was written by me, Ulithium_Dragon.

I don't need credit for it, but it's always appreciated.
Author
Ulithium_Dragon
Downloads
1,001
Views
1,605
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Ulithium_Dragon

Back
Top