• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] How can i add these effect to Following Script (@realEvents[i])?

WolfPP

Spriter/ Pixel Artist
  • 1,297
    Posts
    6
    Years
    I would like to put these effect to Following Pokémon:

    [PokeCommunity.com] How can i add these effect to Following Script (@realEvents[i])?


    Right now, we have this:
    [PokeCommunity.com] How can i add these effect to Following Script (@realEvents[i])?


    You will see a little difference between them: from HGSS, follower haves its own direction or "save the last player's direction". Now, to Following script, when the player moves, always will trigger '$PokemonTemp.dependentEvents.pbTurnDependentEvents'.

    Also, i really want to put this effect when Pokémon turns back to its Poké Ball:
    [PokeCommunity.com] How can i add these effect to Following Script (@realEvents[i])?

    To put white effect, i found it (thanks Vendily)
    '@realEvents.blend_type=1' to white and 0 to nil blend_type. Now i need to found how to put something like:
    Code:
    @realEvents[i].blend_type=1
    5.times do
      @realEvents[i].zoom_x-=0.2
      @realEvents[i].zoom_y-=0.2
      pbWait(1)
    end
    @realEvents[i].blend_type=0
    But the script doesn't recognize 'zoom_'. :/

    Thank you!
     
    Last edited:
    But the script doesn't recognize 'zoom_'. :/

    I am not sure about if it is considered necroposting or if you have solved this question.

    zoom_x and zoom_y are not defined for the class Sprite_Character. For do it, you can add its in the Sprite_Character tab (for example) writing this just below to the others attr_accessor's:

    Code:
    attr_accessor :zoom_x
    attr_accessor :zoom_y

    But it does do nothing more than to have this variables defined.

    In the Sprite_Character tab there is a pair of lines what are the responsibles of character's zooms is actualized, it is this (inside the update method):

    Code:
    self.zoom_x     = Game_Map::TILEWIDTH/32.0 
    self.zoom_y     = Game_Map::TILEHEIGHT/32.0

    The idea is to change this automathic refresh for the assigned zoom_x and zoom_y. You can do it change the two lines by a conditional in case this variables are not empty:

    Code:
    if @character.zoom_x != nil &&  @character.zoom_y != nil  #Added line
            self.zoom_x = @character.zoom_x #Added line
            self.zoom_y = @character.zoom_y #Added line
    else  #Added line
            self.zoom_x     = Game_Map::TILEWIDTH/32.0 
            self.zoom_y     = Game_Map::TILEHEIGHT/32.0
    end #Added line

    And this is all.

    A simple function for change the size of the following pokemon could be this:

    Code:
    #===============================================================================
    # * ZoomPokemon
    # * Change zoom to following pokémon
    #===============================================================================
      def ZoomPokemon(zoom)
         events=$PokemonGlobal.dependentEvents
         for i in 0...events.length
            if events[i] && events[i][8][/Dependent/] #=="Dependent"
               @realEvents[i].zoom_x=zoom
               @realEvents[i].zoom_y=zoom
             end
         end
      end

    This should be put in the FollowingPokemon script.
     
    Last edited:
    Back
    Top