Learning a Skill from an Item

Discussion in 'RPG Maker MV' started by Caner, Jan 24, 2018.

  1. Caner

    Caner Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Hello,

    This is a rather complicated task for me as I am not that good at js and I tend to do things the hard way.

    I’m developing a game in which the party collects stone tablets. Party members can learn skills by using these tablets. That is easy but...

    I would like a member to be able to learn the skill if s/he is the required level or class.

    e.g. Connor finds the tablet Stun. He can learn the Stun skill by using the tablet. Stun skill is a level 4 skill. Conner is level 4. So I can use tablet on Connor and he can learn the skill.

    However, there is another party member, Leon. Leon is level 2. When I want to use the tablet on Leon, he cannot learn the skill and I would like to see a message that says “Leon needs to be Level 4 to learn Stun.”

    How do I use variables or conditionals on items. I did it some way using a common event but then I cannot the specify the actor.

    Can you help me?
     
    #1
  2. Kes

    Kes Global Moderators Global Mod

    Messages:
    19,207
    Likes Received:
    9,839
    First Language:
    English
    Primarily Uses:
    RMVXA
    'Game Mechanics Design' is for looking at aspects of gameplay at a more conceptual level. "How do I...?" (implementation) questions go in the Support forum for the engine you are using.

    I've moved this thread to RPGMaker MV. Please be sure to post your threads in the correct forum next time. Thank you.



    First you have to identify who the target for the item is.
    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. In the case of the wrong user that might be "show text: you can't use this".
    Within the Connor branch of the conditional, have another one which checks his level is 4 or above. If it is, he learns the skill, if it's not, some text e.g. you are not experienced enough to handle this.
     
    Last edited: Jan 24, 2018
    #2
    Caner likes this.
  3. Zarsla

    Zarsla Veteran Veteran

    Messages:
    674
    Likes Received:
    190
    First Language:
    English
    2.Do this in the item screen:

    Screenshot (12).png


    Do this in the Common Event:

    Screenshot (35).png

    And for the Variable:

    Screenshot (31).png

    and in the text message replace \n[1] with \n[x] where x is the actor id, of the actor you're checking.

    3. Some Cavets about doing this like this.
    1. For every actor in the database you must do this for. If they will not be able to be affected by this system/item then do this: Screenshot (37).png
    2. You are either going to have a very, very, very, very long common event or you're going to have a lot of common events, depending on whether you make 1 event per item or place it all in one common. Also the amount of skills you have is going to determine the amount of these you do
     
    #3
    Caner likes this.
  4. Caner

    Caner Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Wow, thank you for the detailed descriptions.

    @Zarsla I exactly did what you did and it was a really, really long common event with effects and everything. I was happy with it but it is a little counter-intuitive as it still checks if the first actor has the skill or not even though I use the item on the second actor. Do you think there is a script that goes like this?

    IF Item#1 used on Actor#1
    do this do that
    IF Item #1 used on Actor#2
    do this do that

    What do you think?
     
    #4
  5. Zarsla

    Zarsla Veteran Veteran

    Messages:
    674
    Likes Received:
    190
    First Language:
    English
    Well right now, your other alternative is to use plugins.However you won't have a message shown when you use the items.
    If you go the plugin route:
    YEP Core Engine
    YEP Item Core
    YEP Item Requirements
    YEP Skill Core

    Set the item up to add a new state.

    In the item notetag:
    <After Eval>
    target.removeState(x);
    target.learnSkill(y);
    </After Eval>
    <Custom Enable Requirement>
    condition = target.level >= z;
    </Custom Enable Requirement>

    Where x is the state id, y is the skill id, and z is the lowest level you can be to use this item.
     
    #5
    Caner likes this.
  6. Caner

    Caner Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you very much. I will be trying all the options right now. Will get back to you with the results!
     
    #6
  7. Caner

    Caner Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    IT WORKED! Thank you very much. Works like a charm!
    Though I had to have a very long common event, it doesn't matter as I need all those effects and messages.

    Cheers!
     
    #7
  8. Zarsla

    Zarsla Veteran Veteran

    Messages:
    674
    Likes Received:
    190
    First Language:
    English
    You don't really need the common event anymore. However I'm happy it work.
     
    #8

Share This Page