Remove state not working

Discussion in 'RPG Maker MV' started by panpaper, Aug 12, 2017.

    Tags:
  1. panpaper

    panpaper Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    First off I want to say thank you, this community has been amazing, with all the helpful and swift responses!

    I'm trying to implement a sidearm where the player can use a gun as a secondary weapon. In order to use the gun, the player must "consume" an ammunition item from the inventory. Doing so will grant them the "locked and loaded" state.

    The "locked and loaded" states gives access to the "Gun" skill type. The player will then be able to use the skill "Open fire". When the skill "Open fire" is used, I want the state "locked and loaded" to be removed, so that the player must consume another ammunition item before they can use "Open fire" again. The following image shows the State and Skill entry:

    Untitled.png
    I've listed "Remove State - Locked and Loaded 100%" as the skill effect for "Open Fire", but the state never gets removed when the skill is used (I can still see the icon beside the player's name). I know I can probably add "seal skill type" to "Open fire", but I want to know what I've done wrong, so I can avoid such mistakes again.

    Thanks in advance!
     
    #1
  2. LadyBaskerville

    LadyBaskerville Hell-poodle Veteran

    Messages:
    645
    Likes Received:
    490
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    The effects are applied to the skill's target, not the user - that's why the state isn't removed from your actor. To change the user's state, you can use the damage formula (which can also evaluate Javascript commands):

    a.removeState(STATE_ID); 25

    This will remove the state from the user (a), and then deal 25 damage. (When using the damage formula for things like this, the last line - what's written after the last semicolon - will always be the actual damage value.)
     
    #2
  3. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,970
    Likes Received:
    10,663
    First Language:
    English
    Primarily Uses:
    RMVXA
    Your image is not there.
     
    #3
  4. panpaper

    panpaper Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    I completely overlooked that! This clears up this issue and opens some other possibilites, thank you very much!
     
    #4
  5. panpaper

    panpaper Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    I'm seeing it right now, uploaded it using the built-in file upload in the forum.
     
    #5
  6. panpaper

    panpaper Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    I could not find this function in the help and documentation. Is there a reference list of all the functions I can put in the formula box?
     
    #6
  7. LadyBaskerville

    LadyBaskerville Hell-poodle Veteran

    Messages:
    645
    Likes Received:
    490
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    #7
    panpaper likes this.
  8. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,970
    Likes Received:
    10,663
    First Language:
    English
    Primarily Uses:
    RMVXA

    panpaper, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


    Actually it's a triple post. If you want to add something, simply edit your earlier post. If you want to quote more than one person, use the Multi-quote option and then you can insert a quote, reply to it, insert the next quote and reply to that and repeat as often as necessary.

    Actually, it is often better not to quote (especially whole quotes, which makes it more difficult for those accessing this on their phones) and instead just tag the person by typing @ followed by the username. A dropdown list appears, and you select the person you want.
     
    #8
  9. panpaper

    panpaper Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    @Kes sorry I did not know that. I'll take note from now on, thanks!
     
    #9

Share This Page