script

Started by sinister678, December 30, 2013, 11:25:46 pm

Previous topic - Next topic

sinister678

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

PhoenixFire

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
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

KK20

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. :)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sinister678

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:

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

sinister678

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....

PhoenixFire

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..
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

sinister678

sorry if this is a stupid question but is this the script call in

$scene = Scene_BlackSmith.new(w, a, i)

KK20

December 31, 2013, 01:41:34 pm #8 Last Edit: December 31, 2013, 02:45:15 pm by KK20
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)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sinister678

i did what you said but it says name error occurred while running script.  uninitialized constant interpreter:: Scene_Blacksmith.

KK20

That means you don't even have the script installed. Or you pasted the script below Main when it should be above it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sinister678

i have the script above the main one

KK20

Oh, F0 capitalized the S in Blacksmith when it should be lowercase. Fixed my examples post above. Try them now.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sinister678

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]

KK20

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.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sinister678

thank you so much it works now

sinister678

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

KK20

Yeah, that's a bug with the script. I'll probably fix it tomorrow.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

sinister678

alright thank you so much for all your help