Common Equip Events
This script allows you to assign common events to weapons/armors that will be run when you equip or dequip (un-equip) them. The common events are assigned separately, so you might have one equip event, and another dequip event.
Download
Script: download here
If you would like the common event to run in the scene, you will need to use something like the Scene Interpreter
Installation
Place this below Materials and above Main.
Usage
Tag your equips with
<equip event: x> <dequip event: x>
For some common event ID x.
I might be a huge noob but how do I download the script?
Correct me if I am wrong about this but…
I am looking for weapons + common-event, like this…
I got an unusual “attack” that would be more like a heart of this game project (like, “Materia” system for FF7, you know?) but it’s actually full of Common Event (combined with the Skill itself)… When I was going to equip Common Event in each weapon, I found myself to not able find “Common Event” option anywhere. I would like to have the weapons including Common Events and let hero attack which will unleash this “unusual attack” each time hero attack…
Is this the one? Or wrong one?
123
is any plugin like this for rpg maker mv
This script might be just what I needed, but I can’t seem to get past one thing.
From what I’ve read, it seems like I would need to create a different pair of common events for every equip in the game. If I have to do that, then so be it, but I would really like to be able to have one equip and one unequip common events, each with a series of conditionals to do something based on the particular equip.
Every armor and weapon is going to have a weight, which I want to add or subtract from a total_weight variable upon equip/unequip.
I guess the issue with that would be if I changed armor several times before exiting the menu, and it wouldn’t know what to do.
I’d really appreciate it if you have any suggestions.
Thank you for your time.
hello! this script is absolutely perfect, but i was wondering if there was a way to get the event to play only once, such as having a conversation play only the first time you equip the weapon/armor? i apologize if this is a simple oversight on my part or just something that can’t be done, but thanks in advance anyway!
You can use a switch to keep track of whether the event has been played or not, and wrap everything inside a conditional branch on that switch.
it was a little confusing but i think i got it working. thanks so much for the fast response and for your time!!
Using this together with Smithing by Richter_h and TheoAllen. I have this oddity where if I quit the game to meny and try to start a new game i get this error: “undefined method ‘equip_event_id=’ for#<RPG::UpgradeWeapon:0x8e3x3x8”
I’m trying to draw some conclusion as to what is going on but so far I’m drawing blanks. It’s referencing line 254 of the Smithing script which is the last “end” within the quotation marks:
cloned = RPG::UpgradedWeapon.new
self.instance_variables.each do |varsym|
ivar_name = varsym.to_s.gsub(/@/) {""}
eval("
if cloned.respond_to?(\"#{ivar_name}\")
begin
cloned.#{ivar_name} = original.#{ivar_name}.clone
rescue
cloned.#{ivar_name} = original.#{ivar_name}
end
end")
Any ideas? Thanks in advance!
equip_event_id
is not publicly accessible. You can only read the value.Easiest way to get around this would be to add the following
attr_accessor :equip_event_id
Inside of
class RPG::EquipItem
Worked wonders! Thank you amigo <3 I had to add :dequip_event_id as well into the class. Awesome!
Yup, that’s about it. I didn’t consider that someone might actually try to clone objects that way.
How would you go about requiring two of the same weapon needed to be equip for the event to run?
This script does not support conditions. You can add the check to the common event with a conditional branch, but then this script doesn’t tell you which actor called the common event. For the most part there isn’t an obvious way that I can see how this would be done without modifying the script.
Thanks for the fast response. In my game you get to choose between sword and sword or sword and shield (same set-up for war axes and other weapons) but i want them to be equipped before you can progress in the game. If you know of how i can do this or another script that does the same please let me know.
If you just need to check a specific actor, you can call a common event and then inside the common event you would check whether the specific actor has two of the same equip.
This can be done using a script call in your conditional branch
Which will be true only if actor 2 is holding two of the same weapon (based on ID)
So for the actor i would place his/her ID between [] after actors?
I think so, yes.
Hi Tsukihime,
Would it be possible to use the Scene Interpreter script together with this one, so a dequip common event is run right when I try to remove an equip, instead of when I press esc and leave the equip menu scene?
Thanks!
It should work the same as using items in the item menu.
Regarding the example, right now if I use an item from the item menu (with effect manager + effect common event) it quickly goes to the map and then runs the common event. With the dequip event, it only runs after I exit the equip scene and the menu scene. It’s the expected behavior?
Yes. For equip events I didn’t explicitly tell it to exit the scene and run a common event.
Hi Tsukihime,
Would be possible to pass arguments to the common event, so it would know which equip called it, the actor, etc?
Thanks!
This script does not support arguments, but you can modify the script to set some variables as needed. Common events in general do not support arguments. You can use <a href="http://www.himeworks.com/2013/04/25/common-event-variables/" title="Common Event Variables" target="_blank">this</a> as reference.
Well, I'm not exactly good at scripting (if that's not evident already), but I did followed the instructions of both scripts.
I tagged a equipment to asign it a common event, and in the common event I placed the comment that make the event run in the current scene. The event itself was the class change.
So, what happened is that the actor changed it's class without having to exit to the map, but not before exiting the equipment window.
What I would like is the change of class to occur when still in the equipment window.
If the class change is supposed to change the equip slots, that won't occur until you refresh the window (which by default means you need to leave and re-enter).
Hello, Hime. Thanks for this excelent script. It works perfectly, although I'm having some sort of an issue (but I don't think it's because there's something wrong with the script, it's just that it doesn't do exactly what I want… which is to be expected).
Anyway. Using your script, I made an armor that change the class of the actor when equipped. And it does change the class. The problem is that it doesn't do it 'immediately', as in that when the armor is equipped, nothing happens (the class remain the same) until you exit the equipment window. So, this is sort of an issue, because I would like that the class changed when still being in the equipment window, so the player could change the equipment of the actor now that it have a different class.
¿Something can be done about this? I hope so. Sorry for bad english and too much text. Thanks again for your awesome scripts.
Also, I tried to use the Scene Interpreter script, but it didn't do much.
The problem you're having is that common events only run on the map or during battle and nowhere else. This means that even if you reserve a common event in the equip scene, it won't be run until you go to the map.
The scene interpreter allows you to run common events in every scene, but you need to tell the engine that you actually want the common event to run in the current scene.
And… how could I do that? >.<
What have you tried? You said you "tried to use" the scene interpreter but you don't explain how you used it.
I ended up placing this in the Common Event (after everything), to 'refresh' it. I am sure there is a better way, but…works for me.
SceneManager.call(Scene_Equip)
The link is down 🙁
The link has been updated.
Hi, I know this goes beyond the script of your scope. I was wondering what I could do to use this with Victor's Materia Equip. For example, I want to make a materia that enables you to Equip Guns. Once you take off the materia any gun that is equipped to the character should come off.
The materias are set up as armor, so I thought that I could use this equip/deequip script with it, but nothing happens; If you could give me some guidance it would be great. thanks for the script 🙂
You need to get someone to update victor's script to automatically remove equips that cannot be equipped. This script should detect un-equipping automatically if done correctly.
Thanks for the Script! But I seem to have a problem when the actor changes equipment to equipment. For example if actor equips dragon armor (common event ID: 001) then while wearing the dragon armor, changes to Leather armor (common event ID: 001 – I use conditional branch to keep the common event list clean) it goes to dequip sprite instead of the leather armor sprite, but if the actor removes ANY armor in general and re-equip whatever armor It chooses it works just fine. Am I doing something wrong in the common event?
When you change armors, you would first un-equip your dragon armor and then equip the leather armor. You would expect the dequip event to run first, followed by the equip event. It is possible that the order is wrong.
I looked at the script and found that the equip event is queued up before the dequip event, so that may be why.
I’ve re-ordered them based on the logic above since order of execution actually matters.
Update the script and see if that solves the problem.
works now! thanks for the quick reply! 🙂
Sry to bother you, but is this how i do it?: I create a common event that is named “song” and it will play a song when i put on armor. Then i go to my armor and write “song” in the notes box. Is that how you do it?
You copy exactly what the instructions say to tag your armor with, using the ID of the common event. If your song event ID is 2 then you write 2, not “song”
Thank you! It works! Awesome script. 🙂
How do i “tag equips” I don’t really understand the explanation on how to use… Please tell! (I’m not too familiar with scripts…)
In your database select your equip and you should see a notes box where you add tags.
Thank you!
Do I do “equip event: >common event name<"?
No, just the ID of the common event.
What are the usage conditions on this script?
Free to use
For some reason, this script seems to be incompatible with the Scene Interpreter script.
This error comes up on a clean project with only the “Scene Interpreter” script above the “Common Equip Events” script whenever I utilize a usable item with a common event attached:
http://d.pictureupload.us/152536972251b253b00d22c.png
Without this script, it runs as it should:
http://d.pictureupload.us/187816143951b25490cadf6.png
I’ve updated the script to address the issue.