[DYNRPG] MAIN MENU GAME PLAYTIME CLOCK & BACKGROUND/FOREGROUND OPTIONS

Add a clock & images to the default main menu!

==========================================================================
Main Menu Game Playtime Clock w/Foreground & Background Image Support v4.1
For RPG Maker 2003 with DynRPG v0.13 or higher
By PepsiOtaku
==========================================================================

I'd like to share a plug-in I just finished. This plug-in calculates & displays the time played in the main menu. It does this by identifying the amount (in seconds) the current session has been open (since either starting a new game or loading a save), and adds this amount to the total playtime, then converts the result to a clock format.

I made sure there were no memory leaks or anything, so this plugin should be stable. Let me know if you spot any serious issues!




Installation

To install the plugin, make sure that you have patched your project with cherry's DynRPG patch which
can be found here: http://cherrytree.at/dynrpg

1. Copy the "game_clock.dll"into the DynPlugins folder of your own project.

2. Edit Picture\menu-time_fg.png to match your project's system graphic. This image also doubles as a foreground image, which you can use to further decorate/modify the menu screen. The file can be changed via your DynRPG.ini file.

3. Additionally, this plugin supports adding a background image (placed behind the system window)

4. Add the following (between the asterisks) to your DynRPG.ini
**********************************************


[game_clock]
SessionStart=4003
SessionCurrent=4004
SessionSecs=4005
PlaytimeSecs=4006
PlaytimeHH=4007
PlaytimeMM=4008
PlaytimeSS=4009
RestartTrigger=4010
ForegroundVar=4011
BackgroundVar=4012
ForegroundImage=Picture\menu-time_fg.png
DummyImage=Picture\Pixel.png
BackgroundImage=Picture\Pixel.png
TimeTextDisplay=Time

**********************************************


5. Change the numeric values 4003, 4004 etc to the variables of your choice.

6. Pixel.png is a dummy image used for the text display.

7. TimeTextDisplay is the actual label text displayed in the menu.

8. ForegroundImage is the window image below the time display. You can use this image to alter other aspects of the main menu screen. See below. The image on the right shows the alterations I made.



9. If you would like to add a background, change the value of BackgroundImage to the file of your choice.

Note: The ForegroundImage and BackgroundImage must be no larger than 320x240

Forgot to add this to the readme, but this is an explanation of the variables:

SessionStart - Stores the cpu time the session started (in seconds)
SessionCurrent - Stores the cpu time the session is currently on (in secs)
SessionSecs - Stores the difference (in secs)
PlaytimeSecs - This is your total gameplay time on a particular save. This can only be edited to a specific value by setting the RestartTrigger.
PlaytimeHH - Hour digit (Max is 65535)
PlaytimeMM - Minute digit
PlaytimeSS - Second digit
RestartTrigger - Used to manually set the playtime to a certain time (ie. Setting it to "0" would reset the time to 0)

NEW TO VERSION 4
================
4.1 - Small bugfix with the rect calculations

Nothing visual, but the code is more efficient. onFrame callback no longer loads/unloads the foreground
image every frame.

Added rect calculations for the background image, which should be supported by future versions of DynRPG.
(thanks Cherry!) Save/load menu is unaffected by this.

Version 3
=========
Bugfixes

Version 2
=========
- Fixed BackgroundImage on Save/Load menu

- Added support for variable controlled foreground & background images. Use "ForegroundVar" and
"BackgroundVar" to set the variable ID's youw ill use to control the background images

- "ForegroundImage" and "BackgroundImage" still identify the default images. To define additional images,
make a copy of those with the number you will assign the variables to after the identifier.
Example: If ForegroundVar 4011 is set to "2", the plugin will look for "ForegroundVar2="

**********************************************

ForegroundImage1=Picture\menu-time_fg2.png
BackgroundImage1=Panorama\canyon04.png
BackgroundImage2=Panorama\cyberspacelol.png
BackgroundImage3=Panorama\forest05.png
**********************************************


With this functionality, you can add multiple system sets to your game, and the plugin can still support it

Extra: Extract game_clock_testProject.rar to see a test project with it in action!
Instructions

This plugin is pretty much plug and play, so just load your game, then open the menu! Voila!

Details

  • 1.2 MB
  • 519
  • 04/18/2024 08:01 PM

Actions

Posts

Pages: first prev 123 next last
author=PepsiOtaku
...

Oh yeah, that will work.
Thanks! (:
Well, don't make it do "instead of" since some people use the variable system (me). Just add like a line of comment code saying something like @change_background1 3 or something.

Actually, forget the comment interface. Most people can figure out the variable system, and it screws over the people with the original code.

Goldenroy, your menu had a fully-colored coin icon. How'd you do that?
One thing I've noticed while using this is that it seems to forget what the current background image should be, if you load a save game.

My game has the starting menu disabled (so it goes right into new game), so I can have a custom start/load game menu. I have it set so that the default image is actually the titlescreen, so that the load game menu has the same background as the new game/load game menu.

Currently I have it so that when entering/exitting certain maps, I have the variable set to change the background, and this works fine. However, if I load a save straight from the main menu, the loaded save always has the default image, until I exit/re-enter a map that changes it.

I'm not sure if this is because the game loads into a new game from the main menu right away, and just doesn't update to check the variable after the loaded save is loaded up, or if there's something else going on where loading any save sets the background image to its default.

It's not a terrible inconvenience, however, I will probably just switch to using a solid color background at all times instead. I wasn't making very good use of it in the first place.

Something to think about for later, though.
Yeah, I came across that bug at one point too. I actually made a fix for it, but haven't gotten around to updating the download yet. The reason it does that is because I needed to "destroy" the foreground/background image on new game/load game so that it would refresh and draw the image again. Try it out here:
http://rpgmaker.net/media/content/users/40/locker/game_clock.dll

There's a couple things I added in this version too that you may or may not find useful (I added them for my game). Add this to your ini:

TentEnabledImage=Picture\menu-tent_save.png
TentDisabledImage=Picture\menu-tent_load.png
ResetBackgroundSwitch=4938

TentEnabled/DisabledImage will add an additional image in the foreground. I have a separate icon for "Save" and "Load" now. You can leave them blank to ignore this functionality.

ResetBackgroundSwitch is a switch ID that will force the background to reset at any given time. For instance, I use a different foreground image for when the party menu is enabled or disabled.
First of all: this Plugin is amazing BUT I have a problem that really bugs me.

Is it possible to remove the background if you enter the save/load and quit menu?

I would be really thankful.
it's possible to do something like that?

in every page of the menu?
because if I eliminate the inner part of the system the result is this

thanks in advance ^ ^
Yes it is. I think first off, you need to do something like set textbox transparency for entering the menu and opaque for exiting the menu.

Next, you need transparent textbox.





Like so. Just a heads up, if you do have no textbox, and you have a shop, it will glitch, so be sure to set text box to normal. Also, be sure the picture in question is a 256 color picture or it won't show up. Use IrFanView and Decrease Color depth to 256 (make sure Floyd-Steinberg dithering is checked as color loss can occur).

Btw, can something also get set up for other menus, like the shop? Hopefully, without this issue.
Thanks bulma! Exactly that.

For kicks, I also made a neat little plugin that makes the menu windows translucent, like so:


(Ignore the time window and the left edge of the main window--that's a picture that gets shown)

Get the plugin here:
http://rpgmaker.net/media/content/users/40/locker/system_transpwin.dll

And add this to your DynRPG.ini:

[system_transpwin]
TransparentMenus=true

Edit: Oh and I think you have to have Alternate/Transparent ticked in the Battle Layout window.

I'm going to make it part of a bigger plugin (system window to picture functions) at some point, when I fix a couple bugs with it.
Ohhhh, I like this. Already worked it into my system.

Probably shouldn't merge those into a single plugin, though. Some people may want a solid FG. Does this plugin have the ability to screen out the Time FG? Or is that actually solid?


Yeah, I want to update this plugin again so that the Time window can actually be drawn based on the system set (and factoring transparency), but there's some kind of bug with drawText in 0.20 that I messaged Cherry about. Neither this or DynText can be compiled it seems.
In the save page the trasparency don't work
I think the save page is actually a separate menu. Probably the quit page too. I'd say have the custom save/quit plugins (uhhh, Pepsi could you put those on page one, if they aren't already?), and make effectively a custom menu.

No, the save page won't work because it's put together differently in that the background is not drawn behind the window. It's only drawn in the small top and bottom areas above and below the save slots. There's nothing that can be done about that unfortunately.

The save related plugins are expert-level stuff, but you can certainly dive in if you feel adventurous. You can build your own save menu with those.
Ok i understand, is a different page respect of the others.
While we're talking about transparency, is there a way to get the Normal box to check for transparent color?





(This is basically matching the BG color.)


It's transparent color, matching the background color. Basically, what I want is no greyish white stuff, just ignore the color and show bg. Like, just an empty box if the background color matches the foreground color (you're checking System files, not the game itself).



Files like this should display normally, while the above should behave as the no box picture, but with a box around it.

Transparent boxes C++ code doesn't seem to work for this, it simply produces a translucent picture. Now, granted, I probably wouldn't wanna keep it straight transparent like that (readability), but the next stage might be to either have picture BG of its own (like making a secret of mana grid menu).
So you basically want the frame with a transparent background? If you go into "Battle Settings" and uncheck window transparency, you'll see a black background (instead of gray), but with it checked, you'll see the gray. You can make the frame part transparent that way, but no the background part.

If you want custom message boxes, just go to "Message Display Options" and set it to "Transparent" and create a common event called "custom message box" or whatever and show a picture there, that has the background you want to show, along with the frame. It would be a hell of a lot easier than writing a plugin that one person will use.
The point of plugins, though, is that the process can be done outside the main system, and controlled using simple variables. This in turn means that if I the player want to toggle from conventional/futuristic/storybook box, transparent/mesh/colored inside, and standard/finger/sword nextpage pointer, I could. True, this is absurdly complicated (I too have glanced at the textbox enum codes). But actually pulling it off, like the menu screen, have massive bonuses.

I have (had) such a common event. I used it to make foreign language characters initially (and I even tried doing just the background and picture thing). Not only was there a bit of text/picture interference, but it was a horrible chore to even try one town this way, and I had to work around shop windows.

Anyway, it's not mandatory. It's a "once you have menus done, are bored, and have a ton of free time" maybe you might do that. Or maybe not.
Didn't think so.

Well then, the big issue to fix is how to get the time clock to have working translucence.
Pages: first prev 123 next last