The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Snowy Fox on July 16, 2007, 10:05:41 PM

Title: [RESOLVED] Automatic Full-screen [RMXP]
Post by: Snowy Fox on July 16, 2007, 10:05:41 PM
Yes, I've done a search on making games full-screen, and thanks to this I know pressing Alt+Enter will result as such.

I've seen games, however, that run in full-screen without need for pressing Alt+Enter. Yes, fully automated 1024x768 bliss without the need of pressing those two little buttons.

(Look at them on your keyboard. Go on, do it now. Now ask yourself if they're really needed to fill your monitor with roleplaying goodness. You know the right answer.)

In any case... yes, you all saw it coming at you like a starving Ethiopian child at a MacDonald's giveaway... how does one attain this marvellous feature? I know it's doubtlessly done through scripts, but I'm still pretty new to all this RPG Maker XP malarkey and don't quite trust myself with its finer features yet... (lays ears flat) so any help would be appreciated muchly. Ta in advance.
Title: Re: Automatic Full-screen [RMXP]
Post by: &&&&&&&&&&&&& on July 17, 2007, 12:48:00 AM
Quoteif $full == nil
    $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
    $showm.call(18,0,0,0)
    $showm.call(13,0,0,0)
    $showm.call(13,0,2,0)
    $showm.call(18,0,2,0)
    $full = 1
  end
Title: Re: Automatic Full-screen [RMXP]
Post by: Kokowam on July 17, 2007, 12:57:26 AM
Lol wow, nice, BoE. Did you make that or was it taken from somewhere else?
Title: Re: Automatic Full-screen [RMXP]
Post by: Snowy Fox on July 17, 2007, 08:53:44 AM
Quote from: BanisherOfEden on July 17, 2007, 12:48:00 AM
Quoteif $full == nil
    $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
    $showm.call(18,0,0,0)
    $showm.call(13,0,0,0)
    $showm.call(13,0,2,0)
    $showm.call(18,0,2,0)
    $full = 1
  end

Thanks, BOE... like I said, though, this doesn't really mean much to me... I wouldn't have the first clue where to put it or what to use it with...
Title: Re: Automatic Full-screen [RMXP]
Post by: Zeriab on July 17, 2007, 09:05:47 AM
Here's a commented version ^_^
if $full == nil
  $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
  $showm.call(18,0,0,0)  # Press ALT down
  $showm.call(13,0,0,0)  # Press ENTER down
  $showm.call(13,0,2,0)  # Release ENTER
  $showm.call(18,0,2,0)  # Release ALT
  $full = 1
end


You can put it pretty much anywhere before the main in the script editor.
Simply click a spot, press Insert and click on the new blank area. Paste the script there.
Still don't understand? Read http://rmrk.net/index.php/topic,263.0.html

Blizzard made one where you at startup can choose whether you full-screen or not.
Some people prefer that you don't force the game to go into full-screen ;)
Title: Re: Automatic Full-screen [RMXP]
Post by: Snowy Fox on July 17, 2007, 09:20:06 AM
Ahhh, thanks a lot Zeriab! ^o^ I'd tinkered with this before on my own and turns out I was just putting it in the wrong place. :3
Title: Re: Automatic Full-screen [RMXP - Resolved]
Post by: Kokowam on July 17, 2007, 11:34:39 AM
Zeriab, for that script, I have a question: How do you find out the number of each key? Like ALT = 18 and Enter = 13 but the other ones?
Title: Re: [RESOLVED] Automatic Full-screen [RMXP]
Post by: Zeriab on July 17, 2007, 01:42:57 PM
np Snowy Fox

@moo420: Two links:

http://msdn2.microsoft.com/en-us/library/ms645540.aspx
http://kevin.allenpress.com/docs/python/PyWin32/win32api__keybd_event_meth.html
Title: Re: [RESOLVED] Automatic Full-screen [RMXP]
Post by: Kokowam on July 17, 2007, 01:50:15 PM
Lol, I can't understand that, but whatever. XD
Title: Re: [RESOLVED] Automatic Full-screen [RMXP]
Post by: Zeriab on July 17, 2007, 04:57:20 PM
Well, if you look at the microsoft side it's just to find the key you want, look at the number in the (parenthesis). It is in hex though.

We have for example
QuoteVK_F12 (7B)
    F12 key

7B = 123, so basically you can press F12 down with '$showm.call(123,0,0,0)  # Press ALT down' ^^

There is for some reason up to F24, but don't ask me why, neither as me why F22 is 85H and not 85 (133)

Let's for an example say you want to open the keyboard configuration. I.e. we want to press F1:
You look F1 up in the Microsoft list and get:
QuoteVK_F1 (70)
    F1 key

You convert 70 from hex to dec and get 112
Then it's just
  $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
  $showm.call(112,0,0,0)  # Press F1 down
  $showm.call(112,0,2,0)  # Release F1


You may not even have to convert 70. You might be able to use it anyway. I haven't tested it, but this might work as well:
You convert 70 to hex and get 112
Then it's just
  $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
  $showm.call(0x70,0,0,0)  # Press F1 down
  $showm.call(0x70,0,2,0)  # Release F1
Title: Re: [RESOLVED] Automatic Full-screen [RMXP]
Post by: Kokowam on July 17, 2007, 05:00:20 PM
That confuses me so I abandon the task of learning that.
Title: Re: [RESOLVED] Automatic Full-screen [RMXP]
Post by: Zeriab on July 17, 2007, 05:01:15 PM
I've edited it to make it more sensible ^^ (I hope)
Title: Re: [RESOLVED] Automatic Full-screen [RMXP]
Post by: Kokowam on July 17, 2007, 05:48:47 PM
Yea, I already knew about changing from hex to dec but... I'm just dumb, let's leave it at that.
Title: Re: [RESOLVED] Automatic Full-screen [RMXP]
Post by: modern algebra on July 18, 2007, 06:11:05 AM
cybersam's Keyboard Input Script shows you a list if you wanted it. I don't think I should post it though as I have no permission to do so.

I actually just used it to make a script  ;D