[Ace]Error while using Himework's excel exp table

zxdvas

Villager
Member
Joined
Mar 31, 2019
Messages
7
Reaction score
0
First Language
English
Primarily Uses
N/A
I am using Himework's exp table to adjust the exp required for levels
which functions well when I add exp, remove exp, gain level etc
But when I change the class of the character, the error
script "game_actor" 411: ArgumentError occurred
comparison of Fixnum with nil failed
I am using the actor table so changing the class should have no problem.
and I am very sure no other script change anything related to exp, and the error disappears if I remove the script temporarily.
I also checked that the excel file is in csv format.
I am aware that there is a line in the script saying
If your game crashes while comparing exp, it's because your exp tables
are not setup properly.
But I am confused of the instance that the script successfully get the value from the excel and use them in game yet fail to compare it to other variables.
With no programming experience, I cannot understand this.
And I think I have done enough bug-hunting to ask for help.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,930
Reaction score
13,567
First Language
English
Primarily Uses
RMMV
What is line 411 in your Game_Actor script?
 

zxdvas

Villager
Member
Joined
Mar 31, 2019
Messages
7
Reaction score
0
First Language
English
Primarily Uses
N/A
Ruby:
def change_exp(exp, show)
    @exp[@class_id] = [exp, 0].max
    last_level = @level
    last_skills = skills
    level_up while !max_level? && self.exp >= next_level_exp
    level_down while self.exp < current_level_exp                        <---
    display_level_up(skills - last_skills) if show && @level > last_level
    refresh
  end
(of course, there is no arrow in the game script)

edit:
I did more testing and found out that if I input 0 exp on level 1 the error disppears
unfortunately the exp in my project carries real meaning so I cannot set level 1 as 0 exp.
I could force the character exp to become 0,change class, and add it back.
But it would still be helpful to know what went wrong
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,374
Reaction score
5,031
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,600
Reaction score
1,931
First Language
English
Primarily Uses
RMMV
The script editor has line numbers on the left hand side. Which line there corresponds to 411?
 

Larafin

Warper
Member
Joined
Jul 16, 2020
Messages
1
Reaction score
0
First Language
Dutch
Primarily Uses
RMMV
Ruby:
def change_exp(exp, show)
    @exp[@class_id] = [exp, 0].max
    last_level = @level
    last_skills = skills
    level_up while !max_level? && self.exp >= next_level_exp
    level_down while self.exp < current_level_exp                        <---
    display_level_up(skills - last_skills) if show && @level > last_level
    refresh
  end
(of course, there is no arrow in the game script)

edit:
I did more testing and found out that if I input 0 exp on level 1 the error disppears
unfortunately the exp in my project carries real meaning so I cannot set level 1 as 0 exp.
I could force the character exp to become 0,change class, and add it back.
But it would still be helpful to know what went wrong
The exp table represents how much exp is needed to to from lvl n to lvl n+1. :)
So unless your game involves a lvl 0, it is correct to have a 0 for all lvl 1, because it is the start.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,930
Reaction score
13,567
First Language
English
Primarily Uses
RMMV
Try changing this line:
Code:
level_down while self.exp < current_level_exp
to this:
Code:
level_down while self.exp < (current_level_exp || 0)
 

zxdvas

Villager
Member
Joined
Mar 31, 2019
Messages
7
Reaction score
0
First Language
English
Primarily Uses
N/A
(I know this is a bit late)
The game no longer crashes, there is still some minor issues such as once the class is changed, the character will be an undefined level 0 having 1 HP and 1 stats, but this can be circumvented by adding enough exp to reach level 1. As long as it does not crash, I can find ways to work around it. Thanks.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Hello I buyed RPG Maker VX Ace a long ago and I want to use it again but in the meantime I changed my pc but I lost the paper with my product key on so I can't use RPG maker again... someone can help me please ? or there is no hopes ?:'( ( I have a bad english I'm sorry )
I was away this days here in the forum but it was for a good cause!
The trailer of the demo of Luke Inn is on youtube and I am so happy!
I need to see the bugs of the game but I am happy that I have new content to show!

The last part of the modern interior will be ready soon. This will be a B-tile. With interior items for the kitchen, bathroom, toilet and storage room.
This frantic shooting ARPG plugin for MZ looks really great. Here is the link to a post from the official Japanese RPG Maker forum.
We start in 5 minutes!

Forum statistics

Threads
102,940
Messages
996,117
Members
134,392
Latest member
Niko44
Top