That's where you should have put it, I'm just making sure it wasn't a positioning issue.
Are you testing using a save that was created before you added the script to your game?
That's where you should have put it, I'm just making sure it wasn't a positioning issue.
What are you doing when the crash occurs?
I attempted to dismantle items, it crashes just as I confirm the qty to be dismantled. I'll see what happens if I move the script order around and see what else may be affecting it.
Show me the note tags for the item
<dismantle>
I have done this correctly
Before I test this script on a fresh project, can you explain what you think I am doing wrong? I am using several scripts, so you need to tell me what kind of script would interfere with your one?
I would not know what script would interfere. There are over 1000 scripts made for vx ace. perhaps over 10,000.
Don't mean to pop your ego here mate but even on a fresh project there's something wrong with your script: So here's the report on a fresh project. Nothing else script-wise except the original author's dismantle script (v1.3) your script (v1.0) and backtrace to catch the error:
2025-02-15 10:27:54 +1300 >> EXCEPTION CAUGHT <<
NoMethodError: undefined method `[]' for #<DismantleObj:0x1190fe00>.
Backtrace:
Title: Mr Bubble Dismantle Items Number :317:in `block (2 levels) in determine_dismantled_items'
Title: Mr Bubble Dismantle Items Number :316:in `each'
Title: Mr Bubble Dismantle Items Number :316:in `each_with_index'
Title: Mr Bubble Dismantle Items Number :316:in `block in determine_dismantled_items'
Title: Mr Bubble Dismantle Items Number :315:in `times'
Title: Mr Bubble Dismantle Items Number :315:in `determine_dismantled_items'
Title: Mr Bubble Dismantle Items Number :298:in `process_dismantle'
Dismantle Items :1338:in `on_confirm_ok'
Window_Selectable:212:in `call'
Window_Selectable:212:in `call_handler'
Window_Command:136:in `call_ok_handler'
Window_Selectable:322:in `process_ok'
Window_Selectable:297:in `process_handling'
Window_Selectable:276:in `update'
Scene_Base:95:in `block in update_all_windows'
Scene_Base:93:in `each'
Scene_Base:93:in `update_all_windows'
Scene_Base:49:in `update_basic'
Scene_Base:41:in `update'
Scene_Base:14:in `main'
SceneManager:23:in `run'
Main:7:in `block in <main>'
:1:in `block in rgss_main'
:1:in `loop'
:1:in `rgss_main'
Backtrace v1.5 by Solistra:243:in `block in rgss_main'
Backtrace v1.5 by Solistra:99:in `with_exception_handling'
Backtrace v1.5 by Solistra:242:in `rgss_main'
Main:7:in `<main>'
ruby:in `eval'
There is no prompt that says dismantle, it shows this number prompt, you enter how many x to be dismantled. It then crashes.
We can safely rule this out because your script causes the crash regardless.
not a problem, no ego at all, just confident that this is impossible.
and to prove it works I did the same thing.
Take out every script except the dismantle script and test.
Took out every other script except the ones mentioned - didn't edit either scripts. Still nothing has changed. Either you're using a different version of the original dismantle script or something else is happening.
Haha no, but I'm glad I found the issue - like you said in a previous post, this assumption might be correct:
Because I am using one with this header:
# ╔═══════════════════════════════════════════════════════╤══════╤═══════════╗
# ║ Dismantle Items │ v1.3 │ (4/27/13) ║
# ╚═══════════════════════════════════════════════════════╧══════╧═══════════╝
# Script by:
# Mr. Bubble ( http://mrbubblewand.wordpress.com/ )
Well my apologies, it's unlike me to not have the latest version. I have no idea why I did not have it since the script was made in 2013.
def determine_dismantled_items
gained_items = []
@item.dismantle_items.each_with_index do |array, index|
if rand < (array[1] * 0.01)
gained_items.push(array[0])
array[2] = true
end
end
return gained_items
end
def determine_dismantled_items
gained_items = []
@item.dismantle_items.each_with_index do |dism_obj, index|
if rand < (dism_obj.chance * 0.01)
gained_items.push(dism_obj.item)
dism_obj.mask = true
end
end
return gained_items
end
Thank you for your help here, you're a life saver!
Fixed. Code updated. I was actually worried about that at one point but forgot to test it.
It works for me, thank you so much for the help!
Original thread: https://forums.rpgmakerweb.com/threads/dismantle-items.3414/