hyun8675

Villager
Member
Joined
Feb 13, 2016
Messages
13
Reaction score
5
First Language
English
Primarily Uses
That's exactly what <thisevent> does.  It is a shortcut to save you having to type out the whole thing.  Use <thisevent>

thank you answer to me


i did exactly understand this plugin !!
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
Hmm also i tested it and i think your plugin kills the normal timer. The normal timer will apear but the countdown will not happend.


Mabye you can do anything? :unsure:
 

Ahuramazda

Veteran
Veteran
Joined
Nov 9, 2012
Messages
262
Reaction score
127
First Language
English
Primarily Uses
RMMZ
I haven't used a timer in my game proper yet, but I can agree with @styx92 that with your plugin on the default game timer doesn't count down, but with it off it does. Made a random timer to see after reading this and it just sits there without any counting.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,203
Reaction score
14,246
First Language
English
Primarily Uses
RMMV
Thank you both.  It was a minor omission on my part.  Fixed and re-uploaded :)
 

Ahuramazda

Veteran
Veteran
Joined
Nov 9, 2012
Messages
262
Reaction score
127
First Language
English
Primarily Uses
RMMZ
Thanks for the fast fix :D    I wasn't to the part of my game design where I wanted to use timers yet, but it was coming soon. Tested and working perfectly!
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
Very fast! Thanks you! 


At the last time i dont need the timer too. But now i need it and yeah if it works than ist perfekt *.* 


Thanks shaz :)
 

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
689
Reaction score
282
First Language
English
Primarily Uses
RMMZ
I'm trying to set-up a cooldown for a detect skill that will show traps for a limited amount of time and then turn off.


I'm achieving this with Yanfly's Button Common Events plugin. 


The common event is setup like this:

02a6e53d1f8068fd3e9272dad3926acf.png






 




However, when activating the skill I get the TypeError: Cannot read property 'toUpperCase' of undefined.

a795a34413196dedbee56e745eff3b66.png






 
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,203
Reaction score
14,246
First Language
English
Primarily Uses
RMMV
That's very strange.  I'm not sure the error is coming from that common event.


That line of the plugin is simply converting the plugin command to uppercase.  For this common event, the plugin command is addTimer, so it can't be undefined as indicated by the error message.


Do you have any events anywhere that you've added a plugin command to, and then decided not to go ahead, but still left the plugin call there with no arguments?  If you can't be sure, go to my plugin and add a new line just before 63, with this:

Code:
console.log('Map: ' + this._mapId + '; Event: ' + this._eventId + '; command: ' + command + '; args: ' + args);

Save then play again and see what comes out in the console.  Event Id might be empty if it's a common event that's running, and I would expect command to show as undefined.


Also, can you show a screenshot of the skill?
 
Last edited by a moderator:

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
689
Reaction score
282
First Language
English
Primarily Uses
RMMZ
@Shaz looks like I found the culprit. It's Camera Scroll EX by Raizen/SoulPour.


Not sure how they conflicted but it works perfectly fine when the plugin is disabled.


Here's the latest console log.

5e1875b1d652627273c56493b4351e18.png






 
Not signed in
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,203
Reaction score
14,246
First Language
English
Primarily Uses
RMMV
because when he's called the aliased method, he hasn't passed through the arguments.


Go to line 85 of that plugin and change it to this:

Code:
Soulpour777.CameraScrollEx.pluginCommand.call(this, command, args);



I am surprised a lot of people haven't complained about that, because that would likely conflict with ANY other plugin (that has plugin commands).  Maybe it's just because I'm trying to do something with the command prior to checking its value (most people might just use a switch, which might be okay with an undefined object, but I'm converting to upper case first, which isn't - guess that's what I get for trying to make mine more flexible).  But still - not passing through the arguments would mean any plugin command that's higher in the list (or lower?) would not be executed.  I could just be misunderstanding the apply function.
 
Last edited by a moderator:

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
689
Reaction score
282
First Language
English
Primarily Uses
RMMZ
Yay! It's all working now!


Thanks a bunch. Hopefully he updates his plugin to fix this issue or others see this method to fix it.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,203
Reaction score
14,246
First Language
English
Primarily Uses
RMMV
Unlikely - the page you linked says it's unsupported.
 

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
689
Reaction score
282
First Language
English
Primarily Uses
RMMZ
Now that my main problem is fixed.


Could you help me with adding a 30 second cooldown timer to my common event?


So when they turn the common event on via a key it will turn on the detect switch.


The detect switch allows them to see various traps around the area.


After 10 seconds it will turn off.


I have all that setup but is it possible to make it so they can't use it again for 30 seconds with another timer?

b3e3250c5a663cb7b3fa93d9432ed684.png






 
Not signed in




 


Not signed in
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,203
Reaction score
14,246
First Language
English
Primarily Uses
RMMV
Do you want the 30 seconds to start after the skill is used, or after it's depleted (so 40 seconds after the skill is used)?


I'd use a second switch for Cooldown and turn it on at the same time as switch 1.  Then the second plugin command will just turn it off, and it'll be 40 seconds (if you want the cooldown to start after the 10 seconds is up) or 30 seconds (if you want the cooldown to start from the time the skill is used).


Then modify your common event to check for both cooldown and detect in effect:

Code:
If: Detect is ON
  Text: Detect is currently active.
Else
  If: Cooldown is ON
    Text: Detect is currently on cooldown.
  Else
    Control Switches: Detect = ON
    Control Switches: Cooldown = ON
    Plugin Command: addTimer detect 10 \setS(1, false)
    Plugin Command: addTimer cooldown 30 \setS(2, false)
  End
End



And noticing that you're using switch 1, I should advise you to check your other plugins and see if any of those are also using switch 1 by default, as you might need to change one or the other.  A lot of people report problems when they have plugins and they use switch 1 for stuff in events.
 
Last edited by a moderator:

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
689
Reaction score
282
First Language
English
Primarily Uses
RMMZ
Thanks a ton! 1 was just a temp switch placement until I figured out what was breaking it earlier.


It's working flawlessly now! Thanks for such a great plugin and help!
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,634
Reaction score
1,452
First Language
French
Primarily Uses
RMMV
@Shaz


hi
i have i little question about your timer.
if i use your timer like thas.


// (key, seconds, command);
$gameTimer.addTimer('test1', 10, x='blabla');


Command I guess, the command is for execute at the end of the time?
It seems to initialize the variable from the beginning.
If you have a trick or advice to share me.
Here other example


function BonusMalus(ID,Time,CommandAfterTimer) {
$gameTimer.addTimer(String(ID), Time, CommandAfterTimer);
}
//execution
var timer1 = 1;
var T=120
BonusMalus(timer1,T,StatusMenue('SHOW'));


There is a syntax to adopt to prevent that command initializes at the beginning, but at the end.


tanks
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,203
Reaction score
14,246
First Language
English
Primarily Uses
RMMV
The command has to be a string.  You're running a function and passing in the result.


$gameTimer.addTimer('test1', 10, "x='blabla'");


BonusMalus(timer1, T, "StatusMenue('SHOW')");
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,634
Reaction score
1,452
First Language
French
Primarily Uses
RMMV
Ok yes i just see .
You plugin are MIT license ? .
I would like to add some line in  Game_Interpreter.prototype.subst = function(args) { ?
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,203
Reaction score
14,246
First Language
English
Primarily Uses
RMMV
I don't use any licence.  You are free to modify it as you like.  Just leave the header intact and don't say you made it.
 

Mixelz

Villager
Member
Joined
Jan 10, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hey, 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 went in and did a bit of code to fix this!

case 'ADDTIMER':
args = this.subst(args);
key = args.shift();
uneval_time = args.shift();
uneval_time = eval(uneval_time);
seconds = parseInt(uneval_time);
command = args.join(' ');

$gameTimer.addTimer(key, seconds, command);
break;

I'm not that sure if this is the best way to fix this as I do not have that much experience with JavaScript.

In anycase, I hope that you're able to fix the issue, with or without the code I provided! :D
 

Latest Threads

Latest Posts

Latest Profile Posts

Sigh...I can do everything I need for this game but make actual sprites and tile maps for it. Guess I'll look into hiring someone for that
Goes looking for assets, ends up creating memes. I have priorities?
i'm working on finishing an old game in vx ace (the first game i tried to make in vx ace), and it's making me realize how many things i've come to take for granted in mv (like the additional BCDE tile layer and the plugin manager).
It's ma birfday! Gonna chill and work on my project, editing some icons for my compass rn. Later It's pizza and a movie, maybe Blazing Saddles...
I really hope Google stadia/Amazon luna become successful household "consoles" in the future only because I could see it being 1000x easier to get RPG Maker and other indie games on their platforms & if so I PRAY they have gate keepers to keep half baked indie games out of the mix so they don't end up like steam/itch.io with 1000s of incomplete RM projects that continue to give our community a bad stigma.

Forum statistics

Threads
109,023
Messages
1,041,325
Members
141,489
Latest member
KrialteStynedaxt
Top