My objective is to decrease a variable and the actors mp. But the variable that is decreased depends on the actor the item is used on. But I can't seem to figure out how to do it. Is their a specific scriptCall that selects the actor an item is used on?
Calling Common Events with Items
Learning Javascriptno need for a script (although there are some plugins that give such scripts)
With eventing, you add a state as the effect, a state that is invisible and does nothing,named "targeted"or something like that.
Then, in the common event you check all actors until you find the one with that state (conditional branch), apply the effect you want and remove the state.
With eventing, you add a state as the effect, a state that is invisible and does nothing,named "targeted"or something like that.
Then, in the common event you check all actors until you find the one with that state (conditional branch), apply the effect you want and remove the state.
Code:
$gameParty._targetActorId
This will return ID of actor wich item you used on.
Eg. Actor with ID 7 uses your book on leader, then this code will return 1, wich is party leader and you can assign this to your variable.
Thread closed IgnoreMe
Original thread: https://forums.rpgmakerweb.com/threads/calling-common-events-with-items.105430/