Hey,
I want an Actor to be able to use 1 or more items that is exclusive for him/her...
EXAMPLE
Item: Apple
Description: Can only be consumed by Johnny
Actually, it can be done through a Common Event - though that's a bit clunkier.
Ah, do you mean by "doing nothing but adding the item back"? I suppose I hadn't thought of that.
no, it's even clunkier than only "doing nothing" - that common event needs to identify the target to know if it should do nothing, and for that you'll need the item to place an invisible state and then the common event to check which actor has that state to identify the target of it, remove that state and decide on which effect or no effect to give.
yes, as warpmind said it can be done by pure eventing - but it needs a lot of tricks to get it right.
I think this can be done by using a common event and a few ruby commands.
Let's analyze this and we can have a more experienced user actually give us the ruby commands needed.
Say we got three apples. All right? Apples are used by actor id = 1 and 4 (in the database)
Better yet, Apple is usable by CLASS id = 1 for exapmple, and actors 1 and 4 are THAT class.
So first off we need a command that assigns the id of a class to a variable. 🙂
Then we need the amount of members into a party.
This is event possible I think. Correct me if I am wrong.
According to what the quantity is, we will event the rest of the action.
We need a Common Event with a Conditional Branch that will assign every party member's id to variables.
This is Event possible.
We can now check if each player id is of that certain class. If so, this will be used.
Now if you want to do this during battle thing gets a little more complicated.
You will have to use a command that gets the id of the player that is actually about to use the item.
This is hard to be done I suppose but I found a "small hack" to do it.
Instead of id you can take the Luck of every hero.
Here is the twist:
Luck modifiers are nowhere.
Luck growth curve to all classes is set to 0
You got significant different actor Luck starting bonus of Luck for each Actor.
For example Hero 001 starts with Luck = 1
Actor 002 has luck = 100
Actor 003 has luck = 200
and so on.
That way, you will know who is who during battle. 😉
Conditional Event comparing Luck if it is >200 then
It's actor 003 do what is about to be done
inside ELSE you put another Conditional branch if it is >100 then
It's actor 002 do what is about to be done
inside the else of that conditional branch
you put the last case (it's actor 001)
Drawback: You unfortunately lose the utility of Luck and you MUST remove it from any damage formulas and other formulas using it on any script.
Well, rewriting the engine to have luk removed seems like overkill when a script which sets custom conditions for items has both already been provided, and is what OP is looking for 😉
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
I was actually able to do this through a common event although it was only through testing. I'm not sure how it will exactly play out once I get my game started. But as of the moment common event is working.
Thanks!