BlueToo

Villager
Member
Joined
Jul 13, 2022
Messages
20
Reaction score
6
First Language
English
Primarily Uses
RMMZ
Looking for a way to have an item that has a passive effect when picked up (NOT WHEN USED, ONLY PICKED UP). I have a plugin called ABS Z that has enemies drop loot when destroyed on the map, and I want it such that when you pick up that loot, you get a passive (think of a powerup in pac-man).

The only hits I'm getting on Google are for yanfly's "Skill & States Core" plugin, which is NOT able to produce the effect I want. Many of the powerups I want change variables (which means calling a common event), but no passive state is able to launch a common event.

How would I go about doing this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,609
Reaction score
10,333
First Language
German
Primarily Uses
RMMV
if you are using evented enemies, that i as easy as giving the enemy an alternate page that drops the loot but is conditioned to that item.

if you want the effect in random enemies it will be much more difficult to achieve, probably by some troop event checing for the existance of that item.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,947
Reaction score
4,789
First Language
English
Primarily Uses
RMMV
Just to clarify a few of your points:
The only hits I'm getting on Google are for yanfly's "Skill & States Core" plugin, which is NOT able to produce the effect I want.
Even if it were, that's an MV plugin. You want to be careful when researching things because most MV plugins of any complexity aren't compatible with MZ. (some are, and some will work via Project FOSSIL, but then you need to be researching the individual plugin) As caethyril said, VisuStella makes equivalents to many of the Yanfly plugins.

Many of the powerups I want change variables (which means calling a common event), but no passive state is able to launch a common event.
That's not really the case. For one thing, you can absolutely call a common event from anyplace that executes code. For another, you can directly change variables anyplace that you're executing code, so a common event may not be necessary (depending on what else you have going on in there).
 

BlueToo

Villager
Member
Joined
Jul 13, 2022
Messages
20
Reaction score
6
First Language
English
Primarily Uses
RMMZ
if you are using evented enemies, that i as easy as giving the enemy an alternate page that drops the loot but is conditioned to that item.

if you want the effect in random enemies it will be much more difficult to achieve, probably by some troop event checing for the existance of that item.

Interesting. So something like using $gameParty.gainItem and then using conditions to increase the variable? Could you give an example of what that would look like?

I'm not really sure how the item would "drop" though, since it would put it directly into the inventory.

What about this notetag from VisuStella Skills & States Core?

<JS Passive Condition> condition = $gameParty.numItems($dataItems[123]) > 0; </JS Passive Condition>

I.e. "the passive state is active iff the party has at more than 0 of Item ID 123 in the inventory".

I end up doing this, but by using a parallel event that checks every second instead. It's not super-efficient (since it's a parallel event running pretty much at all times) but it's good enough for now I guess. No need for a plugin I suppose.

Those passive conditions do not work when used on items (being held) in the Skills & States Core plugin, sadly.

Just to clarify a few of your points:

Even if it were, that's an MV plugin. You want to be careful when researching things because most MV plugins of any complexity aren't compatible with MZ. (some are, and some will work via Project FOSSIL, but then you need to be researching the individual plugin) As caethyril said, VisuStella makes equivalents to many of the Yanfly plugins.


That's not really the case. For one thing, you can absolutely call a common event from anyplace that executes code. For another, you can directly change variables anyplace that you're executing code, so a common event may not be necessary (depending on what else you have going on in there).

It is not an MV plugin. Source
Probably should have said Visustella instead of Yanfly. I thought they were the same people.

You cannot call a common event from an item being held, as it only has a note tag. The effects only apply on use.



Thank you for the feedback
 
Last edited:

Sword_of_Dusk

Ace Attorney
Veteran
Joined
Sep 13, 2015
Messages
1,019
Reaction score
1,035
First Language
English
Primarily Uses
RMMV
Those passive conditions do not work when used on items (being held) in the Skills & States Core plugin, sadly.
You don't put them on the item. You put them on the state and then add the state to an actor. When the required item goes into your inventory, the state takes effect. That notetag should solve your issues.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,609
Reaction score
10,333
First Language
German
Primarily Uses
RMMV
So something like using $gameParty.gainItem and then using conditions to increase the variable? Could you give an example of what that would look like?
no, both of my suggestions were completely without any script or plugin, using only pure eventing.

check the conditions for map event: there is one called "item".
That actually means "item in inventory", which means that this condition triggers as soon as the item is in inventory.

then you make your evented enemy with two almost identical pages: one page with the battle processing but no drop (add item command) after that, and a second page conditioned to that item that has an add item command to simulate the drop after the battle is won.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,947
Reaction score
4,789
First Language
English
Primarily Uses
RMMV
You cannot call a common event from an item being held, as it only has a note tag. The effects only apply on use.
It depends 100% on when you want the common event to trigger. Across the VisuStella plugins there are many notetags available for states with various triggers. As I said, you can call a common event anyplace you can evaluate code, it has nothing to do with the Effects attached to an item in the database.

You can also pretty easily use passive states in conjunction with parallel events to do this. For example, use the code caethyril provided for the condition for the passive state to be on, then have a parallel event that checks every 30 frames or so for the presence of that passive state and calls the appropriate common event when it's found.

And there's the purely event-driven solution offered by Andar. I think you have a number of good possibilities here.
 

Latest Threads

Latest Posts

Latest Profile Posts

Now that I have linklists on large trees and cars, is there any theme that would interest you?
Debugging multiplayer issues... I'm having fun, right?
yay_streaming.jpg

For just starting streaming on the 10th... Definitely not the worst. :LZScheeze:

Granted I need 333.34 hours a month on average to achieve money. So I don't really expect that, but it sure has helped my game dev go much faster.
Proud on how this map turned out.

FnmhDLIXgAAOvIC
I just finally fixed a huge problem that wouldn’t let my game load and would crash it.. I thought that I was gonna have to trash the project and start over lol

Forum statistics

Threads
128,328
Messages
1,193,648
Members
168,813
Latest member
jasper1hu
Top