Event triggered by item usage

Alice

Transgirl
Member
Joined
Jun 25, 2013
Messages
13
Reaction score
0
First Language
English
Primarily Uses
If i use 5 consumable items, i want an event to appear! How would i create a common event for that? For example if a party member consumes 3 rotten food items, i want event to be triggered, like a sick status! Does anyone know how i could create the script for this?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I wouldn't use a script, it doesn't need it.  Have the item call a common event which has a variable in it to track how many times it's been called.  Then when variable equals 3 (or whatever number you want) it inflicts a state.
 

Alice

Transgirl
Member
Joined
Jun 25, 2013
Messages
13
Reaction score
0
First Language
English
Primarily Uses
I wouldn't use a script, it doesn't need it.  Have the item call a common event which has a variable in it to track how many times it's been called.  Then when variable equals 3 (or whatever number you want) it inflicts a state.
Do you mind giving an example on how to create the process? Sorry i am fairly new to this!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Create a new common event. Leave the trigger to None. In the event commands, add a Control Variables. Create a new variable, choose Add for the operation, and 1 for the constant value to add.


Then add a Conditional Branch that says if the variable you just created is equal to 3. Inside the conditional branch, add the state you want to add.


On your Item, add a new Effect. On the Other tab, choose Common event and select the common event you just created.


Now each time you consume that item, it will add 1 to the variable. After you consume 3 of them, the state will be added.


If you want the count to reset, so consuming 3 more of the item will add the state again, go back into the commands inside the conditional branch, and add another Control Variables. Select the same variable, and this time use the Set operation, and make the value 0.
 

Alice

Transgirl
Member
Joined
Jun 25, 2013
Messages
13
Reaction score
0
First Language
English
Primarily Uses
Create a new common event. Leave the trigger to None. In the event commands, add a Control Variables. Create a new variable, choose Add for the operation, and 1 for the constant value to add.

Then add a Conditional Branch that says if the variable you just created is equal to 3. Inside the conditional branch, add the state you want to add.

On your Item, add a new Effect. On the Other tab, choose Common event and select the common event you just created.

Now each time you consume that item, it will add 1 to the variable. After you consume 3 of them, the state will be added.

If you want the count to reset, so consuming 3 more of the item will add the state again, go back into the commands inside the conditional branch, and add another Control Variables. Select the same variable, and this time use the Set operation, and make the value 0.
What if i wanted to add a waiting period between each item, like let's say the party member consumed 1 rotten food and then 5 minutes later text pops up saying something like "my stomach is feeling upset"! Also during the waiting time, i need my character to be able to move! Could i just change it to a parallel process? 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
What if i wanted to add a waiting period between each item, like let's say the party member consumed 1 rotten food and then 5 minutes later text pops up saying something like "my stomach is feeling upset"! Also during the waiting time, i need my character to be able to move! Could i just change it to a parallel process? 
Not exactly.

You need a parallel process for time controls (unless you want to use a single timer only), but not on the common event for the item.

You will need a second common event, set to parallel process and controlled by a switch.

On the item event, instead of applying the state it will control the switch, activating the parallel event.

Then on that event, you place a wait command at the beginning, apply the state after the wait and then control switch to switch the parallel event off again (otherwise it would loop and apply the state again after the second time waiting.
 

Alice

Transgirl
Member
Joined
Jun 25, 2013
Messages
13
Reaction score
0
First Language
English
Primarily Uses
Oh i see now, thank you all so much! Your help is greatly appreciated! :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top