How to make an item heal with a 25% chance to poison?

Discussion in 'RPG Maker VX Ace' started by Teneven, Mar 11, 2015.

  1. Teneven

    Teneven Veteran Veteran

    Messages:
    32
    Likes Received:
    0
    Location:
    Hyrule
    First Language:
    English
    My game is called Death's Glance. It's set in a world of magic. So, guns and technology aren't needed. Thanks to magic, the development of technology is much slower, meaning 100 years after Medieval Times ended for us, the era of the sword and of the shield is still thriving. Monsters have many resources within their bodies, and only those so inclined take up alchemy. 

    I'm thinking monsters could drop items (already know how to do that) that have a positive effect, bt may also inflict a negative one. 

    For instance, Green Goo is dropped by a Slime, and you can eat it to heal yourself by 50 HP. OR, it might poison you. I have no idea how to make an item do that. 
     
    #1
  2. Warpmind

    Warpmind Twisted Genius Veteran

    Messages:
    914
    Likes Received:
    564
    Location:
    Outside Bergen, Norway
    First Language:
    Norwegian
    Easiest way - make the item trigger a Common Event, and make the Common Event do the 50/50 roll, and subsequent consequences.
     
    #2
  3. Liak

    Liak Veteran Veteran

    Messages:
    1,789
    Likes Received:
    269
    Location:
    Germany
    First Language:
    German
    Unfortunately, I can't help with the custom formula for that item, but I would like to say that you should think again about whether you really want stuff like that. I imagine it being extremely frustrating when I'm so desperate that I use a consumable (you normally use skills, right? Because consumables are limited) and then not only does it not work, it even works AGAINST me.
     
    #3
  4. Teneven

    Teneven Veteran Veteran

    Messages:
    32
    Likes Received:
    0
    Location:
    Hyrule
    First Language:
    English
    The game is meant to be pretty hard, and emphasize strategy and risk taking. Yes, it does make it hard, but hard in an interesting way. In a situation like that IRL, if you had a piece of raw meat (the Green Goo) and you're starving (or low on HP) and the raw meat (/Green Goo) can help or hurt you, but if you had access to a fire (or alchemy table) then it coudln't hurt you, but you might die before you find one. What to do? That'

    s the kind of thing I want in this game. Although, it could seem like the game is cheating you, which is why I have a few testers telling me what they think.

    I can do what I put on the first line, but not the second. Might be sounding noobish now, but how would I do that?
     
    #4
  5. Liak

    Liak Veteran Veteran

    Messages:
    1,789
    Likes Received:
    269
    Location:
    Germany
    First Language:
    German
    You call the common event via the features. :) Not via formula.
     
    #5
  6. Neo Soul Gamer

    Neo Soul Gamer Veteran Veteran

    Messages:
    612
    Likes Received:
    329
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    N/A
    http://forums.rpgmakerweb.com/index.php?/topic/25063-conditional-effects/

    This creates conditions for which effect is going to be applied when the item/skill is used. Just run a common event that sets a variable to a random number. So for instance, if you have a common event that sets Variable 001 to a random number between 1 and 3... Then your notetag for the item should look like this.

    <effect condition: 1>v[1] == 1</effect condition><effect condition: 2>v[1] == 2</effect condition><effect condition: 3>v[1] == 3</effect condition>This way, each time the item is used, a random effect can occur. Just make sure that you run the common event at the beginning of each battle to be safe. I'm not exactly sure when the common event is processed. If could either be before, or after the effect takes place. Honestly not sure.
     
    #6
  7. Liak

    Liak Veteran Veteran

    Messages:
    1,789
    Likes Received:
    269
    Location:
    Germany
    First Language:
    German
    I'm pretty sure the common event runs after the skill has been used. :)
     
    #7
  8. Neo Soul Gamer

    Neo Soul Gamer Veteran Veteran

    Messages:
    612
    Likes Received:
    329
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    N/A
    That's what I was thinking. I'd still have the event run at the beginning of the battle to keep the numbers circulating.
     
    #8
  9. Teneven

    Teneven Veteran Veteran

    Messages:
    32
    Likes Received:
    0
    Location:
    Hyrule
    First Language:
    English
    EDIT:Totally forgot to attach the screenshots and how. Posted them to my twitter (https://twitter.com/ThatWhovianDude), it's the tweet right below the pinned one that says " Let me be the Kirito to your Asuna... pizza." the one that says "Can't remeber how to attach a photo from my hard drive on the RPG Maker Forums. Derp." Agh, I really hope I'm not forgetting a forum rule here....

    EDIT 2: Tried what's in the screenshots, no go. It did all of them at once, not one of them. >.<

    Tried this check screenshots to see if I did what you meant. Just tested it, poisoned me.

    I'm meaning to make an item that might poison. Not a skill. I'm assuming this applies to both? The item will either be usable at any time, or only on the field.
     
    Last edited by a moderator: Mar 11, 2015
    #9
  10. Neo Soul Gamer

    Neo Soul Gamer Veteran Veteran

    Messages:
    612
    Likes Received:
    329
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    N/A
    Your screenshot is wrong. What you did was set 3 different variables to 0. What you need to do is set the variable to a random number between 1-3.

    When you open the control variables event, the following options should be chosen...

    Variable: Single

    Operation: Set

    Operand: Random: 1~3
     
    Last edited by a moderator: Mar 11, 2015
    #10
  11. Teneven

    Teneven Veteran Veteran

    Messages:
    32
    Likes Received:
    0
    Location:
    Hyrule
    First Language:
    English
    I must have been doing something else wrong. >.< It still didn't work. However, I may have found another way. I can make it have a 75% chance to heal, and a 25% chance to poison, but it can do both.Is there a way to maybe say "If heal fails, poison."?
     
    #11
  12. Liak

    Liak Veteran Veteran

    Messages:
    1,789
    Likes Received:
    269
    Location:
    Germany
    First Language:
    German
    Are you using Conditional Branches? If so, use the "Else" branch instead of a new Conditional Branch.
     
    #12
  13. WorldWakeSTU

    WorldWakeSTU Veteran Veteran

    Messages:
    95
    Likes Received:
    6
    try running this

    ctphelp.PNG

    only changing the targets and hp count as needed
     
    #13
  14. Teneven

    Teneven Veteran Veteran

    Messages:
    32
    Likes Received:
    0
    Location:
    Hyrule
    First Language:
    English
    This is what I ended up with. Works perfectly, except I didn't see "Effect User" anywhere. I was thinking I'd have more characters than just Aain in the near future. Meaning it should effect the one specific person. The idea is that they ingest the Green Goo, so not all of them would be effected. I need it to be dependent on who it's used on.

    capture-20150312-120951.png
     
    Last edited by a moderator: Mar 13, 2015
    #14
  15. WorldWakeSTU

    WorldWakeSTU Veteran Veteran

    Messages:
    95
    Likes Received:
    6
    your going to need to set a variable to the item user then set effect to variable but i am unable to help you with the variable part sorry
     
    Last edited by a moderator: Mar 15, 2015
    #15
  16. CharcoalKidd

    CharcoalKidd Villager Member

    Messages:
    27
    Likes Received:
    10
    First Language:
    English
    Under the Items tab of the Database, can you not just use 'Features', add the state "Poison", then set the odds to "25%" in the bit underneath? Or is there part of this scenario that I'm not grasping.
     
    #16
  17. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,226
    Likes Received:
    3,556
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    The easiest way to do it would be to have BOTH effects - a 50 HP heal (normal healing formula), and a 25% chance to poison (normal entry in the feature box).

    If you insist on having it do one OR the other, it can still be done; just a bit more complicated:

    • Choose a single switch and a single variable to set aside for ONLY this skill.  Don't use that switch or variable for anything else in your game.
    • In the formula for the skill, use this: $game_variables[v] = b.id; if rand(100) < 75; $game_switches = false; dmg = 50; else; $game_switches[n] = true; dmg = 0; end; dmg    Note that v and s are the IDs of the variable and switch you just set aside.  dmg can be shortened to just d, and the spaces after the semicolons can be removed, if the formula is too long.
    • Add a Common Event to the features box for the skill.  Inside the common event, have a conditional branch that checks whether the Switch is True.  If so, do the following (and if false, do nothing at all): if the Variable is equal to 1, poison Eric; if the Variable is equal to 2, poison Natalie; and so on for each of the actors in your game.
     
    #17
  18. EatYourBeetS

    EatYourBeetS The Abysswalker Veteran

    Messages:
    96
    Likes Received:
    30
    Location:
    Italy
    First Language:
    Italian
    Try putting this in the damage formula 

    Code:
    if rand(100)<75; 50; else; b.add_state(2); end;
     
    #18
    Wavelength likes this.
  19. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,226
    Likes Received:
    3,556
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Ah, yes.  I can't believe I didn't think to just put an add_state in the else block.  Use Eat's solution above.
     
    #19
  20. Teneven

    Teneven Veteran Veteran

    Messages:
    32
    Likes Received:
    0
    Location:
    Hyrule
    First Language:
    English
    I could, but the idea was that there was a 75% chance of it working, or it will backfire. That solution makes it more likely to do both. I ended up making a variable random 1-4, then a conditional branch meaning if the variable is equal to or less then 3, it heals Aain by fifty HP, else it posions, that common event is called when the item is used.
     
    #20

Share This Page