Save-Point
KTimers XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: KTimers XP (/thread-4420.html)



KTimers XP - kyonides - 10-31-2012

KTimers XP
Version 1.1.0

by Kyonides


Introduction


This script should let you create events like growing plants. The benefits are interesting, you won't find any timer on screen and the corresponding timers will keep running even if you're on another map. Don't worry about them running forever, they'll stop right after they reach their "ripe stage". Only a player hitting the OK button while standing right in front of the event could reset the timers.

Instructions


Create a multi-page event with its graphics.

On the first page leave a comment like this one:

Code:
timer 1 refresh 15

That means the event will use a timer with x stages and will count till 15 seconds before the next stage begins (that means it will change to the next page on the event list).

On the last page add a script call:

Code:
reset_timer

That will help you reset the growing plant event. It will be activated once the player hits the OK button while standing right in front of the event.

Also take a look at the script and search for the STAGES Constant and edit it at your will.

Example:

Code:
STAGES = {1 => 2, 2 => 3, 3 => 5}

# Timer Type => Number of stages (that means Number of event pages - 1)

As you might have figured it out by now, the timer ID on the comment you left at the growing plant event corresponds to some kind of Timer Type of the STAGES Constant.

And that's all, forumers!

featuring both versions

Term of Use and Conditions

Free for non-commercial games.
Donations aka voluntary payments are accept if going commercial.
Due credit is not optional but a must.
Check out my signature below! Winking


RE: KTimers XP - yamina-chan - 10-31-2012

This sounds quite usefull certainly =D
I've downloaded your Demo to give it a try, only...it crashes right at the start XD'
"Unable to find file Data/Map003.rxdata."
Since the start point is set there aparently, this prevents the game from running. After setitng the start point on one of the other maps, fixing a broken teleport that lead to map three as well and giving the signs the Direction Fix Tag I looked at the actuall commands in the growing events.
I have not tested this to it's limits yet, but it seems to be working just fine =)
Only with the crystal at the bottom of map two I am not sure.


RE: KTimers XP - kyonides - 10-31-2012

Oh, I forgot to say that I had to delete it because it was no longer in use, two maps were more than enough to prove my point or so I thought before reading your post. Well, I'll fix that but at least it's something simple that people can handle properly. Obviously it's not the idea to let you go through all those weird situations. I'd be uploading a new demo in a bit.

The event that was located at the bottom was not supposed to work with the script but it was a test engine to check whether or not it was easier to perform the same tasks by use of the usual command event commands. That's why it shouldn't work at all but the new demo doesn't include such event anymore.

EDIT

New demo's already available! It just needs less than 200 KB of harddisk space.


RE: KTimers XP - kyonides - 07-03-2021

Bug Fix Available!

KTimers XP has now reached the 1.0.2 milestone! Shocked

After all these years, a forumer reported a weird bug on another board. I took a look at it and decided I could change a few lines as a way to prevent it from ever returning. Happy with a sweat I just hope she won't break it any time soon.


RE: KTimers XP - kyonides - 12-27-2023

Version 1.1.0 is Now Available!

Go Download any of the 2 Existing Ports Now!

This brand new release brings an interesting feature, Witch failing crops! Shocked
Nope, there's no need to hire a Witch witch to destroy your crops. Winking
You just need to pass a condition and it will determine whether or not you will get your crop or byproduct.

The Default Script Call:
Code:
reset_timer

The New Script Calls:
Code:
reset_timer(:item, 1, 5)
reset_timer(:weapon, 1, 1)
reset_timer(:armor, 1, 1)
reset_timer(:switch, 100)



RE: KTimers - kyonides - 12-27-2023

It's Official!
This Script Has Been Ported to RMVX ACE!

Now version 1.1.0 is finally available on all 3 RGSS-based engines! Two Thumbs Up!
I thought it would just require a single change in code to port it to VX and ACE, but RGSS3 had no command_end so I had to get creative here. Happy with a sweat Only to find out all of a sudden that $game_system never gets updated like it does in XP and VX. So $game_timer had to come to the rescue. Winking

4 Snapshots



RE: KTimers - kyonides - 04-29-2024

The RMXP Port Has Been Updated!

It reached the 1.2.0 milestone already! Shocked

I noticed that there was no way to limit the sowing process from triggering if the game developer wanted to use a game switch. This made me add a new script call to make it possible. Two Thumbs Up!

There's just one caveat: it would only work as part of a conditional branch. Happy with a sweat

The Explanation

The reasoning behind this is that the script would turn them into automatic / parallel events even if they were located on a different map. That's why leaving the comment at the very top of the command list was and still is very important there. The conditional branch or the switch trigger broke that. This is why I had to come up with a way to make it work IF a conditional branch was used.

The New Script Call:

Code:
set_timer(TimerID, Seconds)

Example:
Code:
set_timer(1, 10)

Event Screenshot