FPS Counter

Tralse

Map Builder
Veteran
Joined
May 18, 2015
Messages
57
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Hi there! I have a script already that displays the FPS on the screen in the upper left corner, but it is kind of obtrusive and it takes you out of the game.

Is there some way that I could include an FPS counter into the border? Like where the name is, or just a better way to display it.

Here is a link to the script that I am referring to:

It's by Zeus81

http://forums.rpgmakerweb.com/index.php?/topic/3738-fps-display-isnt-very-accurate/

I'd really appreciate it :)
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
What do you mean by "where the name is"?
 
Last edited by a moderator:

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
504
First Language
English
Primarily Uses
Other
You mean like what happens when you press F2? (This computer is bad)

 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
It may be possible for scripts to access the window's title bar and change the title displayed accordingly.

I tried calling SetWindowText, but it doesn't stay.

module Window_Text SetWindowText = Win32API.new('user32', 'SetWindowText', 'pp', 'i') CreateWindowEx = Win32API.new('user32', 'CreateWindowEx', 'ippiiiiiiiii', 'i') FindWindow = Win32API.new('user32', 'FindWindow' , 'pp', 'i') HWND = FindWindow.call('RGSS Player', 0) def self.run SetWindowText.call(HWND, "test change") endendMy guess is that the RM player is also doing the same thing every frame when it calculates FPS.For example, adding this

module Graphics class << self alias :th_old_update :update def update th_old_update Window_Text.run end endendAnd you can see that the name changes to the custom text, but then it would change back to the old text.I don't know if there's anything you can do about it.
 
Last edited by a moderator:

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
504
First Language
English
Primarily Uses
Other
I'm confused here, doesn't F2 show the FPS? Why would you need another way?
 

Tralse

Map Builder
Veteran
Joined
May 18, 2015
Messages
57
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Ah I didn't know that you could display the FPS with F2!

That was exactly what I was referring to.

Thanks for the speedy reply!

So is there a way to call the F2 command when the game starts so the player doesn't have to do it?

As you can see some people don't know about it lol :guffaw:
 

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
504
First Language
English
Primarily Uses
Other

Tralse

Map Builder
Veteran
Joined
May 18, 2015
Messages
57
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Thanks for putting in all the work Tsukihime

It may be possible for scripts to access the window's title bar and change the title displayed accordingly.
I tried calling SetWindowText, but it doesn't stay.
 

module Window_Text SetWindowText = Win32API.new('user32', 'SetWindowText', 'pp', 'i') CreateWindowEx = Win32API.new('user32', 'CreateWindowEx', 'ippiiiiiiiii', 'i') FindWindow = Win32API.new('user32', 'FindWindow' , 'pp', 'i') HWND = FindWindow.call('RGSS Player', 0) def self.run SetWindowText.call(HWND, "test change") endendMy guess is that the RM player is also doing the same thing every frame when it calculates FPS.

For example, adding this
 
Code:
module Graphics  class << self        alias :th_old_update :update    def update            th_old_update            Window_Text.run    end  endend
And you can see that the name changes to the custom text, but then it would change back to the old text.

I don't know if there's anything you can do about it.
And Jackus that is the exact script I was looking for!

Um...I don't know if it is against forum rules but I have another question because I am getting an error message when I paste the script "Dekita - FPS"

Script 'Dekita - FPS' line 50: NameError occured.

uninitialized constant Object::DEK
Here is the line of script in question

Code:
#===============================================================================# ■ DEK::FPS#===============================================================================module DEK::FPS#===============================================================================  #-----------------------------------------------------------------------------  # ☆ DEK::FPS.toggle
 
 

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
504
First Language
English
Primarily Uses
Other
Dont forget to add Dek Kore as well.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
It is rather against forum rules because if we keep one question, one thread, it is much simpler for other people to find the solution if they have a similar problem.  That's one of the reasons we like people to give clear titles to their threads as well.

In this case, I strongly urge you to post your query in the thread of the script that is causing you problems.  You are much more likely to get an informed answer.
 

Tralse

Map Builder
Veteran
Joined
May 18, 2015
Messages
57
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Thank you for the clarification! I'll check out Dek's script page and see if anyone else ran into the problem.

I really appreciate the help guys!

Edit: The Dekita Kore was all that was missing. Works Perfectly!...Cheers!
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top