[XP] Stat Distribution System

Started by Blizzard, January 09, 2008, 04:18:49 pm

Previous topic - Next topic

Genow

I have a question.



I tried to edit the script so that PDEF would be calculated by DEX (Which would be renamed to VIT on the system thing), and MDEF by INT.

However, it seems this defense is calculated using the base values you get with the stat growth.

So, when I raise "Vit" after a level up, the PDEF raise doesn't count the stats added to VIT, since they're not the base stats.

Is there any way I can fix this?


Blizzard

I don't think your script that calculates VIT does not take PDEF properly into account.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Twb6543

June 27, 2011, 11:07:44 am #83 Last Edit: June 27, 2011, 02:21:17 pm by Twb6543
@JanraeMendoza Try this for the second part:

Spoiler: ShowHide

def update_command
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to map screen
     $scene = Scene_Map.new
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # If command other than save or end game, and party members = 0
     if $game_party.actors.size == 0 and @command_window.index < 4
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Branch by command window cursor position
     case @command_window.index
     when 0  # item
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to item screen
       $scene = Scene_Item.new
     when 1  # skill
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 2  # equipment
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 3  # status
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 4  # save
       # If saving is forbidden
       if $game_system.save_disabled
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to save screen
       $scene = Scene_Save.new
     when 5  # quest book
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to end game screen
       $scene = Scene_Quest.new
     when 6 #Stat Dist
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to end game screen
       $scene = Scene_Points.new
     end
      return
   end
 end

If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Blizzard

There's a mistake. It should be "when 6 #Stat Dist", not "when 7 #Stat Dist".
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Blizzard

Judging from your code, you should be able to scroll further down. Basically the command window should display the last command when you have selected the last command and press down once more.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Twb6543

Sorry I missed a return from the snippet see if that makes any difference (shouldn't). // Fixed the snippet posted by me above.
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

Vexus

Sorry for the necropost but I need some help on this script.

I'm using this script and it work like a charm but is there a way to remove the cap of stats? I mean I tried testing it too see how builds could be done at level 99 but I can't up the stats higher than 560 it doesn't let me what can I do?

And another question how can I make this script to work only on certain characters not on every actor? (Have some pets like characters in the game that will increase their stats the normal way)

Thanks for the help and sorry again for the necropost.
Current Project/s:

Blizzard

HELL MUST'VE FROZEN OVER BECAUSE I JUST UPDATED THIS SCRIPT!

Seriously, though, Vexus was right about the weird stat cap. It was a bug that used the spent DP to determine how many more points can be added instead of the actual stat value. I have updated the script to v2.1 and I have fixed that problem.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Vexus

Current Project/s:

sirSLR

can i edit something so that 1 dp rises 10 hp or sp instead of 1=1  ?

Morganthedragon

That script is great and all, but I want to do a Stat Distribution System only on the main Character only.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Launian

Quote from: sirSLR on March 15, 2012, 03:34:58 pm
can i edit something so that 1 dp rises 10 hp or sp instead of 1=1  ?


Find this part:

def apply_new_attributes
    @actor.maxhp += @spent[0] / BlizzCFG::HP_DP_COST
    @actor.maxsp += @spent[1]  / BlizzCFG::SP_DP_COST
    @actor.str += @spent[2] / BlizzCFG::STR_DP_COST
    @actor.dex += @spent[3] / BlizzCFG::DEX_DP_COST
    @actor.agi += @spent[4] / BlizzCFG::AGI_DP_COST
    @actor.int += @spent[5] / BlizzCFG::INT_DP_COST
    @actor.dp -= @spent.sum
    self.actor = @actor
  end


and then change it for this:

def apply_new_attributes
    @actor.maxhp += (@spent[0] * 10) / BlizzCFG::HP_DP_COST
    @actor.maxsp += (@spent[1] * 10) / BlizzCFG::SP_DP_COST
    @actor.str += @spent[2] / BlizzCFG::STR_DP_COST
    @actor.dex += @spent[3] / BlizzCFG::DEX_DP_COST
    @actor.agi += @spent[4] / BlizzCFG::AGI_DP_COST
    @actor.int += @spent[5] / BlizzCFG::INT_DP_COST
    @actor.dp -= @spent.sum
    self.actor = @actor
  end


Sadly, this doesn't change the behaivor of the stat distribution window, wich means that, if you allocate 1 DP to your HP, it'll show 501 instead of 510 until you click on Accept Changes. I can't find out how to make it so the window reflects the fact that it adds 10 HP instead of 1, but leaving alone the Stats (STR, DEX, etc.).

If I were to leave tonight, would your hand try to reach me?

KK20

Quote from: Launian on September 27, 2012, 06:24:17 pm
Sadly, this doesn't change the behaivor of the stat distribution window, wich means that, if you allocate 1 DP to your HP, it'll show 501 instead of 510 until you click on Accept Changes. I can't find out how to make it so the window reflects the fact that it adds 10 HP instead of 1, but leaving alone the Stats (STR, DEX, etc.).

That would be this line:
self.contents.draw_text(116, y, 64, 32,
        (@current[i] + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
Simple use of case i can make it possible.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Launian

September 28, 2012, 02:00:03 am #96 Last Edit: September 28, 2012, 02:17:03 am by Launian
Quote from: KK20 on September 27, 2012, 07:58:56 pm
Quote from: Launian on September 27, 2012, 06:24:17 pm
Sadly, this doesn't change the behaivor of the stat distribution window, wich means that, if you allocate 1 DP to your HP, it'll show 501 instead of 510 until you click on Accept Changes. I can't find out how to make it so the window reflects the fact that it adds 10 HP instead of 1, but leaving alone the Stats (STR, DEX, etc.).

That would be this line:
self.contents.draw_text(116, y, 64, 32,
       (@current[i] + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
Simple use of case i can make it possible.


Yeah, I found out that was the line that draws the numbers, but I couldn't figure out how to set up the case i function  :( I tried to make it draw the lines separately (using 6 self.content commands), but it wouldn't work. It'd update all the lines whenever I allocated one point to any skill.

Any advice on how to do it? Just a pointer, mind you. It'd be nice to learn how to do it at last.

Edit:

I tried this, but it didn't work; all the text is drawn on the MaxSP place:

    case
    when @actor.maxhp then
    self.contents.draw_text(116, 32, 64, 32,
    (@actor.maxhp + (@spent[i] * 10) / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.maxsp then
    self.contents.draw_text(116, 96, 64, 32,
    (@actor.maxsp + (@spent[i] * 10) / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.str then
    self.contents.draw_text(116, 96, 64, 32,
    (@actor.str + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.dex then
    self.contents.draw_text(116, 128, 64, 32,
    (@actor.dex + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.agi then
    self.contents.draw_text(116, 160, 64, 32,
    (@actor.agi + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.int then
    self.contents.draw_text(116, 192, 64, 32,
    (@actor.int + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
    end

If I were to leave tonight, would your hand try to reach me?

Blizzard

September 28, 2012, 03:33:27 am #97 Last Edit: September 28, 2012, 03:34:32 am by Blizzard
I guess it's better if I edit the script. Then you should be able to simply specify HP_DP_COST as 0.1 and it will raise 10 HP with 1 DP. That would be the cleanest solution, but it won't work well right now as the end result has to be an integer and this kind of calculation (without the edit that I will add) turns it into a decimal number.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Launian

Yeah, I tried setting up the costs as 0.1, but it did turn the results on decimals, and I'd end up with 999.899999995 of HP, and stuff like that.

Anyways, thank you for the responses, and I'm sorry for being such a nuisance.

If I were to leave tonight, would your hand try to reach me?

Blizzard

I should be the one apologizing for being a lazy ass. Regardless of the fact that I retired 2 and a half years ago.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.