How can I make items only usable on certain characters?

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
I have Scrolls in my game that teach a character a new skill or spell. There's two characters - one of which uses spells and the other uses skills. Even if you give a Spell Scroll to the skill user, she can't actually use it. Problem is, there are a few of these Scrolls which are one of a kind, and if you were to use it on the wrong character... then you would forever be locked out of learning that skill or spell.

How can I restrict it so that you can only use the item on the intended character?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
only by eventing or by scripts - the events are usually the simpler solution, but in special cases you might need to add scripts.


Make the item place a "target state" on the actor using it and then call a common event.


In the common event, use conditional branches to check which actor has the "target state" to identify the item user


Then have the branch for that user do the commands intended - in the case of the wrong user that might be "show text: you can't use this".


If you have a large number of actors, those branches will also get large - that's when you'll need to add some scripts, for example Tsukihime has an script for event calls that automatically places the user's actor ID into a variable to be checked and used.
 

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
only by eventing or by scripts - the events are usually the simpler solution, but in special cases you might need to add scripts.

Make the item place a "target state" on the actor using it and then call a common event.

In the common event, use conditional branches to check which actor has the "target state" to identify the item user

Then have the branch for that user do the commands intended - in the case of the wrong user that might be "show text: you can't use this".

If you have a large number of actors, those branches will also get large - that's when you'll need to add some scripts, for example Tsukihime has an script for event calls that automatically places the user's actor ID into a variable to be checked and used.
Actually it sounds like the first method will probably work since I only have two Actors. Thanks :)

Edit: So wait, will I have to do this for every single scroll in the game?
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
YES... since they will have different effects...
 
Last edited by a moderator:

Centipede

No wait, that's the King.
Veteran
Joined
Feb 17, 2013
Messages
69
Reaction score
6
First Language
Baby talk
Primarily Uses
Do you have the link to this script? Please?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
The link to the script is on the master script list as well as on Tsukihime's blog.


Just search the forum for either the master script list and follow that link, or search for the username - the link to her blog is in the profile
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top