AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  



Le Deal du moment : -29%
PC portable – MEDION 15,6″ FHD Intel i7 ...
Voir le deal
499.99 €

Partagez
 

 VXAce - Scrolling Option

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
S4suk3
Citadin Lv.7
Citadin Lv.7
S4suk3


Masculin Inscrit le : 07/09/2011
Messages : 186

VXAce - Scrolling Option Empty
MessageSujet: VXAce - Scrolling Option   VXAce - Scrolling Option Icon_minitimeJeu 24 Jan 2013 - 8:26

Code:
# FunkyScrolling par s4suk3 et Raho(tsé tung)
=begin
    Il est possible de définir les valeur de scrolling par défaut dans le module
    ScrollingConfig.
    Les types de scrolling sont : :not, :normal, :zelda
    Vous pouvez ajouter dans la liste de "map_notscrollable" les maps qui ne
    scrolleront pas.
    InGame, vous pouvez aussi changer de mode en utilisant les commandes:
    scroll_type(type,  vitesse), vitesse étant facultatif, si aucun argument
    vitesse n'est fourni, la commande gardera sa vitesse actuelle ou prendra
    celle par défaut.
    switch_display(x, y), change l'origine de la caméra (pratique si une carte
    affiche plusieurs environnements et qu'il faut changer de carte dans une
    map qui ne scroll pas).
    Si aucun x ou y n'est fourni, les coordonnées de switch seront 0x0.
=end
module ScrollingConfig
    DEFAULT_SPEED = 2
    DEFAULT_TYPE = :not
    extend self
    def map_notscrollable
        # Ajouter ici les map non scrollables
        []
    end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Map
    #--------------------------------------------------------------------------
    # * Alias
    #--------------------------------------------------------------------------
    alias scroll_set_display_pos set_display_pos
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_accessor :display_x, :display_y
    #--------------------------------------------------------------------------
    # * Set Display Position
    #--------------------------------------------------------------------------
    def set_display_pos(x, y)
        if ScrollingConfig.map_notscrollable.include?(@map_id) || $game_system.scroll_type == :not
            return nil
        end
        scroll_set_display_pos(x, y)
    end
end

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system data. It saves the disable state of saving and
# menus. Instances of this class are referenced by $game_system.
#==============================================================================

class Game_System
    #--------------------------------------------------------------------------
    # * Alias
    #--------------------------------------------------------------------------
    alias scroll_initialize initialize
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_accessor :scroll_type, :scroll_speed
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize
        scroll_initialize
        @scroll_type = ScrollingConfig::DEFAULT_TYPE
        @scroll_speed = ScrollingConfig::DEFAULT_SPEED
    end
end

#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================

class Game_Interpreter
    #--------------------------------------------------------------------------
    # * getAccess to param
    #--------------------------------------------------------------------------
    attr_accessor :params
    #--------------------------------------------------------------------------
    # * set ScrollType
    #--------------------------------------------------------------------------
    def scroll_type(type, speed=false)
        $game_system.scroll_type = type
        $game_system.scroll_speed = speed if speed
    end
    #--------------------------------------------------------------------------
    # * Switch index map
    #--------------------------------------------------------------------------
    def switch_display(x=0, y=0)
        $game_map.display_y, $game_map.display_x = y, x
    end
end

#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles the player. It includes event starting determinants and
# map scrolling functions. The instance of this class is referenced by
# $game_player.
#==============================================================================

class Game_Player
    #--------------------------------------------------------------------------
    # * Alias
    #--------------------------------------------------------------------------
    alias scroll_update_scroll update_scroll
    #--------------------------------------------------------------------------
    # * Scroll Processing
    #--------------------------------------------------------------------------
    def update_scroll(last_real_x, last_real_y)
        if ScrollingConfig.map_notscrollable.include?($game_map.map_id)
            return nil
        end
        case $game_system.scroll_type
        when :normal
            scroll_update_scroll(last_real_x, last_real_y)
        when :not
            not_scroll
        when :zelda
            zelda_scroll
        else
            scroll_update_scroll(last_real_x, last_real_y)
        end
    end
    #--------------------------------------------------------------------------
    # * Scrolling Zelda
    #--------------------------------------------------------------------------
    def zelda_scroll
        if self.screen_y > Graphics.height && $game_player.direction == 2
            $game_map.interpreter.params = [2,Graphics.height/32,$game_system.scroll_speed]
            $game_map.interpreter.command_204 while !$game_map.scrolling?
        end

        if self.screen_x <= 0 && $game_player.direction == 4
            $game_map.interpreter.params = [4,Graphics.width/32,$game_system.scroll_speed]
            $game_map.interpreter.command_204 while !$game_map.scrolling?
        end

        if self.screen_x > Graphics.width && $game_player.direction == 6
            $game_map.interpreter.params = [6,Graphics.width/32,$game_system.scroll_speed]
            $game_map.interpreter.command_204 while !$game_map.scrolling?
        end

        if self.screen_y <= 0 && $game_player.direction == 8
            $game_map.interpreter.params = [8,Graphics.height/32,$game_system.scroll_speed]
            $game_map.interpreter.command_204 while !$game_map.scrolling?
        end
    end
    #--------------------------------------------------------------------------
    # * no scrolling
    #--------------------------------------------------------------------------
    def not_scroll
        $game_map.display_y = $game_map.display_y
        $game_map.display_x = $game_map.display_x
    end
end

Credits : RienAFoutreProduxion
Revenir en haut Aller en bas
http://fa.gri.im/~mspawn/
RitoJS
Modérateur
Modérateur
RitoJS


Masculin Age : 29
Inscrit le : 22/12/2011
Messages : 1600

VXAce - Scrolling Option Empty
MessageSujet: Re: VXAce - Scrolling Option   VXAce - Scrolling Option Icon_minitimeSam 26 Jan 2013 - 1:16

Sympas.
Merci du partage.^^
+5 points Scripts
Revenir en haut Aller en bas
http://lunarito.wordpress.com/
Nusenism
Nomimange'twa ♪
Nomimange'twa ♪
Nusenism


Masculin Age : 33
Inscrit le : 02/02/2010
Messages : 4692

VXAce - Scrolling Option Empty
MessageSujet: Re: VXAce - Scrolling Option   VXAce - Scrolling Option Icon_minitimeSam 26 Jan 2013 - 9:16

Ouais bien sympa S4s', même si le scrolling à la zelda, il va falloir que les makers gèrent sur la cohérence directe entre leurs maps! Je testerais le rendu à l'occase aussi pour me faire une idée de la différence entre le scrolling zelda et le scrolling normal.
(c'est ptêt ce que tu avais déjà partagé dans une vidéo, mais je m'en souviens plus tout à fait)
Revenir en haut Aller en bas
http://imagin.jeunforum.com/portal.htm
Contenu sponsorisé




VXAce - Scrolling Option Empty
MessageSujet: Re: VXAce - Scrolling Option   VXAce - Scrolling Option Icon_minitime

Revenir en haut Aller en bas
 

VXAce - Scrolling Option

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

 Sujets similaires

-
» [VXAce] Conversion du script Credits Vx=>VxAce
» Option supplémentaire dans le menu
» Demande d'add-on [option auto] [résolu]
» Option des actor dans la bbd.[Résolu]
» Problème avec l'option "Saut"

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Maker VX :: Entraide :: Scripts :: Scripts VX.Ace - RGSS3 :: Divers-
Créer un forum | ©phpBB | Forum gratuit d'entraide | Signaler un abus | Forum gratuit