Multi Timers

mads_in_zero

Villager
Member
Joined
Mar 8, 2019
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
Ahh, okay! Thanks for the suggestions.

However, even when I enter:

Code:
AddTimer SongLogic 12.409 \sets(1, true)
(12.409 being the length of the first chunk), even with the change to the plugin file itself, fractions of a second don't seem to work, and the switch doesn't trigger.
 

bazrat

Pixel Game Maker MV
Veteran
Joined
Oct 15, 2018
Messages
240
Reaction score
168
First Language
English
Primarily Uses
Other
Has anyone ever got yep_self-switch/var plugin to be able to use with the timer?

Whenever I try the plugin command inside the event that the yep-self switch is being used it only turns off the actual switch (which is already off cause its being used as a self switch).

It works on the normal self switches A-D so i have the right command. Just wondering if anyone has got this way to work?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,402
Reaction score
12,939
First Language
English
Primarily Uses
RMMV
Please show the command you're using which works successfully, and the one which doesn't. Also a link to Yanfly's plugin to save us the trouble of searching for it.
 

bazrat

Pixel Game Maker MV
Veteran
Joined
Oct 15, 2018
Messages
240
Reaction score
168
First Language
English
Primarily Uses
Other
Please show the command you're using which works successfully, and the one which doesn't. Also a link to Yanfly's plugin to save us the trouble of searching for it.
Thanks for the reply Shaz.

Here is the link to yep self switches/variables: http://yanfly.moe/2016/08/06/yep-113-self-switches-variables-rpg-maker-mv/

Here is the command that works, by using a default self switch B:
Code:
addTimer <thismap>.<thisevent>.yepss1 3 \setss([<thismap>, <thisevent>, 'B'], true)
Here is the command that doesn't work, trying to use yeps self switch which is switch 62 and labeled Self Switch 1:
Code:
addTimer <thismap>.<thisevent>.yepss1 3 \setss([<thismap>, <thisevent>, 'Self Switch 1'], true)
I have also tried running it as a normal switch command, hoping it might recognized the ss version of switch 62:
Code:
addTimer yepss1 3 \sets(62, true)
But it didn't, it just turns on the actual (global) switch. Just was trying all possibilities.

Why can't I just use self switch A-D? That is a good question lol, we run ABS in our project and A+B self switches are taken up by event sensor plugins and the remaining for the ABS hit types. Your plugin works wonders with the way our enemies are programmed, but with the limitation to only the default A-D selfswitches its led me here to ask if it's possible to have yep SS be recognized.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,402
Reaction score
12,939
First Language
English
Primarily Uses
RMMV
Yanfly's plugin uses the switch number, not the name/label (the label is just an easy way for you to indicate which ones are self switches, but that's the only thing they're used for). If you turn on switch 62, it will update the self switch [mapid, eventid, 'SELF SWITCH 62']

Try this:
Code:
addTimer <thismap>.<thisevent>.yepss1 3 \setss([<thismap>, <thisevent>, 'SELF SWITCH 62'], true)
 

bazrat

Pixel Game Maker MV
Veteran
Joined
Oct 15, 2018
Messages
240
Reaction score
168
First Language
English
Primarily Uses
Other
Yanfly's plugin uses the switch number, not the name/label (the label is just an easy way for you to indicate which ones are self switches, but that's the only thing they're used for). If you turn on switch 62, it will update the self switch [mapid, eventid, 'SELF SWITCH 62']

Try this:
Code:
addTimer <thismap>.<thisevent>.yepss1 3 \setss([<thismap>, <thisevent>, 'SELF SWITCH 62'], true)
Wow, it worked! Thank you!

Edit: Ultra thanks to you @Shaz as this wording of the self switch also works with our ABS triggers xD 2 birds with 1 stone!
 
Last edited:

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
@Shaz

Dear Shaz. Could you tell me how I can manipulate Self Variables from Yanfly's Self Switches and Variables?
I see that you knew a solution for bazrat a month ago, regarding to self switches.

The self variable is called "Self Var nodes setup" and I would like to set it to 0 after 30 minutes.

Thank you in advance! :LZSsmile:
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,402
Reaction score
12,939
First Language
English
Primarily Uses
RMMV
@Nilom as I mentioned above, the variable name has no meaning. It's the variable number that's important. What is your variable number?

Fortunately Yanfly saves the self variables in the self switches object, not a new object, so you can use \setss to set a self variable (but not a regular variable).

If you use variable # 65 for Self Var nodes setup, you could try this in a plugin command:

AddTimer <thismap>.<thisevent>.SelfVar65 1800 \setss([<thismap>, <thisevent>, 'SELF VARIABLE 65'], 0)

or this:

AddTimer <thismap>.<thisevent>.NodesSetup 1800 \setss([<thismap>, <thisevent>, 'SELF VARIABLE 65'], 0)

if you wanted something a little more recognizable.

I suggest you try a much, much smaller number (like 10, or 30) for the timer, rather than 1800 - it'd be a shame to wait half an hour to find out the command isn't correct.y
 
Last edited:

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
Thank you this is amazing! I will check later if I can find the self variable number and if it worked. :kaoluv:
Will it always be the same number as the variable ID? Or are 1-4 used by self switch A-D?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,402
Reaction score
12,939
First Language
English
Primarily Uses
RMMV
Yes, it will always be the same number as the variable ID, because that's the way Yanfly's plugin works. Self switches A-D use the letters A-D. Variable 1, if you have defined it as a self variable, will be SELF VARIABLE 1. Switch 1, if you have defined it as a self switch, will be SELF SWITCH 1. So they will never get mixed up with each other.
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
Oh I see! That is pretty clever. Thank you again so much. :LZSsmile:

Edit:
@Shaz The timer seems to work perfectly fine!
Would it be possible to change the opacity of an event when the timer is finisehd? Or to alternatively have two commands in the same timer? Change (Self Var and Self Switch). I know I could probably use two timers for this, but I don't know how performance heavy that would be to double the neccecairy timers.

Edit 2:
I noticed that if I set two timers for the same event then the command of the first timer will be overwritten.
Code:
AddTimer <thismap>.<thisevent>.NodesSetup 10 \setss([<thismap>, <thisevent>, 'SELF VARIABLE 2'], 0)
AddTimer <thismap>.<thisevent>.NodesSetup 10 \setss([<thismap>, <thisevent>, 'A'], false)
Only the second command got executed. Even if I sat different times (10 and 11).
 
Last edited:

Enthar

Veteran
Veteran
Joined
Jul 23, 2016
Messages
49
Reaction score
3
First Language
Dutch
Primarily Uses
Hey Shaz, I'm looking for a great and usefull plugin like this. Is this still usable in the latest version of mv?

I'd like to let the player pick a plant which grows back over time.

What I have right now:
A "rose" event that gives you plantparts and turns on a switch "rosereset".
1584282558457.png
Second page of this event runs parallel while switch 'roserest" is on and shows only the plant w/o flowers.
1584282626007.png

meanwhile, when the switch "rosereset" is turned on, a common event starts to run parallel. This event contains a countdown of (for gametesting reason) 5 seconds. After that time the switch "rosereset" is turned off.
1584282782983.png

Yet the "rose" event is not reset to the first page.
Am I missing something?
thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,402
Reaction score
12,939
First Language
English
Primarily Uses
RMMV
You are not using the plugin correctly. Because you have the plugin call in a parallel process event, then the timer is going to be continually reset, which means it'll never count down to 0. With the plugin, you don't need ANY parallel process events at all.

Give your event 2 pages.
On the first page, have the flowers, no condition, and in the event commands, pick the flower, turn on self switch A, and the plugin command: AddTimer <thismap>.<thisevent> 5 \setSS([<thismap>,<thisevent>,'A'],false)
On the second page, have no flowers, and self switch A as the condition.

Both page should be set to action button.
 

Enthar

Veteran
Veteran
Joined
Jul 23, 2016
Messages
49
Reaction score
3
First Language
Dutch
Primarily Uses
too cool! works like a charm! thanks! you're the best ^ ^.
 

ratomarsupial

Warper
Member
Joined
May 25, 2020
Messages
1
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMV
1590370502591.png


I'm having a problem with this plugin. put as command lines in an event on the map with parallel processing, in this case, variable 4 takes the value 10 but does not count down
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,402
Reaction score
12,939
First Language
English
Primarily Uses
RMMV
You have not shown the full event page (PLEASE ALWAYS show this - don't crop it to just the commands) so I can't tell if your event is repeating or not. Because I don't see any command in there that would stop it repeating, I'm going to assume that it does.

It should not be in a parallel process that is running continually. What you're doing here is setting the timer to 10 seconds every single frame. So even though it might start to count down, you're immediately resetting it again.
 
Last edited:

yoluko

Villager
Member
Joined
Mar 9, 2020
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
I'm trying to set up a common event for a time system - I set up a day night switch toggle with this plugin just fine. But I also want to set up a timer that will add 1 to a variable so the time of the day can be checked by the player. I followed the code as set in the example, but nothing happens. It is in a separate event to the other timer.

I've attached an image of the event. Time set to 1 second for testing purposes.
 

Attachments

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,402
Reaction score
12,939
First Language
English
Primarily Uses
RMMV
@yoluko

At first glance, I'd say your plugin call looks fine, and the issue is that you have it in a parallel event that doesn't appear to stop itself. The command is being run on every frame, so it is continually adjusting the timer to be one second later than the current time. There's no pause there where the timer is just allowed to run on its own.

What is turning on switch 19? What is turning it off?

If this is something you want to do in a loop, I would do it this way:
Have one event that's going to kick the whole thing off. That will call the plugin command to turn on switch 19.
In your common event, set to parallel and conditioned by switch 19, do a Control Variables to add 1 to your time variable, then call the same plugin command to turn on switch 19 in 1 second, and then a Control Switches to turn OFF switch 19.
That means the common event will only run ONCE each second (or however long you set the timer for), and will only run again when the timer has expired.
 

yoluko

Villager
Member
Joined
Mar 9, 2020
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
@yoluko

At first glance, I'd say your plugin call looks fine, and the issue is that you have it in a parallel event that doesn't appear to stop itself. The command is being run on every frame, so it is continually adjusting the timer to be one second later than the current time. There's no pause there where the timer is just allowed to run on its own.

What is turning on switch 19? What is turning it off?

If this is something you want to do in a loop, I would do it this way:
Have one event that's going to kick the whole thing off. That will call the plugin command to turn on switch 19.
In your common event, set to parallel and conditioned by switch 19, do a Control Variables to add 1 to your time variable, then call the same plugin command to turn on switch 19 in 1 second, and then a Control Switches to turn OFF switch 19.
That means the common event will only run ONCE each second (or however long you set the timer for), and will only run again when the timer has expired.
It works, thank you!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,402
Reaction score
12,939
First Language
English
Primarily Uses
RMMV
Awesome! In the next version, I will add an option to reset the timer, so you will just be able to do it as you originally did, with 'reset', and it will add 1 to the variable every second (or whatever your delay is).
 

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

Latest Threads

Latest Profile Posts

It seems like this is going to be another remote semester. RIP.
I don't like linear gear progression in games. I'd like to see more gear be useful from start to finish. This is also true for skills. I also like finding overpowered gear, and don't enjoy games that are too balanced.
Framework is getting closer to completion. Adding more QoL changes for users.
I'm very excited with DE:VOID! And FYI Darkness of Hope - The Pocket Watch in development, so please be excited!
The more I look at the QPlugins... The more I am amazed at what they can do. Which I'm not going to lie is pretty awkward, because I already consider them far and away the best plugins MV has to offer. :kaoback:

Forum statistics

Threads
99,509
Messages
966,189
Members
131,138
Latest member
MrRenato
Top