Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: sinister678 on December 30, 2013, 11:25:46 pm

Title: script
Post by: sinister678 on December 30, 2013, 11:25:46 pm
hey im really really new to scripting and i want to make a blacksmith on rpg maker xp but im not sure how to activate it could someone please help
Title: Re: script
Post by: PhoenixFire on December 31, 2013, 12:34:03 am
You need to be a hell of a lot more specific here...

What version are you using?
Are you referencing someone's script that they already made?
What exactly do you want the script to do?



I also see you have not introduced yourself, or even placed something in the new projects area... Maybe give us a little background about you and your game in one of those sections...? Might help someone determine how best to help you; just a thought, though I'm sure one of the powers that be here will back me on this one =p
Title: Re: script
Post by: KK20 on December 31, 2013, 12:41:58 am
Quote from: DigitalSoul on December 31, 2013, 12:34:03 am
I'm sure one of the powers that be here will back me on this one =p

You rang? :naughty:

Basically what DigitalSoul said. Then again, it looks like you might just use F0's Blacksmith script, so I'll wait and see how that turns out. Welcome by the way. :)
Title: Re: script
Post by: sinister678 on December 31, 2013, 01:26:35 am
hey sorry im new to this site to i dont know basically anything im doing here um yah its foreverzer0's blacksmith script i just have no clue what im doing i want to make a place where u can forge weapons and armor but i dont know how to activate it after i put the script in when i read the instructions i get lost im sorry im a noob  :facepalm:
Title: Re: script
Post by: Blizzard on December 31, 2013, 04:51:23 am
Try first playing around a little bit in RMXP to get an idea how it all works. After that try checking some of the simpler scripts and how they work, test them out. That should give you enough knowledge to understand more complicated scripts better. Remember that you can easily add the blacksmith script in a month or so when you already have some gameplay and a few dozen maps instead of having to add it right away.
Title: Re: script
Post by: sinister678 on December 31, 2013, 09:28:24 am
well i know how it basically works but i wanted to add more then it had in the game and put some scripts in i just dont know what to do when they say to call blacksmith shop this script call: w=[weapons_id] or add syntax i dont know what to do with that....
Title: Re: script
Post by: PhoenixFire on December 31, 2013, 09:34:05 am
Well, to explain it a little bit....

When you're in the editor, 'makin yo maps', to call the script, you simply make an event, and use the "script" command. It will open a small textbox. Paste the script call in, and substitute the information you need. so you would put in, w=[1] to use the first weapon in your database, or change that to whatever number you want, as log as it's a valid weapon in your database.. That should at least get you started..
Title: Re: script
Post by: sinister678 on December 31, 2013, 10:01:09 am
sorry if this is a stupid question but is this the script call in

$scene = Scene_BlackSmith.new(w, a, i)
Title: Re: script
Post by: KK20 on December 31, 2013, 01:41:34 pm
Quote#   - To call blacksmith shop, this script call:
#
#         w = [ WEAPON_IDS ]    (Use as many as needed, seperate with commas)
#         a = [ ARMOR_IDS ]
#         i = [ ITEM_IDS ]
#         $scene = Scene_Blacksmith.new(w, a, i)


The last line, with the $scene, is what essentially calls the Blacksmith shop to open up. The w(eapons), a(rmors), and i(tems) are your parameters--they tell what things this blacksmith can forge/create.

So let's use a simple script call.
Quote
w = [1]
a = [2]
i = [3]
$scene = Scene_Blacksmith.new(w, a, i)

If you copy/paste this into the "Script" event command, the i) will jump to the next line, but it will still work fine.

What this says is that the shop will be able to forge/create Weapon ID 1, Armor ID 2, and Item ID 3. If you look in your game database, you will see that these items are Bronze Sword, Iron Shield, and Full Potion.

One more example: What if you want a shop to craft all (and only) mythril items?
Quote
w = [4,8,12,16,20,24,28,32]
a = [4,8,16,20]
i = []
$scene = Scene_Blacksmith.new(w, a, i)
Title: Re: script
Post by: sinister678 on December 31, 2013, 02:04:27 pm
i did what you said but it says name error occurred while running script.  uninitialized constant interpreter:: Scene_Blacksmith.
Title: Re: script
Post by: KK20 on December 31, 2013, 02:27:22 pm
That means you don't even have the script installed. Or you pasted the script below Main when it should be above it.
Title: Re: script
Post by: sinister678 on December 31, 2013, 02:37:18 pm
i have the script above the main one
Title: Re: script
Post by: KK20 on December 31, 2013, 02:46:05 pm
Oh, F0 capitalized the S in Blacksmith when it should be lowercase. Fixed my examples post above. Try them now.
Title: Re: script
Post by: sinister678 on December 31, 2013, 02:56:42 pm
hey thanks  :haha: but now theres a new problem  :facepalm: it says script 'blacksmith' line 349: argumenterror occurred. comparison of fixnum with nil failed. i dont know if you need the line but line 349 says if $game_party.gold >= materials[1][0]
Title: Re: script
Post by: KK20 on December 31, 2013, 03:11:06 pm
You will need to configure the script.
This was the reason for the problem:

  def self.armor_gold(id)
    return case id
    when 1 then []
    when 2 then []
    when 3 then []
    when 4 then []
    when 5 then []
    else
      [0, 0]
    end
  end

Those brackets need two numbers in them.
Title: Re: script
Post by: sinister678 on January 01, 2014, 12:25:20 am
thank you so much it works now
Title: Re: script
Post by: sinister678 on January 01, 2014, 03:59:02 pm
sorry one more quick question when i play test my game and i go to the forge to enchant something i dont have the item to enchant my weapon in my inventory but i still can enchant it as many times as i want how do i make it so i need the item to enchant it
Title: Re: script
Post by: KK20 on January 01, 2014, 08:50:40 pm
Yeah, that's a bug with the script. I'll probably fix it tomorrow.
Title: Re: script
Post by: sinister678 on January 01, 2014, 10:36:23 pm
alright thank you so much for all your help