RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED]Weapon Script

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
EVIL DOGGY!!!! CATS RULE!
Alright. I need a script that does the following:

In order to equip an item, you first need have a certain item equipped.

For example:

If I have the Weapon called "Lava Blade" and I wanted to equip it, it would say "Unequipable"

But if I first equipped "Lava Gauntlets" it would allow me to wield the Lava Blade.

I have no clue if it can be done in Events, because I checked and was confused.

Also, the pre-equip MUST be equipped, not just in your inventory, it has to physically be on the character.

Sorry if this makes no sense, but a script would be greatly appreciated and not just for weapons. I'm talking in general.

« Last Edit: June 27, 2008, 04:18:50 PM by modern algebra II »
DO NOT LOOK HERE!!!!!
...
...
...
WHY DID YOU LOOK!!! YOU DISOBEDIENT FOOL

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
Just finished this for ya.

Just read the instructions and you should do great!

By the way, I have not added a function to where one item requires multiple items. If you need that just ask ^_^.

I also added a demo for ya.

To get the items talk to the guy on the far left (the one that says "club").
In the demo the shuriken requires the ninja gloves to be equipped. The mithril shield (i think) requires the shuriken to be equipped, and the iron helm (I think) requires the ninja gloves as well. You also get a circa, etc. (was to help test bugs).
The other guy just tests the line needed to unequip something, and the fairy... I don't remember what the fairy was for... she just counts lol.

Spoiler for Weapon Requisites:
Code: [Select]
    #---------------------------------------------------------------------------
    # * If an item is unequiped, unequip any items that required it
    #---------------------------------------------------------------------------
    @equip_requirements.each do |requisite2|
      if requisite2[2] == last_item.id
        case requisite2[1]
        when 1
          change_equip(0,nil,test) if @weapon_id == requisite2[0] and last_item.id != item_id
        when 2
          change_equip(1,nil,test) if @armor1_id == requisite2[0] and last_item.id != item_id
        when 3
          change_equip(2,nil,test) if @armor2_id == requisite2[0] and last_item.id != item_id
        when 4
          change_equip(3,nil,test) if @armor3_id == requisite2[0] and last_item.id != item_id
        when 5
          change_equip(4,nil,test) if @armor4_id == requisite2[0] and last_item.id != item_id
        end
      end
    end
    #---------------------------------------------------------------------------
    # End Equip Requisites (Unquip Function)
    #---------------------------------------------------------------------------

Just replace Game_Actor with the code.

Also, if you're wondering why there's a method kind of randomly placed in the script list named bible... well... bible was just easier to remember as it was the first word that came to mind lol.

Last but not least, if you have any questions feel free to ask ^_^

EDIT : Also, for some weird reason, if you have two requirement items. Let's say, two ninja gloves. Even if you switch to the other set of ninja gloves, any items requiring the ninja gloves will be unequipped. I'm not entirely sure how to fix that, being new to the RGSS2 and all.

EDIT 2: Disregard that last edit. I fixed the problem (feels stupid). I was originally making it only unequip if the required item was unequipped and the slot contained the item that required the equip (if that makes sense). I forgot to make it make sure the new item wasn't the same as the last one, and if it was, to not unequip (if that makes sense) *updates demo*

EDIT 3: Not sure why the rest of the code is cut out... Just download the demo and copy the Game_Actor code from there.
« Last Edit: May 24, 2008, 01:48:38 AM by Tsunokiette »
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Looks pretty good Tsuno. You should release it in the Database.

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
The earliest I'll be able to do that would be like Wednsday or Thursday. :(
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."