Item that gives status to either user or enemy?

Sakurra

I want a brownie.
Veteran
Joined
Sep 1, 2015
Messages
743
Reaction score
633
First Language
English
Primarily Uses
RMMV
I want to make a berry item when if the player eats the berry, put the user to sleep. But the same berry can be thrown at an enemy, causing the foe to fall asleep. Can this be done and if so how?

Thanks for reading.
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
300
Reaction score
172
First Language
English
Primarily Uses
N/A
Set the item's scope to enemy & ally.
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
300
Reaction score
172
First Language
English
Primarily Uses
N/A
Oops, sorry. I forgot that's just in MZ.
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
300
Reaction score
172
First Language
English
Primarily Uses
N/A
Here's a non-script solution, that assumes a berry would never be used on the party in battle.

Basically you create A "Berry" item and a "Throw: Berry" item in the database. Preferably right next to each other

Create a Battle event that'll run at the start of every battle
When Turn:0
If party has Berry
set Berry amount to variable
remove Berry by variable amount
add "throw:berry" by variable amount
turn switch "berry exchange" on.


Then create a common event, Trigger: Parallel Process, Switch: Berry Exchange
Same thing but reversed
if party has Throw:Berry
set Throw:Berry to variable
remove Throw:Berry by variable amount
add Berry by variable amount
turn switch "berry exchange" off.


So in-battle the berries get converted to throw:berries; outside of battle, any throw:berries get converted to berries automatically by the common event. The items should appear in the same place in the inventory so long as they're right next to each other in the database.
You can rename "throw:berry" to just "berry"; if you want. But Idk, I think if you're going to set it up like this you might as well communicate to the player that an item can be thrown in battle.
 

Sakurra

I want a brownie.
Veteran
Joined
Sep 1, 2015
Messages
743
Reaction score
633
First Language
English
Primarily Uses
RMMV
That's a great idea. It gives me an idea of my own.

Maybe a Common Event where the player is given an option to "eat berry" or "throw at enemy"?

And then I can make it where the berry item can only be used in battles only. But I still like to be able to eat the berry outside of battle and cause sleep. But that's okay if not.

Thanks for the cool suggestions everyone. ^_^
 

Sakurra

I want a brownie.
Veteran
Joined
Sep 1, 2015
Messages
743
Reaction score
633
First Language
English
Primarily Uses
RMMV
I've worked with this a little more and made a common event for the item. Looks good so far. But I had to set it to where the item can only be used in battle. The common event shows the choices "Eat" or "Throw at the enemy"

But I would like to be able to put a conditional script to check if the player is in battle or not. And if yes, the choices show. But if now, and the player is on the map, then no choices and they are just put asleep. Edit: And if a little HP was recovered.

Is this possible?

Edit: I've run into a problem with the Common Event. I can't have the enemy be selected so I chose at random. I'm unsure as to what to do.

Edit 2: I'll probably end up scrapping the idea. :p
 
Last edited:

Latest Threads

Latest Profile Posts

Messing around with fragment shaders (filters). This thing is HUGE and I'm surprised almost no one makes good use of. Even the number of plugins that do this stuff are limited.
ScreenShot_6_28_2022_3_2_40.png

There's 7 main areas in the game that are all connected. This train get's you from an underground lab to the center of someone's subconscious. inside the train you can talk to some of the passengers. but going to the top of it, there's battles.
Speedrunning all character portraits just so they all have the same quality. Not sure if this was a good idea, but now I'm almost done.
We now have a gameplay video!
DrBuni wrote on Akiritas's profile.
That is a cute Link picture, reminds me of the Samurai Jack artstyle.

Forum statistics

Threads
123,151
Messages
1,154,416
Members
161,498
Latest member
lennonmchugh01
Top