The PokéCommunity Forums Fan Games Game Development Scripts, Tutorials & Tools
Essentials Script Dependent Events Use Running Sprites

Scripts, Tutorials & Tools This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Reply
 
Thread Tools
  #1    
Old August 28th, 2018 (2:35 PM).
Ulithium_Dragon's Avatar
Ulithium_Dragon Ulithium_Dragon is offline
     
    Join Date: Jul 2015
    Gender: Male
    Nature: Timid
    Posts: 88
    Dependent Events Use Running Sprites
    Current Version: 1.0


    *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/%5BScript%5D%20Depenent%20Events%20Run.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
          [email protected][arrayloc]
          # Checks to see if the player is currently running.
          if Input.dir4!=0 && $game_player.moving? && input &&
                !pbMapInterpreterRunning? && [email protected]_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
    Attached Images
    File Type: png trchar000_run.png‎ (2.8 KB, 1 views) (Save to Dropbox)
    File Type: png trchar001_run.png‎ (2.8 KB, 1 views) (Save to Dropbox)
    Attached Files
    File Type: txt [Script] Depenent Events Run.txt‎ (4.5 KB, 0 views) (Save to Dropbox)
    Reply With Quote
      #2    
    Old August 28th, 2018 (2:37 PM).
    Ulithium_Dragon's Avatar
    Ulithium_Dragon Ulithium_Dragon is offline
       
      Join Date: Jul 2015
      Gender: Male
      Nature: Timid
      Posts: 88
      Reserved.
      __________________

      [PokéMounts] [Warp Tile Animation Tutorial] [Fall Down Hole Animation Tutorial] [PokéCenter Monitor Icons] [Dependent Events Use Running Sprites]
      Reply With Quote
        #3    
      Old August 31st, 2018 (10:10 AM).
      Marin's Avatar
      Marin Marin is offline
      Not Bored
       
      Join Date: Nov 2016
      Age: 16
      Gender: Other
      Posts: 792
      Quote:
      Originally Posted by Ulithium_Dragon View Post
      Reserved.
      Reserved?
      Reply With Quote
        #4    
      Old August 31st, 2018 (10:12 AM).
      Ulithium_Dragon's Avatar
      Ulithium_Dragon Ulithium_Dragon is offline
         
        Join Date: Jul 2015
        Gender: Male
        Nature: Timid
        Posts: 88
        Quote:
        Originally Posted by Marin View Post
        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.
        __________________

        [PokéMounts] [Warp Tile Animation Tutorial] [Fall Down Hole Animation Tutorial] [PokéCenter Monitor Icons] [Dependent Events Use Running Sprites]
        Reply With Quote
        Reply

        Quick Reply

        Join the conversation!

        Create an account to post a reply in this thread, participate in other discussions, and more!

        Create a PokéCommunity Account
        Thread Tools

        Posting Rules
        You may not post new threads
        You may not post replies
        You may not post attachments
        You may not edit your posts

        BB code is On
        Smilies are On
        [IMG] code is On
        HTML code is Off

        Forum Jump


        All times are GMT -8. The time now is 7:26 PM.