Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
It's such a long time since I wrote this - I thought I'd gotten into the habit of eval'ing all arguments so variables could be used. I'll take a look, but not sure how soon it'll be.

Thanks,
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
I noticed that when you try to use a variable to set the timer rather than manually setting it, it instead always sets it to 0 seconds.

I'm just looking at this now, and it does cater for variables. If you want to use whatever is in variable 15, you would put \v(15)

Is that how you called it?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
and what was in variable 160 prior to the call?
 

Mixelz

Villager
Member
Joined
Jan 10, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Reason for this is that I want the timer to be paused during a cutscene, so the player doesn't have to rush through it to make up for the fact the timer is still ticking down. :p
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
Thanks.

I've just added this plugin to my own converted project, so I will be re-testing at some point. However, I've got a lot of script calls to convert first before I can even begin to play without any errors. So it might be a while, but it's on my list. You've got a solution though, so at least you're not waiting for me :)
 

Mixelz

Villager
Member
Joined
Jan 10, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV

Sir_Titas

Villager
Member
Joined
Jul 22, 2013
Messages
28
Reaction score
1
First Language
english
Primarily Uses
N/A
I have been trying to make a day-night system with this, but so far it seems as if nothing is happening.

anyways here is my parallel process
Code:
#If : dawn is ON
  #Common Event : Daily Event
  #Wait : 6 frames
  #Control Switches : #0015 dawn = OFF
  #
:End
#If : time = 1
  #Plugin Command : addTimer Day 1200 \setV(67, 1)
  #Control Variables : #0068 tint = 0
  #
:Else
  #If : time = 1
    #Plugin Command : addTimer Dusk 180 \setV(67, 2)
    #Control Variables : #0068 tint = 1
    #
  :Else
    #If : time = 2
      #Plugin Command : addTimer Night 1200 \setV(67, 3)
      #Control Variables : #0068 tint = 2
      #Plugin Command : addTimer Untildawn 180 \setS(15, true)
      #
    :Else
      #If : time = 3
        #Plugin Command : addTimer dawn 180 \setV(67, 0)
        #Control Variables : #0068 tint = 1
        #
      :End
      #
    :End
    #
  :End
  #
:End
#
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
What sets time to 1?

You have two conditions for if time = 1. Maybe the first one should be if time = 0?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,833
Reaction score
1,254
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!
I 'm trying to use this, but i have a hard time to get it to work.
I cant understand it very well.

So i have an event of two pages.

In page 1, when the event touch the player, it will start a timer of 10 seconds.

AddTimer resting 10

Then it will turn on the self switch A.

Then, in the page 2 activated by the SELF SWITCH A, i like to put a conditional branch that checks if the resting timer = 0 the it turn the self switch a off.


PAGE 1
◆Plugin Command:AddTimer resting 10
◆Plugin Command:HasTimer resting A

PAGE 2
???? How can i do that?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
No, that's not how you use it. On page 1 you add your timer, and tell it to turn off self switch A after 10 seconds. You've added the timer, but you don't tell it what to do. You don't put anything on page 2. The plugin turns the self switch off when the time is up.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,833
Reaction score
1,254
First Language
Portuguese - Br
Primarily Uses
RMMZ
No, that's not how you use it. On page 1 you add your timer, and tell it to turn off self switch A after 10 seconds. You've added the timer, but you don't tell it what to do. You don't put anything on page 2. The plugin turns the self switch off when the time is up.
I manage to get it to work with a normal switch.

◆Plugin Command:AddTimer resting 10 sets(43,false)

But i cant get it to work with a selfswitch :/
I put setss(A, false) and dont work.
Can you please give one example of how i make it with a self switch?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
I put setss(A, false) and dont work.
Can you please give one example of how i make it with a self switch?

From the instructions on the first page:
Keywords that can be used anywhere in the plugin command are:
<thismap> - current map's id
<thisevent> - current event's id
\setSS - set a self switch - format is \setss([map, event, 'A'], true)
\ss - the value of a self switch - format is \ss([map, event, 'A'])

So if it is this map and this event, your plugin command will be

Code:
Plugin Command: AddTimer resting 10 \setSS([<thismap>, <thisevent>, 'A'], false)

Also, if you have 10 events and want to do this to all of them, you can't call them all resting because they have to have unique names - otherwise they'll all overwrite each other and only the last one's command will actually run.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,833
Reaction score
1,254
First Language
Portuguese - Br
Primarily Uses
RMMZ
OHHHH i seee!!! i try similar, but i forgot the "[ ]" and the "SS" upper case.
Thanks a lot Shaz! *____*
This is what i achieve, its for a sort of abs battle that i'm trying to do ^^

wFufiMD.png
WZbTesE.png
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
@Eliaquim the SS doesn't have to be uppercase. Yes, you forgot the [], but the important thing you forgot was the map and event number.
 

mads_in_zero

Villager
Member
Joined
Mar 8, 2019
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
Does this plugin work with fractions of a second?

EDIT: One more thing, how would I get the timer to set a variable to a random value between 1 and 7 inclusive?
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
@mads_in_zero if you change line 67 from this:
Code:
seconds = parseInt(args.shift());
to this:
Code:
seconds = Number(args.shift());
you might be able to get fractions of a second.

Code:
Math.floor(Math.random(7)+1)
will give you a random number between 1 and 7, inclusive.

I don't recall if I set it up to evaluate or not, and I don't know if Number() or parseInt() will evaluate what's in the brackets either. Give it a go and see.

If you want the number of seconds to be random, don't put any spaces in that snippet of code, or it'll take the bit before the space as the number of seconds, and the bit after the space as part of the command, and you'll end up either with an error/crash, or it just won't work properly.
 

mads_in_zero

Villager
Member
Joined
Mar 8, 2019
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thank you! That seems to have worked so far.

Alright, I'm still having some problems with the timer, so I might as well explain what I'm trying to do with it.

Shin Megami Tensei Nocturne's main battle theme has 7 variations of the chorus of the song, the game choosing which one to play next randomly. I want to implement this song, random choice included. (That's why I needed that number from 1-7 inclusive thing, to set the variable, thank you again).

I think the easiest way to do that would be to start a timer at the start of the song, then choose another variant from 1-7 and start a new timer for the length of that. However, I haven't been able to get the variable setting to work with your variable setting Plugin Command, so I was wondering if it would be possible to tell the Battle Event to not execute any of the remaining code until the timer was finished.

Is this possible with this plugin? And if not, could I request it be added as a feature? Thanks regardless.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,180
Reaction score
14,223
First Language
English
Primarily Uses
RMMV
This plugin would not pause a battle event in the middle of its list of commands, and I would not make a change for it to do so. That's not its function, and the request is far too specific.

Instead, you could experiment with using a switch to activate the battle event, and set the switch with the timer. In fact, I wouldn't use a timer for the random number either - I'd do that with a Control Variables which already has random number selection built in.
 

Latest Threads

Latest Posts

Latest Profile Posts

When someone helps you solve a problem, it's good to report the thread so it can be closed, but it's also nice to go back and post in the thread to let them know their suggestion actually worked. And, you know, to say thanks for helping.
Yes, I made made my profile picture into a poorly edited fat cat
TextBox like JRPG (Retro):
halloween_test_img.png
Memory of a Halloween party.
Studying more game mechanics and game design... If someone have some tips, I would be happy to read!

Forum statistics

Threads
108,909
Messages
1,040,545
Members
141,362
Latest member
blackstarrpheonix
Top