DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
76
Reaction score
4
First Language
English
Primarily Uses
RMVXA
I'm using the Falcao Pearl ABS liquid script (found here: https://falcaorgss.wordpress.com/2012/12/02/falcao-pearl-abs-liquid-v1/) and even though I'm following the instruction exactly I keep getting the same error message whenever the player or an enemy try to use a weapon. The game stops and I get this message:


Script 'Game_Character' line 180: NoMethodError occurred.


undefined method `tool_data' for nil:NilClass


Does anybody know how to fix this problem?
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,122
Reaction score
8,002
First Language
German
Primarily Uses
RMMV
then either you haven't configured the tools/weapons correctly (you can't simply use such a script, you need to configure its data manually), or you didn't start a new game but loaded a savefile from before the script was installed - that won't work either, a new game is required for initialisation.


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



And please give a link to the script, that will help with more detailed questions and answers
 

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
76
Reaction score
4
First Language
English
Primarily Uses
RMVXA
then either you haven't configured the tools/weapons correctly (you can't simply use such a script, you need to configure its data manually), or you didn't start a new game but loaded a savefile from before the script was installed - that won't work either, a new game is required for initialisation.

I did configure the weapons correctly, infact I copy and pasted one of the weapons from the demo version to see if it worked and I still had the same problem. And I started a brand new game from scratch, it had no save files whatsoever. I'm following the instructions of the script correctly but I still have the same issue.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,122
Reaction score
8,002
First Language
German
Primarily Uses
RMMV
no - somewhere you've missed part of the configuration or it would work - dozens or hundreds of others have configured and used Pearl correctly.


So please tell us (or show us with screenshots) what you already did, then we can identify where you made a mistake.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,185
Reaction score
839
First Language
Hungarian
Primarily Uses
RMVXA
I can second what Andar wrote, the script works without any major errors (some minor bugs are still there, but nothing which could produce a crash without an error in configuration).


From what I can see, that error checks the tool_data for a Game_Character, but the character object is nil, so it can't have any tool_data method defined.


The tool_data refers to a tool, which must be a weapon, armor, skill or item. 


So, double check if you used the correct IDs for your tool usage script calls, and if you have used the correct script call depending on the tool's type (weapon, armor, skill or item).


The error you received can happen if you try to use a tool which is not set up in the database, for example, you try to use weapon 78, but you only have 60 weapons set up in your database. That will definitely give you the error you met already.
 

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
76
Reaction score
4
First Language
English
Primarily Uses
RMVXA
OK, here are screenshots of my configuration:


The tool in the database:


weapon%20data%20base_zpsnktbtc47.png



I'm not sure if these will help but here is the actors info as well as the class info:


actor%20data%20base_zpsm2ppuzym.png



class%20data%20base_zps6hxzodja.png



It doesn't work for the player but it also doesn't work for the enemies. Here is how my enemy is set up:


enemy%20scripting_zpso2xqwm9h.png



And whenever either the player or the enemy attacks the axe will swing for a bit and it can do some damage, but after a few swings I always get this error message:


error_zpsazljh0nr.png



As far as the script itself I have not modified it at all. If there's any other information that would help please tell me. I appreciate the help.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,122
Reaction score
8,002
First Language
German
Primarily Uses
RMMV
As far as the script itself I have not modified it at all. If there's any other information that would help please tell me. I appreciate the help.



Then that's most probably the cause.


I can't check the details at the moment because the script can't be downloaded without the demo, but as I said before, you need to configure the script - and that includes changing the script data to fit your game. If you did not change the script lines where needed, then you didn't configure that script correctly.


I suggest you follow the link "How to use a script" in my signature, that is a general tutorial explaining how to check a script for its configuration options.
 

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
76
Reaction score
4
First Language
English
Primarily Uses
RMVXA
you need to configure the script - and that includes changing the script data to fit your game. If you did not change the script lines where needed, then you didn't configure that script correctly.



There where absolutely no lines of the actual script itself that needed changing. I read all of the scripts instructions and I looked at all of the areas where the script lines could be changed. I do understand how scripting works, I didn't just paste the script into the game and expect it to go. I read over the entire thing properly and went through everything and honestly nothing needed to be changed.


I even watched a tutorial on using the script (here: https://www.youtube.com/watch?v=vubWscON-B0) and I copied exactly what the guy in the video did. It works when the guy in the video tests it but not for me. I just cannot figure out why. Is it possible there could be an issue with my computer?


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


YES!!! I FIGURED IT OUT!!!


I will explain the solution so that if anyone else has the same problem and they see this thread they'll know what to do.


Basically the problem had to with the fact that the weapon had been configured to perform combo attacks and for some reason the script wasn't letting it do that (seeing as I had copy and pasted the weapon from the demo I don't know why but it doesn't really matter.) But basically all you have to do to fix this problem is to go to the weapon page in the data base, click in the notes section and use the arrow keys to go down which uncovers more options that where obscured from view. Find the option that says "Tool Combo Tool" and change it to nil. So basically it should look like this:


Tool Combo Tool = nil


That's it, now the weapon works perfectly.


Thanks guys for trying to help, this thread can be closed now.
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,185
Reaction score
839
First Language
Hungarian
Primarily Uses
RMVXA
This was the relevant part of that note-tag:


Tool Combo Tool = weapon, 63, 35, jump


This means:


Trigger a combo tool usage 35% of times, and use weapon 63 when it happens.


You have only 1 weapon set up in your database, so the crash is kinda expected. 


Actually, I hit the nail on the cause of the error with this:

The error you received can happen if you try to use a tool which is not set up in the database, for example, you try to use weapon 78, but you only have 60 weapons set up in your database.




It is important to know why the errors happen, so that you can avoid it from happening again. That is a pretty crucial part of game making. So, it does matter, or at least it should. :p
 

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
76
Reaction score
4
First Language
English
Primarily Uses
RMVXA
This was the relevant part of that note-tag:



Tool Combo Tool = weapon, 63, 35, jump


This means:


Trigger a combo tool usage 35% of times, and use weapon 63 when it happens.


You have only 1 weapon set up in your database, so the crash is kinda expected.



Oh riiiiiiiiight, I get it now aha, thanks for explaining, I just thought it couldn't do a combo for some reason aha. But yeah, now that you explained I can set combos up aha, thanks for explaining that.
 

dex_1010

Villager
Member
Joined
Feb 28, 2016
Messages
21
Reaction score
1
First Language
english
Primarily Uses
I get the same error when I attempt to dual wield. I've tried both weapons on their own without dual wield. When I dual wield, the first weapon (F Key) works perfectly and the second (G Key) creates that same error. And i've set both combos to nil.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,185
Reaction score
839
First Language
Hungarian
Primarily Uses
RMVXA
Yeah, that's because the ABS script does not check if your second slot is equipped with a weapon or an armor, it simply tries to use an armor automatically.


You have 2 ways of solving this:


1. Use an armor instead of a weapon for your second hand "weapon" slot. So, don't use dual wield, just let it be a regular shield slot, make a new armor type, and use that armor type to make "shields" which will actually act as weapons in the end.


2. This one involves some changes in the ABS script itself.


Head over to the "- Pearl Battler Settings" script. You will see these lines in the script:


unless actor.equips[1].nil?
use_armor(actor.equips[1].id) if trigger_tool?(Key::Armor[0], :keys)
use_armor(actor.equips[1].id) if trigger_tool?(2, :mouse)
end


Replace these four lines with the below lines:


unless actor.equips[1].nil?
if actor.equips[1].is_a?(RPG::Weapon)
use_weapon(actor.equips[1].id) if trigger_tool?(Key::Armor[0], :keys)
use_weapon(actor.equips[1].id) if trigger_tool?(2, :mouse)
else
use_armor(actor.equips[1].id) if trigger_tool?(Key::Armor[0], :keys)
use_armor(actor.equips[1].id) if trigger_tool?(2, :mouse)
end
end


This will now check if the second hand equip is a weapon or not, and depending on that check, it will either use a weapon or an armor.


Also, if you are planning to use the quicktool menu Falcao made for his ABS, you might want to know that it will only allow armors to be displayed for the second tool slot (shield slot by default). If you won't use that menu, you won't have any problems regarding dual wielding weapons, but if you will use it, well, it won't work without some heavy modifications for that scene.
 
Last edited by a moderator:

dex_1010

Villager
Member
Joined
Feb 28, 2016
Messages
21
Reaction score
1
First Language
english
Primarily Uses
I'll give that a try, cheers Sixth
 

dex_1010

Villager
Member
Joined
Feb 28, 2016
Messages
21
Reaction score
1
First Language
english
Primarily Uses
Sorry for double post but it now says:


Script'- Pearl Battler settings' line 164: NameError occurred. undefined local variable or method 'actor' for Game_Player:Class


Sorry I have literally no idea when it comes to scripting aside from changing true to false or the variable/event IDs
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,185
Reaction score
839
First Language
Hungarian
Primarily Uses
RMVXA
I need to know what you did in order to see the source of the error.


If you just did what I wrote you should not have any errors, I tested that edit myself, and it works.
 

dex_1010

Villager
Member
Joined
Feb 28, 2016
Messages
21
Reaction score
1
First Language
english
Primarily Uses
I literally did exactly what you said, just replaced the lines. Still get that error when I try using a dual wield attack with the second weapon.


Sorry to be a pain
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,185
Reaction score
839
First Language
Hungarian
Primarily Uses
RMVXA
The method named actor is a default method in the Game_Player class, so it is impossible to get the error you mentioned unless you deleted that method entirely from the default Game_Player class.


Try the edit in the default ABS demo (without any modifications). It will work if you do everything right.


Also, line 164 refers to item tool usage and not weapon or armor tool usage in that script after the edit. This means you edited something else in that script. 


If you still can't get it to work, even with the default "- Pearl Battler settings" script from the demo (plus the edit from above), show me your edited script, and maybe I can figure out what went wrong.


Actually, the only way to get the error you got is to put those lines I wrote in that script inside the Game_Player class but outside of any method. Doing that will trigger the error you got. That is NOT what I wrote. You need to replace the 4 lines with the other lines. Those 4 lines are certainly inside a method (called update_tool_usage), but somehow, they are outside from that method in your project.
 
Last edited by a moderator:

dex_1010

Villager
Member
Joined
Feb 28, 2016
Messages
21
Reaction score
1
First Language
english
Primarily Uses
I have no idea what I must've done the first time but it's working now, thanks! :)


Also just wondering, it's related to Pearl ABS again, is there anyway of setting a minimum range for bows? Like you cant target an enemy within 2 squares of the character? Or should I make a new request for that?


Thanks again
 

Latest Threads

Latest Profile Posts

I hate seeing threads where less-experienced user's ask for an opinion of their project, and the thread is full of negative feedback by others who are clearly not the target audience. I feel bad for the OP, and I hope they understand that no game can appeal to everyone. :frown:
Hm, just found out I can't use loops, yay.
-Ele
I just wanna Covid to be over and I have my normal life back... Feeling so bad these days, what can I do?
Holy Moly BlackJack is Finally finished!
Don't judge me, I'm not great at the game.
BlackJack.png

Forum statistics

Threads
109,071
Messages
1,041,850
Members
141,565
Latest member
Kitarama
Top