Leetstuff

Villager
Member
Joined
Oct 27, 2015
Messages
26
Reaction score
2
First Language
Portuguese
I'm trying to make an item that changes its effects after a certain number of steps. The problem is that if I Control Variables : # = Steps, it counts all the steps made during the game. Here's what I would need to make my items work:


1. Resetting the Step number;


2. Have a different counter for each item.


Is there a way to do it without plugins or scripting? If there's such plugin or script, what is it?


Thanks!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,891
Reaction score
8,592
First Language
German
Primarily Uses
RMMV
When the item is used, store the current steps into a variable.


When you later check the count, use a different variable for the then-current count, and substract the first variable from the second with an additional control variable command. What remains is the difference, the number of steps since activation
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,147
Reaction score
8,936
First Language
English
Primarily Uses
RMMV
I've moved this thread to MV Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

Leetstuff

Villager
Member
Joined
Oct 27, 2015
Messages
26
Reaction score
2
First Language
Portuguese
When the item is used, store the current steps into a variable.


When you later check the count, use a different variable for the then-current count, and substract the first variable from the second with an additional control variable command. What remains is the difference, the number of steps since activation

I'm still having trouble constructing it. 


Basically what I want is to make an item called "Hot tea" that becomes "Cold tea" after 50 steps.


I can't figure out how do I check "Var 1 - Var 2 = 50" or something like that.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,891
Reaction score
8,592
First Language
German
Primarily Uses
RMMV
1) when tea is started, control variable "tea step start" = current steps


2) when you want to check, or in a parallel process common event with a wait(10) at the end:


2a) control variable "tempcheck" = current steps


2b) control variable "tempcheck" substract "tea step start"


2c) conditional branch variable "tempcheck" <=50


2d) - do whatever you want depending on condition true or else


2e) wait(10) - if it is inside a parallel process
 

Leetstuff

Villager
Member
Joined
Oct 27, 2015
Messages
26
Reaction score
2
First Language
Portuguese
1) when tea is started, control variable "tea step start" = current steps


2) when you want to check, or in a parallel process common event with a wait(10) at the end:


2a) control variable "tempcheck" = current steps


2b) control variable "tempcheck" substract "tea step start"


2c) conditional branch variable "tempcheck" <=50


2d) - do whatever you want depending on condition true or else


2e) wait(10) - if it is inside a parallel process

Sorry, this isn't working or I'm not understanding it properly.


The wait(10) is for the player to make the 50 steps?


The way this is set up 2b subtracts constantly if it's a parallel process.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,891
Reaction score
8,592
First Language
German
Primarily Uses
RMMV
2a loads a new step number in every cycle, so 2b will just substract once from that number.


the wait 10 is the command wait for 10 frames, because otherwise the parallel process would run every frame and that only produces lag.


Please post a screenshot of your events so far, then I can check where you did something wrong if it doesn't work.
 

Leetstuff

Villager
Member
Joined
Oct 27, 2015
Messages
26
Reaction score
2
First Language
Portuguese
2a loads a new step number in every cycle, so 2b will just substract once from that number.


the wait 10 is the command wait for 10 frames, because otherwise the parallel process would run every frame and that only produces lag.


Please post a screenshot of your events so far, then I can check where you did something wrong if it doesn't work.

Everything is mounted as you said:







The problem is that, after the 50 steps, it's repeting the event over and over — decreasing the number of Boiling Water and increasing the number of Boiled Water every 10 frames. 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,891
Reaction score
8,592
First Language
German
Primarily Uses
RMMV
of course - you need to turn off the event when you get the first boiled water - that's part of the same sequence that changes the item numbers inside the conditional branch.
 

Leetstuff

Villager
Member
Joined
Oct 27, 2015
Messages
26
Reaction score
2
First Language
Portuguese
What's the best way to do it? Considering that I want the player to be able to do it again, is it better to turn off the switch or add something on the end of the if?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,891
Reaction score
8,592
First Language
German
Primarily Uses
RMMV
you need to turn off the switch 6 - there is no alternative unless you want your game to lag.


And when the player starts the sequence again, that is where you both set the waterboil variable to the current steps and turn on the switch after that.
 

Latest Threads

Latest Profile Posts

Ugh... 4:53AM over here and I can't sleep so why not just game make.
I just love the MV feature that allows you to create your own animations!
I typically ask this on my normal social media channels, but figured there may be good replies here. Anyone got any good horror movie recommendations? I've seen a lot, but I always love getting suggestions! Bonus points if you know which service it is streaming on (in the US) - bring on the spOoooOky!
 After a few distractions (and my annual rough second week of October), I’m getting back on track with my OMGC project.
 Am I overcomplicating it? Yes. Am I going to tone it down? Almost certainly not.
 At least the dialogue stuff is almost done. I need to do the map itself, and then all that’s left is combat.
 Getting there!

Forum statistics

Threads
115,910
Messages
1,093,898
Members
151,159
Latest member
rlawlsrjs3387
Top