Hello Guys...i've found a Bug very dangerous and cant fix it by myself, is there anyone who can help me?
I use RPGM VX, just to say it.
Today, programming, i've found a BIG problem...
Until today, nothing strange. than i added the Modern algebra catalogue and get a strange Bug. So i deleted it...but it seems the problem wasnt the script...to be sure i deleted any script added until today [Omega Quest Journal, ATS 3 Text Editor and Monster Catalogue from Modern Algebra] and stil get that error.
the problem is, when i use a variable to check the number of any item in the inventory, it say:
Script 'Game_Interpreter' line 750:NoMethodError occurred. undefined method '[]' for nil:NilClass
The line 750 is: actor = $game_actors[@parameters[1]]
I really dont know what it means...something about exp? why exp?
This happen anytime i use something like:
Contol Variables [00xx:wood carried]=[wood] in inventary
the full input is
Contol Variables [00xx:wood carried]=[wood] in inventary
Conditional Branch: Variable [00xx:wood carried] >= 80
Text: "You are carring much Wood! Beware, anything over 99 units will be
discarded!"
Else: Nothing
Doesent matter if i use a Action Button or Parallel Event.
I've tried to change the variable position, the item position and number, nothing...
it still crash when i check the variable. I've also tried to change the icon XD
I cant find a way to solve that crash... i've plenty of Quests like "find X number of Y and bring to me" so i need to use variables that way...
Maybe i've used to much variables in the whole game and it got bugged and mad?
Any ideas to solve it? ^^
i just cant understand...i've never messed up with anything strange aside adding some script in the right area and now suddently the game crash if i try to count the item in the inventory of the party...
If i cant fix this i think i've lost tre month of game-creating...and i have no backup since i didnt ever think it could happen...
Sorry for the trouble, hope someone can help.
Thank for your time. ^^
i've tried also another thing...
i've started a complete blank game and set just one new item, calling it "wood"
Then i set a parellel event this way:
control variables [0001: wood] = [wood] in inventory
Conditional branch: [Variable 0001: wood] => 50
Text: "something, just testing"
Else:
it give to me the same error! also if is a total blank new game?
Does this means my RPGM VX is somehow bugged?
Thanks for your time, and sorry for my not-so-good english ^^
PS: i'va also tryed to remove RPGM VX and istall it again, start a blank new game, and try the same action. still it give me the error. What really i cant get is why? This mornig all was running normal with those variables, now it seems they arent fine anymore with the game...also if i have installed a new RPGM VX and just set a variable! i'm missing something important? In the morning that variable was running without problems... sigh...
http://rmrk.net/index.php/topic,25243.0.html
I responded as well in the Monster Catalogue topic, but it is an error with the default scripts. All you need to do to fix it is go to Game_Interpreter and replace the command_122 method with:
def command_122
value = 0
case @params[3] # Operand
when 0 # Constant
value = @params[4]
when 1 # Variable
value = $game_variables[@params[4]]
when 2 # Random
value = @params[4] + rand(@params[5] - @params[4] + 1)
when 3 # Item
value = $game_party.item_number($data_items[@params[4]])
when 4
actor = $game_actors[@params[4]]
if actor != nil
case @params[5]
when 0 # Level
value = actor.level
when 1 # Experience
value = actor.exp
when 2 # HP
value = actor.hp
when 3 # MP
value = actor.mp
when 4 # Maximum HP
value = actor.maxhp
when 5 # Maximum MP
value = actor.maxmp
when 6 # Attack
value = actor.atk
when 7 # Defense
value = actor.def
when 8 # Spirit
value = actor.spi
when 9 # Agility
value = actor.agi
end
end
when 5 # Enemy
enemy = $game_troop.members[@params[4]]
if enemy != nil
case @params[5]
when 0 # HP
value = enemy.hp
when 1 # MP
value = enemy.mp
when 2 # Maximum HP
value = enemy.maxhp
when 3 # Maximum MP
value = enemy.maxmp
when 4 # Attack
value = enemy.atk
when 5 # Defense
value = enemy.def
when 6 # Spirit
value = enemy.spi
when 7 # Agility
value = enemy.agi
end
end
when 6 # Character
character = get_character(@params[4])
if character != nil
case @params[5]
when 0 # x-coordinate
value = character.x
when 1 # y-coordinate
value = character.y
when 2 # direction
value = character.direction
when 3 # screen x-coordinate
value = character.screen_x
when 4 # screen y-coordinate
value = character.screen_y
end
end
when 7 # Other
case @params[4]
when 0 # map ID
value = $game_map.map_id
when 1 # number of party members
value = $game_party.members.size
when 2 # gold
value = $game_party.gold
when 3 # steps
value = $game_party.steps
when 4 # play time
value = Graphics.frame_count / Graphics.frame_rate
when 5 # timer
value = $game_system.timer / Graphics.frame_rate
when 6 # save count
value = $game_system.save_count
end
end
for i in @params[0] .. @params[1] # Batch control
case @params[2] # Operation
when 0 # Set
$game_variables[i] = value
when 1 # Add
$game_variables[i] += value
when 2 # Sub
$game_variables[i] -= value
when 3 # Mul
$game_variables[i] *= value
when 4 # Div
$game_variables[i] /= value if value != 0
when 5 # Mod
$game_variables[i] %= value if value != 0
end
if $game_variables[i] > 99999999 # Maximum limit check
$game_variables[i] = 99999999
end
if $game_variables[i] < -99999999 # Minimum limit check
$game_variables[i] = -99999999
end
end
$game_map.need_refresh = true
return true
end
You have to replace the whole method - it will look almost identical but there are two errors in that method that need to be fixed and the above code does it.
Thank for the quick reply Algebra! I owe you so much...ill go to test it strait now...i just have to emm...installa gain the RPGM VX...i was trying everything heheheh XD
So, this is a Bug that is a "standard" in the game, or is something that happen just using scripts?
The real strange issue is that this morning it was cool without giving that error.
It just popped out from nothing O_o
But Thanks a lot... now i re-install and try to change that code.
Modern Algebra...you truly are a Genius...it worked!
If i just have had a little bit of coolness...now i must rewrite all monster description and some other things i trowed away to find where was the error i've made..[i was sure was my fault in some way or another XD i'm a noob eheheh]
So that kind of bus is "inside" the game and must be corrected for anyone using RPGM VX? Or is indeed something i've messed up adding some script?
Sorry if i bother you, i ask becouse i'm curios and really appreciate dis game...and to say it, you seem very proficient in what you do, so i grab the chance to ask you this thing, becouse also 2 other friend of mine whant to install VX. So if that problem is inerithed by the game itself, i must save this script of yours and give to them too, to fix that terrifing bug.
Anyway very, very, very much tanks! You saved me a lot of truble and my little pet [my game] in wich i'm pouring sweat and blood XD [but is tooooo funny to stop heeheh]
thanks a lot! **hug**hug**sweet hug**
Yeah, it's a bug that comes standard in the game. Nothing you did caused it to happen.