Equipment that eventually triggers event

Hi, all! Thanks for helping me and everyone else!

I'm trying to make equipment that will perform a function only after certain parameters are met while it is equipped. For example: a ring that explodes after using an inn or a suit of armor that increases Strength after every 1000 XP. Another good example is the Cursed Shield/Paladin Shield from FFVI (which I think converted after 255 battles?)

My goal is to create something like a weight band that increases STR permanently after being worn for a certain variable (many variables are workable, my preferred would be XP gained or steps taken) or a system where one learns how to use certain item types by using others (i.e., gain [Equip Large Shield] after 200 XP with a Round Shield.

Thanks for your time!
if it's just a few items, I believe a parallel process common event can do the trick... but if you plan to use it for a lot of items, then yeah you will probably want a script
You can't provide just examples for this kind of thing. You need to specify what you are looking for.


In general, you need a way to keep track of the "counter" that will be used.


For example, if it's steps taken while you wear it, you need to keep track of that somewhere.


If it's time, you need to keep track of how much time has elapsed while you wear it.


A general framework can be written to make it easy to add additional cases, but I don't see a way to write it in such a way that you don't need to do any scripting on your own afterwards.


But if you can't script it probably wouldn't be of any use to you.
You can probably make a hash for each actor the uses weapon/armor IDs as one part of the key, then save number of moves + exp gained etc while wearing it. though as the number of your items grow, it might be a bit slow...
Thanks all, I really appreciate the time you're taking to respond (and as a mod for another forum, appreciate how frustrating new members can be when they don't know proper procedure.) I asked this question elsewhere on the forum and was directed here, so I apologize if this isn't really a "script" problem.

Specifically, I plan on having an armor type ("Book," eqiupped in the accessory slot) only usable by one character (already accomplished with an actor/class specific item script) which adds skills/stats to the actor permanently when conditions are met. Ideally, the game would store how many EXP were gained while this item was equipped (allowing you to switch Books and return where you left off) and teach skills/stats when certain thresholds are met.

I suppose if I can figure out how to write a common event for it, I need only have 8-10 books, so that is certainly plausible.

Thanks again for your time and thoughts; I have absorbed about as much as my brain can of this program since I got it a week ago and may need a couple days before I tackle scripting. 🙂
I see two options for you:

Yami Engine Symphony - Equipment Learning which lets you learn skills from equipped items over time using a modular Ability Point system.

The other option is to event it with the help of:

Common Event on Battle End

Set the "Victory_Common_Event_ID" to whatever common event will increase a variable ($game_variables[35]Cursed Shield for my example) after every successful battle. 

When you receive the item, have it register the number of battles fought so far (this should only be done once for when the item is received)

Control Variables: [0036:Cursed Shield Acquired] = Battle Count

Control Switches: [0021:Cursed Shield] = ON

Parallel Process Common Event that starts up when the Conditional Switch for that item is ON (in this case 0021:Cursed Shield)

>Control Variables: [0037:Cursed Shield Total] = $game_variables[36]+256 (this means that Cursed Shield Total will be 256 successful battles later)

>Conditional Branch: Variable [0035:Cursed Shield] >= Variable [0037:Cursed Shield Total]

 >Test: -,-, Normal, Bottom

     :You have broken the curse on the Cursed Shield!

  @>Change Armor: [Cursed Shield] - 1, Include Equipment

  @>Change Armor: [Paladin's Shield] + 1

  @>Control Switches: [0021:Cursed Shield] = OFF (since you don't need this event anymore)

  @>

  Else

  @>

  Branch End

And there you have it... in your case you would replace the cursed shield with the book in question, and the +256 to whatever amount of battles you want. Also you decide whether the book gets "used" when you finish learning the spell and instead of Change Armor: [Paladin's Shield] + 1 you would instead give a skill to whatever actor has it. This can be done with variables and conditional statements.
That could certainly work! General scripting question: since I am doing a number of objects, after "Victory_Common_Event_ID" do I put multiple variables separated by a comma ($game_variables[35]Cursed Shield, $game_variables[36]Cursed Ring) or does this script only work for Victory Event?

EDIT: I'm writing it out, and thinking this does not account for whether the item is equipped?

EDIT 2: I think I have it.... I'll share when I'm sure.

EDIT 3: I got it!! Using the script you linked, here's how I managed to make it so you only got credit for the battle if the item was equipped. Feel free to point out any unnecessary steps, as I am a little too overwhelmed to be quite sure.

  1. In the script: Victory_Common_Event_ID: 50[book Learnin]. Upon receipt of the book, Control Variables: [Cookbook Battles Fought] = 0

  2. Common Event 50[book Learnin]:

Conditional Branch: [Eric] is [How to Cook] Equipped

    @>Call Common Event: 51[Cooking School]

    @>

:   Else

    @>

:  Branch End

3.  Common Event 51:

Control Variables: [41: Cookbook Battles Fought] +=1

Conditional Branch: Variable [41: Cookbook Battles Fought] == 2

    Change Skills: [Eric], + [Chopping Onions]

     Else

Conditional Branch: Variable [41: Cookbook Battles Fought] == 5

     Change Skills: [Eric], + [Make a Nice Soup]

I can just add whatever books I want to [book Learnin] and it'll work across the board, I think.

Thank you all for your guidance! I got this program a week ago and immediately drank the kool-aid, and the process of learning RPGVXA, GIMP, and sound editing has left me with a fine mist where my brain once was.
The script lets you set 1 common event for each of these:

    Victory_Common_Event_ID = 1

    Escape_Common_Event_ID = 2

    Defeat_Common_Event_ID = 3

 

Furthermore the ID is the ID of the common event, not the variables.  like in the example above.

 

However inside the common event you can set conditional branches to take only certain situations into consideration.

Original thread: https://forums.rpgmakerweb.com/threads/equipment-that-eventually-triggers-event.24461/