• 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.

Dependent Events Use Running Sprites

150
Posts
8
Years
    • Seen Jul 13, 2023
    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).

    Downoad:
    https://www.dropbox.com/s/ru5kkvaupkdtyq3/[Script] Depenent Events Run.txt?dl=0

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

    Script:
    Code:
    #==============================================================================#
    #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
    #==============================================================================#
    #                     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
     
    Last edited:
    150
    Posts
    8
    Years
    • Seen Jul 13, 2023
    Reserved?

    Huh? It's a very common forum behavior when creating a new thread in case the OP wants to split additional information into a second post, or needs to use 2 posts to bypass some kind of posting limitation.

    I just do it out of habit at this point, sorry.
     
    Back
    Top