Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

4 Pages V  < 1 2 3 4 >  
Reply to this topicStart new topic
> The Script Builders' Help Topic, Get General Script Support Here.
tagg1080
post Jan 13 2010, 04:02 PM
Post #41


Level 2
Group Icon

Group: Member
Posts: 19
Type: Developer
RM Skill: Beginner




QUOTE (Night_Runner @ Jan 11 2010, 12:45 AM) *
The problem is that $game_variables isn't yet defined ....
Somewhere in Scene_Title it defines $game_variables = Game_Variables.new, but it reaches this bit of code before it reaches Scene_Title ....

Sorry, ummmmmmmmm, try something like this, it's mostly the same, but kinda not....


[Show/Hide] some code....
CODE
#===============================================================================
   # >  [VX]  Rei Levelup Stat Randomizer  
   #-------------------------------------------------------------------------------
   # >  by reijubv [aruyasoft@comic.com]
   # >  RPG RPG Revolution
   # >  Released on: 27/04/2009
   # >  Version: 1.1 (April 25th 2009)
   #-------------------------------------------------------------------------------
   # > Changelog:
   #   V.1.0 (25-04-09) = Initial release
   #   V.1.1 (29-04-09) = Added a function to restore HP/MP to max when level up
   #   V.1.1a (30-04-09) = Fixed a small bug wich I forgot to write something in
   #                                    the script that can makes the game crashes.....
   #-------------------------------------------------------------------------------
   # >  Information:
   # This script will modify an actor's stats gain on level up by a random number
   # between maximum and minimum amount that you can specify for each actors.
   # For example, you set an actor's minimum AGI stat to 1 and maximum AGI stat to 5,
   # when that actor gains a level, he/she'll gains AGI by random number between 1 to 5!
   # I suggest you set actor's stats in database to the same from his/her starting level
   # to 99, so if in database your actor's HP at starting level is 100, from that level
   # to 99 the HP should not be changed! This's just a suggestion anyway....
   #-------------------------------------------------------------------------------
   # >  Compatibility :
   #
   #   * Aliases :
   #               class Game_Actor
   #                 def setup
   #                 def base_maxhp
   #                 def base_maxmp
   #                 def base_atk
   #                 def base_def
   #                 def base_spi
   #                 def base_agi
   #                 def hit
   #                 def eva
   #                 def cri
   #   * Rewrites :
   #               class Game_Actor
   #                 def level_up
   #                 def level_down
   #-------------------------------------------------------------------------------
   # Credit reijubv if you use this script....
   # Credit woratana for his recover HP/MP/States when Level Up script
   #-------------------------------------------------------------------------------
   # > Installation:
   # Put this script above main, setup script below.
   #==========================================================================
   module Rei
     module RandStat
      #----------------------------------------------------------------------------
      # * Create Arrays
      #----------------------------------------------- ----------------------------
       Actor_MaxInc = Array.new
       Actor_MinInc = Array.new
      #----------------------------------------------------------------------------
      # * HP/MP/STATE Restoration Setting (CREDIT TO WORATANA FOR THIS FUNCTIONS)
      #----------------------------------------------------------------------------
       RECOVER_HP    = true # Recover HP when level up? (true/false)
       RECOVER_MP    = true # Recover MP when level up?
       REMOVE_STATES = true # Cure all states when level up?
      #--------------------Setup each actors below----------------------------------    
      # Use this template :
      #
      # Actor_MaxInc[#] = [maxHP,maxMP,maxATK,maxDEF,maxSPI,maxAGI,maxHIT,maxEVA,maxCRI]
      # >  This setup actor #'s each stats' maximum increments
      #
      # Actor_MinInc[#] = [minHP,minMP,minATK,minDEF,minSPI,minAGI,minHIT,minEVA,minCRI]
      # >  This setup actor #'s each stats' minimum increments  
      #  
      # Use 0 if you don't want to increase any stat on level up
      #
      # Note : >Actor_MaxInc should be higher than Actor_MinInc!
      #        >Don't use negative values, or your actor's stats would be messed up!
      #        >Don't forget to setup max and min value for EVERY actors that you used
      #         in your game!
      #
      # Just in case that you don't know :
      #
      # HP  = Hit Points          DEF = Defense        HIT = Hit rate
      # MP  = Magic Points        SPI = Spirit        EVA = Evasion rate
      # ATK = Attack              AGI = Agility        CRI = Critical rate
      #----------------------------------------------------------------------------
      #Samples  :
      #         actorId   HP MP ATK DEF SPI AGI HIT EVA CRI
      #--------------------------------------------------------------------------
      # Maximum Increment
      #--------------------------------------------------------------------------
      def Actor_MaxInc(actor_id, stat)
        return if $game_variables.nil?
        actor_MaxInc[1] = [ $game_variables[8] , 3 ,3 , 3 , 1 , 2 , 0 , 0 , 0] #Maximum increment
        #etc
        return actor_MaxInc[actor_id][stat]
      end
      #--------------------------------------------------------------------------
      # Minimum increment
      #--------------------------------------------------------------------------
      def Actor_MinInc(actor_id, stat)
        return if $game_variables.nil?
        actor_MinInc[1] = [ $game_variables[9] , 1 ,1 , 1 , 0 , 1 , 0 , 0 , 0] #Minimum increment
        # etc
        return actor_MinInc[actor_id][stat]
      end
     end
   end
  
   #==========================================================================
   # ** Game_Actor
   #------------------------------------------------------------------------------
   #  This class handles actors. Its used within the Game_Actors class
   # ($game_actors) and referenced by the Game_Party class ($game_party).
   #==========================================================================

  
   class Game_Actor < Game_Battler
     #--------------------------------------------------------------------------
     # * Setup
     #     actor_id : actor ID
     #--------------------------------------------------------------------------
     alias reisetup setup
     def setup(actor_id)
       @stat_gains = {}
       for i in 0..8
         @stat_gains[i] = []
       end
       reisetup(actor_id)
     end
     #--------------------------------------------------------------------------
     # * Get Basic Maximum HP
     #--------------------------------------------------------------------------
     alias reibasemaxhp base_maxhp
     def base_maxhp
       n = reibasemaxhp
       n+= @stat_gains[0].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get basic Maximum MP
     #--------------------------------------------------------------------------
     alias reibasemaxmp base_maxmp
     def base_maxmp
       n = reibasemaxmp
       n+= @stat_gains[1].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Basic Attack
     #--------------------------------------------------------------------------
     alias reibaseatk base_atk
     def base_atk
       n = reibaseatk
       n+= @stat_gains[2].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Basic Defense
     #--------------------------------------------------------------------------
     alias reibasedef base_def
     def base_def
       n = reibasedef
       n+= @stat_gains[3].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Basic Spirit
     #--------------------------------------------------------------------------
     alias reibasespi base_spi
     def base_spi
       n = reibasespi
       n+= @stat_gains[4].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Basic Agility
     #--------------------------------------------------------------------------
     alias reibaseagi base_agi
     def base_agi
       n = reibaseagi
       n+= @stat_gains[5].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Hit Rate
     #--------------------------------------------------------------------------
     alias reihit hit
     def hit
       n = reihit
       n+= @stat_gains[6].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Evasion Rate
     #--------------------------------------------------------------------------
     alias reieva eva
     def eva
       n = reieva
       n+= @stat_gains[7].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Critical Ratio
     #--------------------------------------------------------------------------
     alias reicri cri
     def cri
       n = reicri
       n+= @stat_gains[8].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Level Up
     #--------------------------------------------------------------------------
     def level_up
       r = {}
       a = {}
       b = {}
       @level += 1
       for i in 0..8
         a[i] = Rei::RandStat::Actor_MaxInc(@actor_id, i)
         b[i] = Rei::RandStat::Actor_MinInc(@actor_id, i)
         r[i] = b[i]+rand(a[i]-b[i]+1)
         if r[i] <= Rei::RandStat::Actor_MinInc(@actor_id, i) then
           r[i] = Rei::RandStat::Actor_MinInc(@actor_id, i)
         end
         if r[i] >= Rei::RandStat::Actor_MaxInc(@actor_id, i) then
           r[i] = Rei::RandStat::Actor_MaxInc(@actor_id, i)
         end
         @stat_gains[i] << r[i]
       end
      
       #from woratana's script v
       @hp = maxhp if Rei::RandStat::RECOVER_HP
       @mp = maxmp if Rei::RandStat::RECOVER_MP
       if Rei::RandStat::REMOVE_STATES
         @states.clone.each {|i| remove_state(i) }
       end
       #from woratana's script ^
      
       for learning in self.class.learnings
         learn_skill(learning.skill_id) if learning.level == @level
       end
     end
     #--------------------------------------------------------------------------
     # * Level Down
     #--------------------------------------------------------------------------
     def level_down
       @level-= 1
       for i in 0..8
         @stat_gains[i].pop
       end
     end
   end
   #==========================================================================
   # ** Array
   #------------------------------------------------------------------------------
   #  This hidden class handles arrays. It is used within many other
   # classes to store data for future retrieval.
   #==========================================================================

   class Array
     #---------------------------------------------------------------------------
     # * Name      : Sum
     #   Info      : Sums all values in the array
     #   Author    : Trickster
     #   Call Info : No Arguments
     #---------------------------------------------------------------------------
     def sum
       # Initialize local variable n
       n = 0
       # Sum Up Values in Array
       each {|num| n += num}
       # Return number
       return n
     end
   end


It doesn't error out, but then again, I have no idea what the script actually does or how it works (sorry)

If it doesn't work, it will need a more manual approach, so I'll need to know specifically which stats follow a variable, and it will be applied to every actor...



I am not at my desktop, so I can't check, but will later, thanks for the help.


__________________________
-Taggerung
Go to the top of the page
 
+Quote Post
   
Darkreaper
post Jan 24 2010, 09:56 AM
Post #42


Level 11
Group Icon

Group: Revolutionary
Posts: 171
Type: Developer
RM Skill: Advanced




In RM2k and 2k3 there were the options to swap tiles and even change entire tilesets. These features are absent in rmxp, any chance a script could be coded to bring them back?


__________________________



Go to the top of the page
 
+Quote Post
   
Holder
post Jan 24 2010, 11:50 AM
Post #43


Spoilers.
Group Icon

Group: Revolutionary
Posts: 4,203
Type: Developer
RM Skill: Advanced
Rev Points: 250




I'd like to make a suggestion for a future tutorial, it's basically an instructional one.

The main focus is how to find out what code to use, say for example there's no one you can ask, How could you discover how to say for example insert an image, even if the solution is within the help file, instructions on what part of the help file to check, how to look through the default scripts to find a similar line etc.

Just so when someone comes to the point where they wish to try something themselves without the answer there in front of them can go about searching and discovering it, without help.


__________________________

 I'm running the Great North Run in September in aid of NACC. A condition my wife has in it's severe form.
Please sponsor me with whatever you can, thank you.
If you'd like to help spread the word please share the image and link to my fundraising page.

Go to the top of the page
 
+Quote Post
   
Darkreaper
post Jan 24 2010, 12:49 PM
Post #44


Level 11
Group Icon

Group: Revolutionary
Posts: 171
Type: Developer
RM Skill: Advanced




yeah, now if only i read hiragana laugh.gif


__________________________



Go to the top of the page
 
+Quote Post
   
The Law G14
post Jan 24 2010, 04:02 PM
Post #45


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




@Darkreaper: So do you still need the script lol?

@Holder: I'm discussing it with another member of the Script Builders since we're also trying to make a tutorial about scenes so one of us will do your idea and the other will do the tutorial about scenes smile.gif


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Darkreaper
post Jan 24 2010, 06:04 PM
Post #46


Level 11
Group Icon

Group: Revolutionary
Posts: 171
Type: Developer
RM Skill: Advanced




QUOTE (The Law G14 @ Jan 24 2010, 04:02 PM) *
@Darkreaper: So do you still need the script lol?

@Holder: I'm discussing it with another member of the Script Builders since we're also trying to make a tutorial about scenes so one of us will do your idea and the other will do the tutorial about scenes smile.gif


well technically i need a few scripts laugh.gif but ive tried to work around the cooking one, for now im just using eventing. But im also trying to get the populate script to work, without much success


__________________________



Go to the top of the page
 
+Quote Post
   
The Law G14
post Jan 25 2010, 02:11 PM
Post #47


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Populate script? Try posting it and I'll see what I can do for you. Also, post the error or whatever is causing you problems with the script smile.gif


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Darkreaper
post Jan 25 2010, 06:25 PM
Post #48


Level 11
Group Icon

Group: Revolutionary
Posts: 171
Type: Developer
RM Skill: Advanced




#=========================================================================
=====
# ** Auto Populate Maps by Charlie Fleed
#
# Version: 0.4
# Author: Charlie Fleed
# Edited by: Night_Runner
#==============================================================================



class Interpreter
#--------------------------------------------------------------------------
# ● Populate At:
# creates a copy at the coordinates
#--------------------------------------------------------------------------
def populate_at(event_id, x, y)
# Get the event_id, x, and y from the game's variables
event_id = $game_variables[30]
x = $game_variables[86]
y = $game_variables[87]
# Duplicate the Event.
e = $game_map.events[event_id].event.dup
# Get the event_id
i=1
events_positions=[]
while $game_map.events[i]!=nil
i+=1
end
e.id=i
# Create the event
ge = Game_Event.new($game_map.map_id, e)
$game_map.events[i] = ge
$game_map.events[i].moveto(x,y)
events_positions.push([x,y])
# Update the map to include the new event.
$game_map.refresh
$game_map.update
if $scene.is_a?(Scene_Map)
$scene.spriteset.dispose
$scene.spriteset = Spriteset_Map.new
end
end
end



class Game_Map
attr_reader :map
end



class Game_Event < Game_Character
attr_reader :event
end


#==============================================================================
# END OF SCRIPT
#==============================================================================


Name Error
undefined local variable or method 'x' for #<Interpreter:0x2dc70e8>


__________________________



Go to the top of the page
 
+Quote Post
   
Fixxxer4153
post Feb 7 2010, 07:29 AM
Post #49


Level 10
Group Icon

Group: Revolutionary
Posts: 155
Type: Developer
RM Skill: Beginner




QUOTE (tagg1080 @ Jan 13 2010, 07:02 PM) *
QUOTE (Night_Runner @ Jan 11 2010, 12:45 AM) *
The problem is that $game_variables isn't yet defined ....
Somewhere in Scene_Title it defines $game_variables = Game_Variables.new, but it reaches this bit of code before it reaches Scene_Title ....

Sorry, ummmmmmmmm, try something like this, it's mostly the same, but kinda not....


[Show/Hide] some code....
CODE
#===============================================================================
   # >  [VX]  Rei Levelup Stat Randomizer  
   #-------------------------------------------------------------------------------
   # >  by reijubv [aruyasoft@comic.com]
   # >  RPG RPG Revolution
   # >  Released on: 27/04/2009
   # >  Version: 1.1 (April 25th 2009)
   #-------------------------------------------------------------------------------
   # > Changelog:
   #   V.1.0 (25-04-09) = Initial release
   #   V.1.1 (29-04-09) = Added a function to restore HP/MP to max when level up
   #   V.1.1a (30-04-09) = Fixed a small bug wich I forgot to write something in
   #                                    the script that can makes the game crashes.....
   #-------------------------------------------------------------------------------
   # >  Information:
   # This script will modify an actor's stats gain on level up by a random number
   # between maximum and minimum amount that you can specify for each actors.
   # For example, you set an actor's minimum AGI stat to 1 and maximum AGI stat to 5,
   # when that actor gains a level, he/she'll gains AGI by random number between 1 to 5!
   # I suggest you set actor's stats in database to the same from his/her starting level
   # to 99, so if in database your actor's HP at starting level is 100, from that level
   # to 99 the HP should not be changed! This's just a suggestion anyway....
   #-------------------------------------------------------------------------------
   # >  Compatibility :
   #
   #   * Aliases :
   #               class Game_Actor
   #                 def setup
   #                 def base_maxhp
   #                 def base_maxmp
   #                 def base_atk
   #                 def base_def
   #                 def base_spi
   #                 def base_agi
   #                 def hit
   #                 def eva
   #                 def cri
   #   * Rewrites :
   #               class Game_Actor
   #                 def level_up
   #                 def level_down
   #-------------------------------------------------------------------------------
   # Credit reijubv if you use this script....
   # Credit woratana for his recover HP/MP/States when Level Up script
   #-------------------------------------------------------------------------------
   # > Installation:
   # Put this script above main, setup script below.
   #==========================================================================
   module Rei
     module RandStat
      #----------------------------------------------------------------------------
      # * Create Arrays
      #----------------------------------------------- ----------------------------
       Actor_MaxInc = Array.new
       Actor_MinInc = Array.new
      #----------------------------------------------------------------------------
      # * HP/MP/STATE Restoration Setting (CREDIT TO WORATANA FOR THIS FUNCTIONS)
      #----------------------------------------------------------------------------
       RECOVER_HP    = true # Recover HP when level up? (true/false)
       RECOVER_MP    = true # Recover MP when level up?
       REMOVE_STATES = true # Cure all states when level up?
      #--------------------Setup each actors below----------------------------------    
      # Use this template :
      #
      # Actor_MaxInc[#] = [maxHP,maxMP,maxATK,maxDEF,maxSPI,maxAGI,maxHIT,maxEVA,maxCRI]
      # >  This setup actor #'s each stats' maximum increments
      #
      # Actor_MinInc[#] = [minHP,minMP,minATK,minDEF,minSPI,minAGI,minHIT,minEVA,minCRI]
      # >  This setup actor #'s each stats' minimum increments  
      #  
      # Use 0 if you don't want to increase any stat on level up
      #
      # Note : >Actor_MaxInc should be higher than Actor_MinInc!
      #        >Don't use negative values, or your actor's stats would be messed up!
      #        >Don't forget to setup max and min value for EVERY actors that you used
      #         in your game!
      #
      # Just in case that you don't know :
      #
      # HP  = Hit Points          DEF = Defense        HIT = Hit rate
      # MP  = Magic Points        SPI = Spirit        EVA = Evasion rate
      # ATK = Attack              AGI = Agility        CRI = Critical rate
      #----------------------------------------------------------------------------
      #Samples  :
      #         actorId   HP MP ATK DEF SPI AGI HIT EVA CRI
      #--------------------------------------------------------------------------
      # Maximum Increment
      #--------------------------------------------------------------------------
      def Actor_MaxInc(actor_id, stat)
        return if $game_variables.nil?
        actor_MaxInc[1] = [ $game_variables[8] , 3 ,3 , 3 , 1 , 2 , 0 , 0 , 0] #Maximum increment
        #etc
        return actor_MaxInc[actor_id][stat]
      end
      #--------------------------------------------------------------------------
      # Minimum increment
      #--------------------------------------------------------------------------
      def Actor_MinInc(actor_id, stat)
        return if $game_variables.nil?
        actor_MinInc[1] = [ $game_variables[9] , 1 ,1 , 1 , 0 , 1 , 0 , 0 , 0] #Minimum increment
        # etc
        return actor_MinInc[actor_id][stat]
      end
     end
   end
  
   #==========================================================================
   # ** Game_Actor
   #------------------------------------------------------------------------------
   #  This class handles actors. Its used within the Game_Actors class
   # ($game_actors) and referenced by the Game_Party class ($game_party).
   #==========================================================================

  
   class Game_Actor < Game_Battler
     #--------------------------------------------------------------------------
     # * Setup
     #     actor_id : actor ID
     #--------------------------------------------------------------------------
     alias reisetup setup
     def setup(actor_id)
       @stat_gains = {}
       for i in 0..8
         @stat_gains[i] = []
       end
       reisetup(actor_id)
     end
     #--------------------------------------------------------------------------
     # * Get Basic Maximum HP
     #--------------------------------------------------------------------------
     alias reibasemaxhp base_maxhp
     def base_maxhp
       n = reibasemaxhp
       n+= @stat_gains[0].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get basic Maximum MP
     #--------------------------------------------------------------------------
     alias reibasemaxmp base_maxmp
     def base_maxmp
       n = reibasemaxmp
       n+= @stat_gains[1].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Basic Attack
     #--------------------------------------------------------------------------
     alias reibaseatk base_atk
     def base_atk
       n = reibaseatk
       n+= @stat_gains[2].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Basic Defense
     #--------------------------------------------------------------------------
     alias reibasedef base_def
     def base_def
       n = reibasedef
       n+= @stat_gains[3].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Basic Spirit
     #--------------------------------------------------------------------------
     alias reibasespi base_spi
     def base_spi
       n = reibasespi
       n+= @stat_gains[4].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Basic Agility
     #--------------------------------------------------------------------------
     alias reibaseagi base_agi
     def base_agi
       n = reibaseagi
       n+= @stat_gains[5].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Hit Rate
     #--------------------------------------------------------------------------
     alias reihit hit
     def hit
       n = reihit
       n+= @stat_gains[6].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Evasion Rate
     #--------------------------------------------------------------------------
     alias reieva eva
     def eva
       n = reieva
       n+= @stat_gains[7].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Get Critical Ratio
     #--------------------------------------------------------------------------
     alias reicri cri
     def cri
       n = reicri
       n+= @stat_gains[8].sum
       return n
     end
     #--------------------------------------------------------------------------
     # * Level Up
     #--------------------------------------------------------------------------
     def level_up
       r = {}
       a = {}
       b = {}
       @level += 1
       for i in 0..8
         a[i] = Rei::RandStat::Actor_MaxInc(@actor_id, i)
         b[i] = Rei::RandStat::Actor_MinInc(@actor_id, i)
         r[i] = b[i]+rand(a[i]-b[i]+1)
         if r[i] <= Rei::RandStat::Actor_MinInc(@actor_id, i) then
           r[i] = Rei::RandStat::Actor_MinInc(@actor_id, i)
         end
         if r[i] >= Rei::RandStat::Actor_MaxInc(@actor_id, i) then
           r[i] = Rei::RandStat::Actor_MaxInc(@actor_id, i)
         end
         @stat_gains[i] << r[i]
       end
      
       #from woratana's script v
       @hp = maxhp if Rei::RandStat::RECOVER_HP
       @mp = maxmp if Rei::RandStat::RECOVER_MP
       if Rei::RandStat::REMOVE_STATES
         @states.clone.each {|i| remove_state(i) }
       end
       #from woratana's script ^
      
       for learning in self.class.learnings
         learn_skill(learning.skill_id) if learning.level == @level
       end
     end
     #--------------------------------------------------------------------------
     # * Level Down
     #--------------------------------------------------------------------------
     def level_down
       @level-= 1
       for i in 0..8
         @stat_gains[i].pop
       end
     end
   end
   #==========================================================================
   # ** Array
   #------------------------------------------------------------------------------
   #  This hidden class handles arrays. It is used within many other
   # classes to store data for future retrieval.
   #==========================================================================

   class Array
     #---------------------------------------------------------------------------
     # * Name      : Sum
     #   Info      : Sums all values in the array
     #   Author    : Trickster
     #   Call Info : No Arguments
     #---------------------------------------------------------------------------
     def sum
       # Initialize local variable n
       n = 0
       # Sum Up Values in Array
       each {|num| n += num}
       # Return number
       return n
     end
   end


It doesn't error out, but then again, I have no idea what the script actually does or how it works (sorry)

If it doesn't work, it will need a more manual approach, so I'll need to know specifically which stats follow a variable, and it will be applied to every actor...



I am not at my desktop, so I can't check, but will later, thanks for the help.


Hey I have a couple of questions about this Stat Randomization Script...

First off, is there a version of it for RMXP?
And if there is, does anyone think it could be modded to work with Blizzards' CSGS (Custom Stat Growing System)?
Because Blizzards' system eliminates leveling, this stat randomization script isn't exactly compatible, that is, even if there's a version of it for XP.

Anyway, if it could, then in-game once your actor reaches their limit for actions determining a stat increase, instead of raising the stat by a set amount, raises it by a random number between a min and max, giving the effect that your stat increases aren't always the same, and could possibly give you the illusion of a die roll system like D&D 3.5 rules where once you've earned the stat increase (in D&D its a level up) then the die of your size (obviously governed by the min and max; in D&D it's set by which class you are) is rolled to configure how much of a bonus you'd receive to that stat.

If something like that would be more work that its worth then never mind, but it would be a cool aspect to add to an already D&D-esque rpg.


__________________________
"Then it comes to be that the soothing light at the end of your tunnel... is just a freight train comin' your way..."


Which Final Fantasy Character Are You?
Final Fantasy 7
Go to the top of the page
 
+Quote Post
   
mikesp86
post Apr 4 2010, 08:53 AM
Post #50


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Beginner




i'm getting an error with rpg advpcates two handed weapon script on line 119



heres the script im using

CODE

# Two-Handed Weapons
# by RPG Advocate


#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================

class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :two_handed_weapons # array of two-handed weapons
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias twohanded_initialize initialize
def initialize
twohanded_initialize
@two_handed_weapons = []
end
end




#==============================================================================
# ** Window_EquipRight
#------------------------------------------------------------------------------
# This window displays items the actor is currently equipped with on the
# equipment screen.
#==============================================================================

class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :translucent_text
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
alias twoh_initialize initialize
def initialize(actor)
@translucent_text = [false, false]
twoh_initialize(actor)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias twoh_refresh refresh
def refresh
# Perform the original call
twoh_refresh
draw_item_name(@data[0], 92, 32 * 0, @translucent_text[0])
draw_item_name(@data[1], 92, 32 * 1, @translucent_text[1])
draw_item_name(@data[2], 92, 32 * 2, false)
draw_item_name(@data[3], 92, 32 * 3, false)
draw_item_name(@data[4], 92, 32 * 4, false)
end
#--------------------------------------------------------------------------
# * Draw Item Name
# item : item
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# translucent : translucent
#--------------------------------------------------------------------------
def draw_item_name(item, x, y, translucent = true)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
if translucent
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), 128)
self.contents.font.color = disabled_color
else
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 28, y, 212, 32, item.name)
end
end





#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
# This class performs equipment screen processing.
#==============================================================================

class Scene_Equip

#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias twoh_refresh refresh
def refresh
# The original call
twoh_refresh
# Get currently equipped item
item1 = @right_window.item
# If item window is active
if @item_window.active
# Get currently selected item
item2 = @item_window.item
item3 = @actor.armor1_id
item4 = @actor.weapon_id
# Change equipment
last_hp = @actor.hp
last_sp = @actor.sp
w = item2.id
if item2.is_a?(RPG::Weapon) && $game_system.two_handed_weapons.include?(w)
@right_window.translucent_text = [false, true]
@right_window.refresh
@actor.equip(1, 0)
end
if item2.is_a?(RPG::Armor) && item2.kind == 0 &&
$game_system.two_handed_weapons.include?(@actor.weapon_id)
@right_window.translucent_text = [true, false]
@right_window.refresh
flag = true
@actor.equip(0, 0)
end
# Get parameters for after equipment change
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
# Return equipment
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
if item2.is_a?(RPG::Weapon) && $game_system.two_handed_weapons.include?(w)
@actor.equip(1, item3)
end
if item2.is_a?(RPG::Armor) && item2.kind == 0 && flag
@actor.equip(0, item4)
end
@actor.hp = last_hp
@actor.sp = last_sp
# Draw in left window
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias twoh_update update
def update
# If item_window value is changed
if @item_window.index != @old_index
@right_window.translucent_text = [false, false]
@right_window.refresh
end
@old_index = @item_window.index
# Perform the original call
twoh_update
end
#--------------------------------------------------------------------------
# * Frame Update (when item window is active)
#--------------------------------------------------------------------------
def update_item
# If B button was pressed
if Input.trigger?(Input::cool.gif
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Activate right window
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play equip SE
$game_system.se_play($data_system.equip_se)
# Get currently selected data on the item window
item = @item_window.item
# Change equipment
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
# Obtain id of item selected
w = item.id
# If two-handed weapon selected, equip weapon remove shield
if item.is_a?(RPG::Weapon) && $game_system.two_handed_weapons.include?(w)
@actor.equip(1, 0)
end
# if shield selected and two-handed equipped, remove two-handed weapon
if item.is_a?(RPG::Armor) && item.kind == 0 &&
$game_system.two_handed_weapons.include?(@actor.weapon_id)
@actor.equip(0, 0)
end
# Activate right window
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# Remake right window and item window contents
@right_window.refresh
@item_window.refresh
# Refresh item windows
@item_window1.refresh
@item_window2.refresh
return
end
end
end



Go to the top of the page
 
+Quote Post
   
Night_Runner
post Apr 4 2010, 11:39 PM
Post #51


Level 50
Group Icon

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed




What are you putting in for: @two_handed_weapons = [] (line 24 of the script), I have mine setup:
@two_handed_weapons = [1, 2, 57]
In a new game and it's fine smile.gif

Are you using any other scripts that might conflict with this one?

This post has been edited by Night_Runner: Apr 4 2010, 11:39 PM


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
mikesp86
post Apr 5 2010, 07:32 AM
Post #52


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Beginner




im using [9,10,11,12,13,14,15,16]

i have several scripts, and will sort througth them and see which one stops me having an error when removed

thx for quick reply

after checking the scripts on a new game they all work together so i deleted my old save files and problem solved

thx night runner for giving me the inpiration to check

This post has been edited by mikesp86: Apr 5 2010, 07:59 AM
Go to the top of the page
 
+Quote Post
   
Mataris
post May 20 2010, 07:47 PM
Post #53


Level 5
Group Icon

Group: Member
Posts: 73
Type: None
RM Skill: Intermediate




How can I get a script to recongize what terrian tag im on and make it so I wont execute the rest of the script when im on anything but a certain tag?
Go to the top of the page
 
+Quote Post
   
Night_Runner
post May 22 2010, 05:35 AM
Post #54


Level 50
Group Icon

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed




You could run something like this:

return unless ($game_map.terrain_tag($game_player.x, $game_player.y) == 1)

And that would not run the rest of the code, unless the terrain tag that the player is standing on is equal to 1 smile.gif


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Scriptless
post May 22 2010, 10:38 AM
Post #55


Level 1337
Group Icon

Group: Banned
Posts: 1,664
Type: Writer
RM Skill: Intermediate




CODE
class Scene_Title < Scene_Base
def start
super
load_database
create_game_objects

create_title_graphic
create_command_window
play_title_music

def create_command_window
@command_window = Window_Command.new(172, [s1, s3])
end


Anything wrong with this? I need to edit the ends, I had them properly before but I still had gotten an error so I mixed it up a bit.

Edit: Fixed it!


__________________________
I'm not dead. Thanks.
Go to the top of the page
 
+Quote Post
   
Mataris
post May 22 2010, 10:59 AM
Post #56


Level 5
Group Icon

Group: Member
Posts: 73
Type: None
RM Skill: Intermediate




QUOTE (Night_Runner @ May 22 2010, 05:35 AM) *
You could run something like this:

return unless ($game_map.terrain_tag($game_player.x, $game_player.y) == 1)

And that would not run the rest of the code, unless the terrain tag that the player is standing on is equal to 1 smile.gif


THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU
biggrin.gif That worked PERFECTLY you are the best I owe you sooooo much
Go to the top of the page
 
+Quote Post
   
Night_Runner
post May 23 2010, 01:06 AM
Post #57


Level 50
Group Icon

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed




Glad I could help smile.gif


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
voodooKobra
post Sep 14 2010, 10:55 AM
Post #58


Level 2
Group Icon

Group: Member
Posts: 22




I'm trying to store the event ID of the event I talk to into a variable in RMXP.

For example, if I talk to EV008, I want to run something like this:
$game_variables[29] = This Event ID.

And I really can't find any documentation on how to approach this anywhere.
Go to the top of the page
 
+Quote Post
   
Zeriab
post Sep 16 2010, 01:02 AM
Post #59


Level 12
Group Icon

Group: Revolutionary
Posts: 196
Type: Event Designer
RM Skill: Skilled




In a script call you can use this:
$game_variables[29] = @event_id


__________________________
Go to the top of the page
 
+Quote Post
   
54tan666
post Nov 2 2010, 10:14 AM
Post #60


Level 1
Group Icon

Group: Member
Posts: 9
Type: None
RM Skill: Beginner




Hey guys,
i have a very easy question (witch is still to hard for me ^^). im new in scripting and my skills are poor... very poor... but i still want to learn it! so my question is how you can change the graphic of the actor on the map (for example when i push a button)

i know its maybe a stupid question for you because you CAN script but i CANT sad.gif
thanks for answers ^^

ps: sorry for the bad english biggrin.gif
Go to the top of the page
 
+Quote Post
   

4 Pages V  < 1 2 3 4 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 04:49 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker