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

[Scripting Question] How can i add these effect to Following Script (@realEvents[i])?

WolfPP

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

    Following_Direction.gif


    Right now, we have this:
    Following_Direction.gif


    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:
    Come_in.gif

    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:
    1
    Posts
    3
    Years
    • Seen May 29, 2020
    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