Items with special effects

I want to make an item that, when eaten can either raise a random stat or Cause a random Status state like poison or paralysis or instantly kill you. Ideally id like it to be something you could eat or use on your enemies. Is this possible?

I would also like to make an item that, when worn, will make you faster or change your sprite's appearance.
i know i have played rpg styled games that did this but i don't know how. I Just got Rpgmaker vxace for Christmas so i'm still new to learning everything.
This would be done using a Variable and a Conditional branch.

Could I suggest that you pause for a few hours (3 or maybe 4) and have a look at Andar's compilation of info for new users. In there you will find links to 2 playable tutorials, one for the Event Menu Commands and one for Switches and Variables. Being interactive, it is a very fast way to learn, and the bonus for you is that they were both made in Ace, so you can open them up in your editor and see how everything was done.

Spending a little time now on these will give you a firm grasp of 2 absolutely fundamental aspects of game making and will save you a vast amount of time and frustration in the future. You will learn a lot more than you would just by reading a step by step (very long and tedious) explanation of my opening sentence.
Hey!

1) Try using Yanfly's Lunatic Objects.

Plug in that and any of the add-ons you wish, then we'll make a new when branch within one of the add-ons. It might look a little messy, but it works just fine for little things like this. 🙂

wBOXCXF[1].png


Add in this snippet:
Code:
    when /RANDOM STATUS/i
      status = [2, 3, 4, 10, 12]
      # put the ids of status you want to inflict here
      # if you put an id in more than once, it'll be more likely to occur
     
      target.add_state(status.sample)

and then in the item or skill you want to do this, you just need to call <during effect: random status> in your notebox.

WB3IRau[1].png


If you change the name of "random status" in the script, you'll need to change it in the notebox too.

2) While there are ways to script this, you could also event it. You'll have to run common events (maybe you have one that processes whenever the player interacts with a closet or mirror?) that check to see what your hero is wearing, then make the adjustments.

N0gJeVq[1].png



iIsXpuI[1].png


M4vqEmi[1].png


I hope these are some helpful hints on your eventing journey. Have fun, and I hope the less helpful members of our community don't ruin your experience 🙂
Thankyou so much!! so when i add the

" when /RANDOM STATUS/i
status = [2, 3, 4, 10, 12]
# put the ids of status you want to inflict here
# if you put an id in more than once, it'll be more likely to occur

target.add_state(status.sample)"

I am a little confused as to how to write the possible status'es
Does the status name (for example death)
go like target.add_state(status.death)"
and do i write them all like that or do i write them as like
1= target.add_state(status.death)
2= target.add_state(status.burn) ?
i just want to make sure to write this correctly.

Hey!

1) Try using Yanfly's Lunatic Objects.

Plug in that and any of the add-ons you wish, then we'll make a new when branch within one of the add-ons. It might look a little messy, but it works just fine for little things like this. 🙂

View attachment 129872

Add in this snippet:
Code:
    when /RANDOM STATUS/i
      status = [2, 3, 4, 10, 12]
      # put the ids of status you want to inflict here
      # if you put an id in more than once, it'll be more likely to occur
    
      target.add_state(status.sample)

and then in the item or skill you want to do this, you just need to call <during effect: random status> in your notebox.

View attachment 129873

If you change the name of "random status" in the script, you'll need to change it in the notebox too.

2) While there are ways to script this, you could also event it. You'll have to run common events (maybe you have one that processes whenever the player interacts with a closet or mirror?) that check to see what your hero is wearing, then make the adjustments.

View attachment 129874


View attachment 129875

View attachment 129876

I hope these are some helpful hints on your eventing journey. Have fun, and I hope the less helpful members of our community don't ruin your experience 🙂
The numbers are the IDs of the states in the database. For example, state 1 is Death. State 2 is Poison, by default (if I recall correctly; I don't have Ace open this second). Basically, it's the little number on the leftmost side of the database page.
The numbers are the IDs of the states in the database. For example, state 1 is Death. State 2 is Poison, by default (if I recall correctly; I don't have Ace open this second). Basically, it's the little number on the leftmost side of the database page.
Oh! i understand! Thankyou!
The numbers are the IDs of the states in the database. For example, state 1 is Death. State 2 is Poison, by default (if I recall correctly; I don't have Ace open this second). Basically, it's the little number on the leftmost side of the database page.

actually, i also see that this would only apply a random status effect then, is it possible to add it so that it could also potentially Give health?, i suppose i could just make one of the status effects the hp regeneration one but ireally did want it to be able to give a specific amount of health too.. i want the chance of somthing good to be tempting enough that someone would still try and eat it despite the heavy chance of bad things happening. course if you could make the enemy eat it instead of you it would be awesome too. I litterally call it a troll item, imagine how annoyed people would get if they could also feed it to the enemy and the enemy actually heals or something XD I suppose im probably getting too ahead of myself though. i suppose just using it on oneself with the possibility of regeneration is fine :/
You'll have to use a case branch.

Code:
when /TROLL ITEM/i
outcomes = [1, 2, 3, 4]
# these are now just placeholders.
# you could also use strings if you like ("hpgen", "death", etc.)

case outcomes.sample
when 1
 target.hp += (target.mhp / 2).to_i
 # this would recover 50% HP. the "to_i" forces it to be an integer.
 
when 2
 target.mp += 25
 
when 3
 target.add_state(2)
 # adds the second state, usually Poison
 
when 4
 target.kill
 # i think you can figure out what this does
end
You'll have to use a case branch.

Code:
when /TROLL ITEM/i
outcomes = [1, 2, 3, 4]
# these are now just placeholders.
# you could also use strings if you like ("hpgen", "death", etc.)

case outcomes.sample
when 1
target.hp += (target.mhp / 2).to_i
# this would recover 50% HP. the "to_i" forces it to be an integer.

when 2
target.mp += 25

when 3
target.add_state(2)
# adds the second state, usually Poison

when 4
target.kill
# i think you can figure out what this does
end

Okay, neat! So let me see if i get this right, i write that on a different area on a different line on the script area and then to make it so it activates when the item is used i have to write " <during effect: Troll item>" on the note on the item itself ? Is it that easy?
Okay, neat! So let me see if i get this right, i write that on a different area on a different line on the script area and then to make it so it activates when the item is used i have to write " <during effect: Troll item>" on the note on the item itself ? Is it that easy?
It must not be that easy because if i put <during effect: Troll item> in the note it does nothing. i cant even use the item or it gives an error noise. So clearly i have to put an actuall effect on like gives 0 tp or something that gives the illusion of it being something i can use, but even then the random effects don't seem to happen.
can you screenshot the item's database page and the script you have this in?
Moved to: RGSS3 Script Requests
In addition

Double-post notice: WeeMoffling
If you want to add something, simply use the Edit button on your earlier post and type in the additional info/comment. If you want to include more than one quote, please use the Multiquote button, otherwise the forum software creates a new post for each quote. If, however, you are only quoting in order to indicate who you are replying to, then it is better to use @ plus the person's username, like this @WeeMoffling This will send a notification to the person that you have replied to them.
@Crazetex

[/QUOTE]
can you screenshot the item's database page and the script you have this in?

Original thread: https://forums.rpgmakerweb.com/threads/items-with-special-effects.116731/