Step Counting Var

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
31,355
Reaction score
7,668
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
15,351
Reaction score
8,532
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
31,355
Reaction score
7,668
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
31,355
Reaction score
7,668
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
31,355
Reaction score
7,668
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
31,355
Reaction score
7,668
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.
 

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,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top