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

Teneven

Veteran
Veteran
Joined
Sep 16, 2014
Messages
32
Reaction score
0
First Language
English
Primarily Uses
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. 
 

Warpmind

Twisted Genius
Veteran
Joined
Mar 13, 2012
Messages
936
Reaction score
578
First Language
Norwegian
Primarily Uses
Easiest way - make the item trigger a Common Event, and make the Common Event do the 50/50 roll, and subsequent consequences.
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
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.
 

Teneven

Veteran
Veteran
Joined
Sep 16, 2014
Messages
32
Reaction score
0
First Language
English
Primarily Uses
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.
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.

Easiest way - make the item trigger a Common Event, 

and make the Common Event do the 50/50 roll, and subsequent consequences.
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?
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
You call the common event via the features. :) Not via formula.
 

Neo Soul Gamer

Veteran
Veteran
Joined
Aug 10, 2012
Messages
653
Reaction score
391
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.
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
I'm pretty sure the common event runs after the skill has been used. :)
 

Neo Soul Gamer

Veteran
Veteran
Joined
Aug 10, 2012
Messages
653
Reaction score
391
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.
 

Teneven

Veteran
Veteran
Joined
Sep 16, 2014
Messages
32
Reaction score
0
First Language
English
Primarily Uses
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. >.<

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.
Tried this check screenshots to see if I did what you meant. Just tested it, poisoned me.

I'm pretty sure the common event runs after the skill has been used. :)
That's what I was thinking. I'd still have the event run at the beginning of the battle to keep the numbers circulating.
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:

Neo Soul Gamer

Veteran
Veteran
Joined
Aug 10, 2012
Messages
653
Reaction score
391
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:

Teneven

Veteran
Veteran
Joined
Sep 16, 2014
Messages
32
Reaction score
0
First Language
English
Primarily Uses
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
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."?
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
Are you using Conditional Branches? If so, use the "Else" branch instead of a new Conditional Branch.
 

WorldWakeSTU

Veteran
Veteran
Joined
Feb 5, 2015
Messages
95
Reaction score
6
Primarily Uses
try running this

ctphelp.PNG

only changing the targets and hp count as needed
 

Teneven

Veteran
Veteran
Joined
Sep 16, 2014
Messages
32
Reaction score
0
First Language
English
Primarily Uses
try running this

ctphelp.PNG

only changing the targets and hp count as needed
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:

WorldWakeSTU

Veteran
Veteran
Joined
Feb 5, 2015
Messages
95
Reaction score
6
Primarily Uses
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:

CharcoalKidd

Villager
Member
Joined
Mar 3, 2015
Messages
27
Reaction score
10
First Language
English
Primarily Uses
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.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
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.
 

EatYourBeetS

The Abysswalker
Veteran
Joined
Feb 23, 2015
Messages
96
Reaction score
30
First Language
Italian
Primarily Uses
Try putting this in the damage formula 

Code:
if rand(100)<75; 50; else; b.add_state(2); end;
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
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.
 

Teneven

Veteran
Veteran
Joined
Sep 16, 2014
Messages
32
Reaction score
0
First Language
English
Primarily Uses
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.
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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top