¡Bienvenido a Universo Maker!
¿Es esta la primera vez que visitas el foro? Si es así te recomendamos que te registres para tener completo acceso a todas las áreas y secciones del foro, así también podrás participar activamente en la comunidad. Si ya tienes una cuenta, conectate cuanto antes.
Iniciar Sesión Registrarme

No estás conectado. Conéctate o registrate

Ver el tema anterior Ver el tema siguiente Ir abajo Mensaje [Página 1 de 1.]

#1 [RM XP] ayuda con un script el Mar Oct 07, 2014 9:18 pm

link09

avatar
bueno este script lo saque de un pack de scripts y se supone que es de la personalidad, algo asi logre traducir,pero cuando introduzco el script me sale errores por todas partes aqui dejo el script:

Código:
#===========================================================
     # ■ Personality Engine
     #------------------------------------------------------------------------------
     #     By Near Fantastica
     #     12/04/05
     #     Version 3
     #------------------------------------------------------------------------------
     #
     #     The Personality Engine handles character personalities interactions
     and emotions...
     #     Add to the Sterotype names to add more characters to the Personality
     Model
     #
     #------------------------------------------------------------------------------
     #     Intrinsic Variables 0 to 100
     #
     # Integrity – This variable is close to the common use of the term. Actors
     with high Integrity
     # always keep their word, never tell lies, and never reveal secrets.
     Actors with low Integrity
     # break their promises, lie and reveal secrets.
     #
     # Virtue – This is the degree to which an actor takes other actors’ needs
     and desires into
     # account when making decisions. Actors with high virtue make choices
     based on
     # what’s best for other actors, themselves included. Actors with low
     Virtue are selfish,
     # self-centered and egotistical. They always place their own interests
     ahead of others considerations.
     #
     # Power – This variable represents the ability to wreak physical,
     financial, or social injury
     # upon others. Actors with lots of Power have the capacity to do harm, but
     not necessarily
     # the motivation.
     #
     # Intelligence – this variable represents the ability to make correct
     decisions. Actors with
     # high Intelligence often make the most efficacious and pragmatic choices.
     Actors with low
     # Intelligence often make incorrect judgments.
     #
     # Attractiveness – This variable represents an Actor’s physical
     appearance. A female Actor
     # with high Attractiveness is pretty; a male Actor with high
     Attractiveness is handsome.
     #
     #     Volatility Variables 0 to 100
     #
     # Adrenaline – Think of this variable as “the speed with which adrenaline
     pours
     # into the bloodstream.” It controls the rate of change of Anger/Fear.
     High values
     # describe an Actor who angers or runs quickly.
     #
     # Manic Depressive – Actors with high levels of this variable soar to
     peaks of joy or plunge
     # to depths every time they look at the mail; controls Joy/Sadness.
     #
     # Sensuality – This variable controls the rate of change of Arousal/
     Disgust. An Actor with
     # high value of Sensuality is readily aroused and easily disgusted.
     #
     #      Mood Variables 100 to -100
     #
     # Anger/Fear – Positive values denote anger; negative values denote fear.
     #
     # Joy/Sadness – Positive values denote joy; negative values denote
sadness.
     #
     # Arousal/Disgust – This paring counterbalances arousal, normally thought
     of in its
     # sexual manifestation, with disgust, normally associated with smell and
     taste. In this case,
     # however, arousal is used to indicate any heightened sensuality. Licking
     your lips
     # before digging into a meal constitutes arousal.
     #
     #     Accordance Variables 100 to -100
     #
     # Accord Integrity – This variable is close to what is known as
     gullibility; its negative sense would
     # be close to suspiciousness.
     #
     # Accord Virtue – This variable represents the willingness to see the good
     in other people.
     # An actor with high levels of Accord Virtue would be more sympathetic and
     not respond
     # harshly to another Actor’s evil actions.
     #
     # Accord Power – This variable might be call timidity. An Actor with high
     Accord Power
     # overestimates the power of others. An Actor with low Accord Power
     underestimates the
     # dangers of any social situation.
     #
     # Accord Intelligence – No simple English term adequately captures this
     concept. An Actor
     # with high Accord Intelligence more readily defers to others’ judgments,
     thinking them wise.
     # An Actor with negative values of Accord Intelligence thinks everybody
     else is stupid and
     # rejects their suggestions.
     #
     # Accord Attractive – this variable also has no ready translation into
     English. Behaviorally, an
     # Actor with high values Accord Attractive sees everybody else as
     beautiful. This variable
     # makes more sense in terms of self-image, in which case you might call
     its negative value
     # vanity. Accord Attractive might also translate into something like lust.
     #
     #     Relationship Variables 100 to -100
     #
     # Per Integrity – This variable is very close to what is known as trust.
     An actor who has high
     # Per Integrity for another acts on the belief that the second Actor will
     honor his promises,
     # keep secrets and not tell lies.
     #
     # Per Virtue – This variable represents the Virtue of one Actor as
     perceived by another, Per
     # Virtue towards another substitutes for Virtue in oneself. In other
     words, one person’s Per Virtue
     # for another operates in exactly the same way he would behave if he had
     similar amounts of
     # Virtue. Indeed, it might be best to add Virtue and Per Virtue together
     in calculations.
     #
     # Per Power – This variable indicates the relationship engendered by
     Power; it’s close
     # to fear. High values of Per Power induce an Actor to defer to the
     judgment and carry out
     # the wishes of the powerful one. An actor with little Per Power toward
     another is less inclined
     # to carry out the second Actor’s wishes. However, true fear is more
     precisely a combination
     # of Per Power and Per Virtue. In other words, an Actor doesn’t fear
     another unless he perceives
     # the second Actor to be powerful and amoral.
     #
     # Per Intelligence – This variable represents one Actor’s perception of
     another’s Intelligence;
     # it’s close to the concept of respect. Although respect can also
     represent high perceived Virtue
     # or even high perceived power. An Actor with high Per Intelligence for
     another defers to the
     # other’s judgment more readily. An Actor with low Per Intelligence for
     another doesn’t give
     # much weight to the other’s recommendations and wishes.
     #
     # Per Attractive – This variable indicates the degree to which an Actor
     perceives another as
     # attractive. This value might be heightened by Per Virtue, and vice
versa.
     #===========================================================

     class Personality_Engine
     
     #--------------------------------------------------------------------------
      attr_accessor :actors
      attr_accessor :npc
     
     #--------------------------------------------------------------------------
      def initialize
        @map_infos = nil
        @actors = {}
        @npc = {}
        setup
      end
     
     #--------------------------------------------------------------------------
      def setup
        # Set Starting Map
        map_id = $game_map.map_id
        # Setup Actors Personality
        for i in 1...$data_actors.size
          @actors[i] = Personalities.new
          @actors[i].character = $data_actors[i]
        end
        # Setup Events Personality
        @map_infos = load_data("Data/MapInfos.rxdata")
        for key in @map_infos.keys
          $game_map.setup(key)
          for i in $game_map.map.events.keys
            # key is map_id and event_id
            npc_key = [$game_map.map_id, $game_map.map.events[i].id]
            @npc[npc_key] = Personalities.new
            @npc[npc_key].map_id = $game_map.map_id
            @npc[npc_key].character = $game_map.map.events[i]
            setup_event_sterotype(npc_key, @npc[npc_key].character.name)
          end
        end
        # Setup Relationship Variables
        setup_relationship_variables(@npc)
        setup_relationship_variables(@actors)
        # Return to Starting Map
        $game_map.setup(map_id)
      end
     
     #--------------------------------------------------------------------------
      def get_key(event_id, map_id = $game_map.map_id)
        return [map_id, event_id]
      end
     
     #--------------------------------------------------------------------------
      def get_pre_key(type, type_id, map_id = $game_map.map_id)
        if type == "Event"
          return [type, [map_id, type_id]]
        else
          return [type, type_id]
        end
      end
     
     #--------------------------------------------------------------------------
      def setup_relationship_variables(character)
        for x in character.keys
          for y in @npc.keys
            key = ["Event", y]
            character[x].per_integrity[key] = 0
            character[x].per_virtue[key] = 0
            character[x].per_power[key] = 0
            character[x].per_intelligence[key] = 0
            character[x].per_attractive[key] = 0
          end
          for y in @actors.keys
            key = ["Actor", y]
            character[x].per_integrity[key] = 0
            character[x].per_virtue[key] = 0
            character[x].per_power[key] = 0
            character[x].per_intelligence[key] = 0
            character[x].per_attractive[key] = 0
          end
        end
      end
     
     #--------------------------------------------------------------------------
      def update
        # On Frame Update
        if Graphics.frame_count % Graphics.frame_rate == 0
          # Balance the NPC Anger_Fear, Joy_Sadness, Arousal_Disgust variables
          for i in $game_map.map.events.keys
            npc_key = [$game_map.map_id, $game_map.map.events[i].id]
            adrenaline = 100 - @npc[npc_key].adrenaline
            manic_depressive = 100 - @npc[npc_key].manic_depressive
            sensuality = 100 - @npc[npc_key].sensuality
            if @npc[npc_key].anger_fear > 0
              @npc[npc_key].anger_fear -= 1
            else
              @npc[npc_key].anger_fear += 1
            end
            if @npc[npc_key].joy_sadness > 0
              @npc[npc_key].joy_sadness -= 1
            else
              @npc[npc_key].joy_sadness +=1
            end
            if @npc[npc_key].arousal_disgust > 0
              @npc[npc_key].arousal_disgust -= 1
            else
              @npc[npc_key].arousal_disgust += 1
            end
          end
        end
        # Balance the Actors Anger_Fear, Joy_Sadness, Arousal_Disgust variables
        for i in 1...$data_actors.size
          adrenaline = 100 - @actors[i].adrenaline
          manic_depressive = 100 - @actors[i].manic_depressive
          sensuality = 100 - @actors[i].sensuality
          if @actors[i].anger_fear > 0
            @actors[i].anger_fear -= 1
          else
            @actors[i].anger_fear += 1
          end
          if @actors[i].joy_sadness > 0
            @actors[i].joy_sadness -= 1
          else
            @actors[i].joy_sadness += 1
          end
          if @actors[i].arousal_disgust > 0
            @actors[i].arousal_disgust -= 1
          else
            @actors[i].arousal_disgust += 1
          end
        end
      end
     
     #--------------------------------------------------------------------------
      def level_up(actor_id)
        @actors[actor_id].integrity += 1
        @actors[actor_id].virtue += 1
        @actors[actor_id].power += 1
        @actors[actor_id].intelligence += 1
        @actors[actor_id].attractiveness += 1
      end
     
     #--------------------------------------------------------------------------
      def setup_event_sterotype(npc_key,name)
        # Add More NPC Sterotypes
        case name
        when "Warrior"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 50
          @npc[npc_key].virtue = 80
          @npc[npc_key].power = 70
          @npc[npc_key].intelligence = 50
          @npc[npc_key].attractiveness = 40
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 70
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = 0
          @npc[npc_key].accord_virtue = -70
          @npc[npc_key].accord_power = -70
          @npc[npc_key].accord_intelligence = 0
          @npc[npc_key].accord_attractive = 0
        when "Thief"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 10
          @npc[npc_key].virtue = 10
          @npc[npc_key].power = 20
          @npc[npc_key].intelligence = 60
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 80
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = -30
          @npc[npc_key].accord_virtue = 50
          @npc[npc_key].accord_power = -80
          @npc[npc_key].accord_intelligence = -50
          @npc[npc_key].accord_attractive = 0
        when "Hunter"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 50
          @npc[npc_key].virtue = 60
          @npc[npc_key].power = 50
          @npc[npc_key].intelligence = 50
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 30
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = 0
          @npc[npc_key].accord_virtue = -80
          @npc[npc_key].accord_power = -20
          @npc[npc_key].accord_intelligence = -20
          @npc[npc_key].accord_attractive = 0
        when "Trader"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 10
          @npc[npc_key].virtue = 40
          @npc[npc_key].power = 10
          @npc[npc_key].intelligence = 60
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 80
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = -60
          @npc[npc_key].accord_virtue = 30
          @npc[npc_key].accord_power = 70
          @npc[npc_key].accord_intelligence = -10
          @npc[npc_key].accord_attractive = 0
        when "Grappler"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 10
          @npc[npc_key].virtue = 10
          @npc[npc_key].power = 40
          @npc[npc_key].intelligence = 10
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 80
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = 0
          @npc[npc_key].accord_virtue = 50
          @npc[npc_key].accord_power = -50
          @npc[npc_key].accord_intelligence = -50
          @npc[npc_key].accord_attractive = 0
        when "Soldier"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 10
          @npc[npc_key].virtue = 100
          @npc[npc_key].power = 90
          @npc[npc_key].intelligence = 50
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 20
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = 10
          @npc[npc_key].accord_virtue = -80
          @npc[npc_key].accord_power = -50
          @npc[npc_key].accord_intelligence = 30
          @npc[npc_key].accord_attractive = 0
        when "Civilian"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 10
          @npc[npc_key].virtue = 40
          @npc[npc_key].power = 10
          @npc[npc_key].intelligence = 40
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 50
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = 40
          @npc[npc_key].accord_virtue = 10
          @npc[npc_key].accord_power = 80
          @npc[npc_key].accord_intelligence = 80
          @npc[npc_key].accord_attractive = 0
        when "Noble"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 10
          @npc[npc_key].virtue = 10
          @npc[npc_key].power = 50
          @npc[npc_key].intelligence = 40
          @npc[npc_key].attractiveness = 60
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 50
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = 50
          @npc[npc_key].accord_virtue = 40
          @npc[npc_key].accord_power = -10
          @npc[npc_key].accord_intelligence = -60
          @npc[npc_key].accord_attractive = 0
        when "Bartender"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 10
          @npc[npc_key].virtue = 10
          @npc[npc_key].power = 30
          @npc[npc_key].intelligence = 50
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 40
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = 20
          @npc[npc_key].accord_virtue = 20
          @npc[npc_key].accord_power = 30
          @npc[npc_key].accord_intelligence = -10
          @npc[npc_key].accord_attractive = 0
        when "Farmer"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 20
          @npc[npc_key].virtue = 50
          @npc[npc_key].power = 10
          @npc[npc_key].intelligence = 40
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 70
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = 60
          @npc[npc_key].accord_virtue = 50
          @npc[npc_key].accord_power = 80
          @npc[npc_key].accord_intelligence = 30
          @npc[npc_key].accord_attractive = 0
        when "Storekeeper"
          #Intrinsic Variables 0 to 100
          @npc[npc_key].integrity = 30
          @npc[npc_key].virtue = 40
          @npc[npc_key].power = 30
          @npc[npc_key].intelligence = 50
          @npc[npc_key].attractiveness = 50
          #Volatility Variables 0 to 100
          @npc[npc_key].adrenaline = 30
          @npc[npc_key].manic_depressive = 0
          @npc[npc_key].sensuality = 0
          #Accordance Variables 100 to -100
          @npc[npc_key].accord_integrity = -20
          @npc[npc_key].accord_virtue = 30
          @npc[npc_key].accord_power = 40
          @npc[npc_key].accord_intelligence = -10
          @npc[npc_key].accord_attractive = 0
        end
      end
     end

     #===========================================================
     class Personalities
     
     #--------------------------------------------------------------------------
      attr_accessor :map_id
      attr_accessor :character
      attr_accessor :alignment
      attr_accessor :integrity
      attr_accessor :virtue
      attr_accessor :power
      attr_accessor :intelligence
      attr_accessor :attractiveness
      attr_accessor :anger_fear
      attr_accessor :joy_sadness
      attr_accessor :arousal_disgust
      attr_accessor :adrenaline
      attr_accessor :manic_depressive
      attr_accessor :sensuality
      attr_accessor :accord_integrity
      attr_accessor :accord_virtue
      attr_accessor :accord_power
      attr_accessor :accord_intelligence
      attr_accessor :accord_attractive
      attr_accessor :per_integrity
      attr_accessor :per_virtue
      attr_accessor :per_power
      attr_accessor :per_intelligence
      attr_accessor :per_attractive
     
     #--------------------------------------------------------------------------
      def initialize
        # NPC Index
        @map_id = 0
        @character = nil
        @alignment = 0
        # Intrinsic Variables Set with NPC Sterotypes and Actors Set 10%
        @integrity = 10
        @virtue = 10
        @power = 10
        @intelligence = 10
        @attractiveness = 10
        # Volatility Variables Set with NPC Sterotypes
        @adrenaline = 0
        @manic_depressive = 0
        @sensuality = 0
        # Mood Variables Set at 0 %
        @anger_fear = 0
        @joy_sadness = 0
        @arousal_disgust = 0
        # Accordance Variables Set with NPC Sterotypes
        @accord_integrity = 0
        @accord_virtue = 0
        @accord_power = 0
        @accord_intelligence = 0
        @accord_attractive = 0
        # Relationship Variables Set at 0 % for all characters
        @per_integrity = {}
        @per_virtue = {}
        @per_power = {}
        @per_intelligence = {}
        @per_attractive = {}
      end
     end

     #===========================================================
     class Scene_Title
     
     #--------------------------------------------------------------------------
      alias pe_scene_title_command_new_game command_new_game
     
     #--------------------------------------------------------------------------
      def command_new_game
        pe_scene_title_command_new_game
        $pe = Personality_Engine.new
      end
     end

     #========================================================
     class Scene_Load
     def read_save_data(file)
       characters = Marshal.load(file)
       Graphics.frame_count = Marshal.load(file)
       $game_system        = Marshal.load(file)
       $game_switches      = Marshal.load(file)
       $game_variables     = Marshal.load(file)
       $game_self_switches = Marshal.load(file)
       $game_screen        = Marshal.load(file)
       $game_actors        = Marshal.load(file)
       $game_party         = Marshal.load(file)
       $game_troop         = Marshal.load(file)
       $game_map             = Marshal.load(file)
       $game_player           = Marshal.load(file)
       $personality_engine  = Marshal.load(file)
       if $game_system.magic_number != $data_system.magic_number
         $game_map.setup($game_map.map_id)
         $game_player.center($game_player.x, $game_player.y)
       end
       $game_party.refresh
     end
     end

     #=======================================================
     class Scene_Save
     def write_save_data(file)
       characters = []
       for i in 0...$game_party.actors.size
         actor = $game_party.actors[i]
         characters.push([actor.character_name, actor.character_hue])
       end
       Marshal.dump(characters, file)
       Marshal.dump(Graphics.frame_count, file)
       $game_system.save_count += 1
       $game_system.magic_number = $data_system.magic_number
       Marshal.dump($game_system, file)
       Marshal.dump($game_switches, file)
       Marshal.dump($game_variables, file)
       Marshal.dump($game_self_switches, file)
       Marshal.dump($game_screen, file)
       Marshal.dump($game_actors, file)
       Marshal.dump($game_party, file)
       Marshal.dump($game_troop, file)
       Marshal.dump($game_map, file)
       Marshal.dump($game_player, file)
       Marshal.dump($personality_engine,file)
     end
     end

     #===========================================================
     class Game_Map
     
     #--------------------------------------------------------------------------
      attr_accessor :map
     end
espero que me puedan ayudar..

#2 Re: [RM XP] ayuda con un script el Mar Oct 07, 2014 10:40 pm

Tomate

avatar
¡Hola, link09! A ver...¿qué tipo de errores salen? ¿en qué momento? ¿durante alguna acción en particular?

La clásica pregunta en estos temas: ¿Puede ser un error de compatibilidad? ¿Has probado el script en un proyecto en limpio, sin scripts agregados? ¿funciona bien allí?

No dispongo del RPG Maker XP, pero busqué en foros en Inglés el post original del autor y puedo deducir que su idioma madre no es el inglés, pues tiene una gramática un tanto confusa para escribir. A demás, es un script bastante complejo, deberás sentarte a leer y estudiarlo bien para comprender cómo funciona, no todos son "plug & play".

Ojalá encuentres alguna solución, que mis preguntes te orienten, o que un programador pueda responder mejor.

Saludines. Ópalo Sonriente

Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje [Página 1 de 1.]

Permisos de este foro:
No puedes responder a temas en este foro.