Jump to content

Hyperpin Hi-Scores


HorsePin

Recommended Posts

1. Download PinEmHi from http://www.pinemhi.com/

 

2. Extract to folder inside Hyperpin directory called PINEmHi.

 

3 .Create a Hi folder inside here.

 

4 .Edit the paths to your VP nvram and FP fpram folders inside pinemhi.ini

 

5 .I don't know any other way around this next step for now and that is to copy the exe and ini to your C:/ root.

 

6. Read spoilers below and look for red text, this is all you need to add to existing functions.

 

7. The two extra functions can go at the very bottom of FPLaunch.

 

8. You will need to load then exit a table for a score to show up next time you pause the game and should look like this:

 

http://imageshack.us/photo/my-images/441/scorepause.png/

Link to comment
Share on other sites

  • Replies 74
  • Created
  • Last Reply

;------------------------------------------------------------------------------;
    ;                       GET PARAMATERS AND SET HOTKEYS                         ;
    ;------------------------------------------------------------------------------;
    
    hyperini = %A_ScriptDir%\Settings\Settings.ini
    picDir = %A_ScriptDir%\Media\HyperPin\Images\
   
    PINemHi_ini = %A_ScriptDir%\PINemHi\pinemhi.ini
    HiScoreTxt  = %A_ScriptDir%\PINemHi\Hi

On exit of table FP/VP call function to save hi score texts

 

CloseVP:

Hotkey, %exitScriptKey%, Off

GoSub rosveClose

GoSub PinEmHiScore

;Visual Pinball must be closed this way instead of killing process

;or it wil not save your last game information.i.e score/credtis

DetectHiddenWindows on ;Or next line will not work

Loop, 4

Gui, %A_Index%: Destroy

;This line fixes where the VP Window flashes real quick

;when closing the window for a cleaner exit

; win hide removed cause vp should be minimized, not hidden

;WinHide, ahk_class VPinball

;WinShow, ahk_class VPinball

WinMinimize, ahk_class VPinball

WinClose, ahk_class VPinball

WinWaitClose ahk_class VPinball

GoSub bigbossClose

GoSub, ExitScript

return

CloseFP:

;close all gui's except black screen (gui 5)

Loop, 4

Gui, %A_Index%: Destroy

;hide and minimize fp editor

GoSub PinEmHiScore

WinHide, ahk_class FuturePinball

WinMinimize, ahk_class FuturePinball

;Future Pinball must be closed this way instead of killing process

;or it wil not save your last game information.i.e score/credtis

WinActivate, ahk_class FuturePinballOpenGL

WinWaitActive, ahk_class FuturePinballOpenGL

Send {Esc}

WinWaitClose, ahk_class FuturePinballOpenGL

;saving fp table position, black screen hides fp window

if (saveFPTables = "true") and (saveFPNeeded = "true") {

;WinRestore, ahk_class FuturePinball

WinActivate, ahk_class FuturePinball

WinWaitActive, ahk_class FuturePinball

WinMenuSelectItem, ahk_class FuturePinball,,File,Save

Sleep, 1000

}

WinClose, ahk_class FuturePinball

WinWaitClose, ahk_class FuturePinball

GoSub, ExitScript

return

 

Pause Screen Edits

 

PauseFP:                        ; call pause screen or exit menu

    if (Paused = 0) { ; we are entering pause menu

            Paused = 1

            WinActivate, ahk_class FuturePinballOpenGL

            WinWaitActive, ahk_class FuturePinballOpenGL

            Send {%pauseFPKey%}

            WinWaitActive, ahk_class FuturePinballOpenGL

            Gosub CreateBlackScreen ; we draw printscreen first

            if (useExitMenu = "true") {

  GoSub PinEmHi_Pause

                    Gosub ExitMenu ; draw menus - nothing else!

                    Hotkey, %UpKey%, MoveUp, On

                    Hotkey, %DownKey%, MoveDown, On

                    Hotkey, %exitEmulatorKey2%, selectItem, On

                    Hotkey, %exitEmulatorKey3%, selectItem, On

            } else {

  GoSub PinEmHi_Pause

                    Gosub CreatePauseScreen

                    Hotkey, $%exitEmulatorKey2%, CloseFP, On

                    Hotkey, $%exitEmulatorKey3%, CloseFP, On

            }

    } else { ; we are exiting pause menu

            Paused = 0

            if (useExitMenu = "true") {

                    Gosub ExitMenu ; close menus or flyer or instr.

                    Hotkey, %UpKey%, Off

                    Hotkey, %DownKey%, Off

                    Hotkey, %exitEmulatorKey2%, Off

                    Hotkey, %exitEmulatorKey3%, Off

            } else {

                    Gui 1: Destroy

                    Gui 5: Destroy

                    Hotkey, $%exitEmulatorKey2%, Off

                    Hotkey, $%exitEmulatorKey3%, Off

                    WinActivate, ahk_class FuturePinballOpenGL

                    WinWaitActive, ahk_class FuturePinballOpenGL

                    Send {%pauseFPKey%}

            }

    }

    return

    

    PauseVP:                        ; call pause screen or exit menu

    If (Paused = 0) { ; entering pause menu

            Paused = 1

          

            if (useExitMenu = "true") {

   GoSub PinEmHi_Pause

                    Gosub ExitMenu ; draw menus

    

                    Hotkey, %UpKey%, MoveUp, On

                    Hotkey, %DownKey%, MoveDown, On

                    Hotkey, %exitEmulatorKey2%, selectItem, On

                    Hotkey, %exitEmulatorKey3%, selectItem, On

    

                   

            } else {

           GoSub PinEmHi_Pause

                    Gosub CreatePauseScreen

                    Hotkey, $%exitEmulatorKey2%, CloseVP, On

                    Hotkey, $%exitEmulatorKey3%, CloseVP, On

            }

    

    } Else { ; exiting pause menu

            Paused = 0

            if (useExitMenu = "true") {

                    Gosub ExitMenu ; close menus

                    Hotkey, %UpKey%, Off

                    Hotkey, %DownKey%, Off

                    Hotkey, %exitEmulatorKey2%, Off

                    Hotkey, %exitEmulatorKey3%, Off

                    ;Send, {F10}

            } else {

                    Gui, Destroy

                    Hotkey, $%exitEmulatorKey2%, Off

                    Hotkey, $%exitEmulatorKey3%, Off

                    ;Send, {F10}

            }

            WinActivate, ahk_class VPPlayer,,DMD

    }

    return

 

Exit Menus

 

;----------------------------------Exit Menu-----------------------------------;

ExitMenu:

toLog("ExitMenu Called")

If (instructionsOn = 1)  ; close instruction card

  Gosub Instructions

Else If (flyerOn = 1)  ; close flyer

  Gosub Flyer

Else If (Paused = 1) {  ; show menus

SoundPlay menu.wav

menuOn = 1

menuItem = 1

serviceMenuOn = 0

DMDon = 0

Gui, 2: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop

Gui, 2: Show, Hide

hwExitInfo := WinExist()

Gui, 2: +Lastfound

WinActivate

    exitInfoPic = %picDir%exitMenu1b.png

iBitmap := Gdip_CreateBitmapFromFile(exitInfoPic)

iWidth := Gdip_GetImageWidth(iBitmap), iHeight := Gdip_GetImageHeight(iBitmap)

;If (Playfield_Rotation = 90) Or (Playfield_Rotation = 270) {

  iscale := A_ScreenHeight/iWidth

  sWidth := A_ScreenHeight+1, sHeight := iHeight*iscale

  yExitInfo := -1

;}

Gdip_GetRotatedDimensions(sWidth, sHeight, Playfield_Rotation, brWidth, brHeight)

    Gdip_GetRotatedTranslation(sWidth, sHeight, Playfield_Rotation, xTranslation, yTranslation)

   xExitInfo := A_ScreenWidth-brWidth+1

ihbm := CreateDIBSection(brWidth, brHeight)

ihdc := CreateCompatibleDC()

iobm := SelectObject(ihdc, ihbm)

iG := Gdip_GraphicsFromHDC(ihdc)

Gdip_TranslateWorldTransform(iG, xTranslation, yTranslation)

    Gdip_RotateWorldTransform(iG, Playfield_Rotation)

Gdip_SetCompositingMode(iG, 1)

Gdip_SetInterpolationMode(iG, 7)

Gdip_DrawImage(iG, iBitmap, -1, -1, sWidth+2, sHeight+2, 0, 0, iWidth, iHeight)

    Gdip_DisposeImage(iBitmap)

UpdateLayeredWindow(hwExitInfo, ihdc, xExitInfo, yExitInfo, brWidth, brHeight)

Gui, 1: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop

Gui, 1: Show, Hide, ExitMenu

hwExit := WinExist()

Gui, 1: +Lastfound

Winactivate

exitmenuPic = %picDir%exitMenu1.png

pBitmap := Gdip_CreateBitmapFromFile(exitMenuPic)

pWidth := Gdip_GetImageWidth(pBitmap), pHeight := Gdip_GetImageHeight(pBitmap)

   pscale := ((A_ScreenHeight*hyperScale)/pWidth)

dWidth := pWidth*pscale, dHeight := pHeight*pscale

Gdip_GetRotatedDimensions(dWidth, dHeight, Playfield_Rotation, rWidth, rHeight)

    Gdip_GetRotatedTranslation(dWidth, dHeight, Playfield_Rotation, xMTranslation, yMTranslation)

   xExitM := (A_ScreenWidth-rWidth)/2, yExitM := (A_ScreenHeight-rHeight)/2

hbm := CreateDIBSection(rWidth, rHeight)

hdc := CreateCompatibleDC()

obm := SelectObject(hdc, hbm)

G := Gdip_GraphicsFromHDC(hdc)

Gdip_TranslateWorldTransform(G, xMTranslation, yMTranslation)

    Gdip_RotateWorldTransform(G, Playfield_Rotation)

Gdip_SetCompositingMode(G, 1)

Gdip_SetInterpolationMode(G, 7)

Gdip_DrawImage(G, pBitmap, 0, 0, dWidth, dHeight, 0, 0, pWidth, pHeight)

    Gdip_DisposeImage(pBitmap)

UpdateLayeredWindow(hwExit, hdc, xExitM, yExitM, rWidth, rHeight)

   

Gui, 1:Show

Gui, 2:Show

} Else { ; close menus

SoundPlay menu.wav

menuOn = 0

serviceMenuOn = 0

DMDon = 0

GoSub closeMenus

Gui, 6:Destroy

   Gui, 5:Destroy

   Gui, 4:Destroy

Gui, 3:Destroy

Gui, 2:Destroy

Gui, 1:Destroy

if (systemName = "Future Pinball") {

  Gui, 5: Destroy

  WinActivate, ahk_class FuturePinballOpenGL

  WinWaitActive, ahk_class FuturePinballOpenGL

  Send {%pauseFPKey%}

}

}

Return

 

Functions:

 

PinEmHiScore:

 

 

PinEmHiScore:

If (systemName = "Visual Pinball") {

        IniRead, nvram, %PINemHi_ini%, paths, VP

            WinGetTitle,romnice,ahk_class MAME

  

   if (romnice = ERROR ) {

          ; msgbox, continuing

     FileList =

     Loop, %nvram%\*, 0

     FileList = %FileList%%A_LoopFileTimeAccessed%`t%A_LoopFileName%`n

     Sort, FileList ; Sort by date.

    

    

     Loop, parse, FileList, `n

        {

     if A_LoopField = 

     continue

     StringSplit, FileItem, A_LoopField, %A_Tab%

        }

     ifInString,FileItem2,.nv

        {

     StringTrimRight, nvrammetje, FileItem2,3

        }

     romname = %nvrammetje%

         

     RunWait, %comspec% /c PINemHi %nvrammetje%.nv>"%tablename%".txt, C:\,hide

     Sleep 500

     Filemove, C:\%tablename%.txt, %HiScoreTxt%%tablename%.txt, 1

     Sleep 100

     }

    

   Else {

            IniRead, romname, %PINemHi_ini%, romfind, %romnice%

            RunWait, %comspec% /c PINemHi %romname%.nv>"%tablename%".txt, C:\,hide

            Sleep 500

            Filemove, C:\%tablename%.txt, %HiScoreTxt%%tablename%.txt, 1

            Sleep 100

   }

   }

  

   If (systemName = "Future Pinball") {

   RunWait, %comspec% /c PINemHi %tablename%.fpram>"%tablename%".txt, C:\,hide

   Sleep 500

            Filemove, C:\%tablename%.txt, %HiScoreTxt%%tablename%.txt, 1

            Sleep 100

   }

  

   Return

 

 

PinEmHi Pause Screen GUI Function

 

PinEmHi_Pause:

Fileread, contents,%HiScoreTxt%%tablename%.txt

;msgbox %tablename%

pToken := Gdip_Startup()

Gui, Destroy

;vertical distance of Hiscore window

HiScoreTopDistance := 100

;Gui 4 - hidden horizontal Gui

Gui, 4: Color, 0b40e4

Gui, 4: Font, s15, Quartz

Gui, 4: Add, Text, Cffffff Center, %contents%

Gui, 4: +AlwaysOnTop -Caption +Lastfound

hwnd := WinExist()

Gui, 4: Show, NA

WinGetPos,scorex,scorey, scorew, scoreh, ahk_id %hwnd%

pBitmap := Gdip_BitmapFromScreen("hwnd:" hwnd)

Gui, 4: Show, Hide

;Gui 5 - hiscore background image

imageW := scoreh+20, imageH := scorew+40

Gui, 5: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop

Gui, 5: Show, NA

hwnd1 := WinExist()

hbm := CreateDIBSection(imageW, imageH)

hdc := CreateCompatibleDC()

obm := SelectObject(hdc, hbm)

G := Gdip_GraphicsFromHDC(hdc)

Gdip_SetSmoothingMode(G, 4)

pBrush1 := Gdip_BrushCreateSolid(0xff0ffffff)

pBrush2 := Gdip_BrushCreateSolid(0xff00C32A5)

pBrush3 := Gdip_BrushCreateSolid(0xff0b40e4)

Gdip_FillRoundedRectangle(G, pBrush1, 0, 0, imageW, imageH, 20)

Gdip_FillRoundedRectangle(G, pBrush2, 5, 5, imageW-10, imageH-10, 15)

Gdip_FillRoundedRectangle(G, pBrush3, 10, 10, imageW-20, imageH-20, 10)

Gdip_DeleteBrush(pBrush1)

Gdip_DeleteBrush(pBrush2)

Gdip_DeleteBrush(pBrush3)

UpdateLayeredWindow(hwnd1, hdc, HiScoreTopDistance, (A_ScreenHeight-imageH)//2, imageW, imageH)

SelectObject(hdc, obm)

DeleteObject(hbm)

DeleteDC(hdc)

Gdip_DeleteGraphics(G)

;Gui 6 - rotated vertical Gui

Gui, 6: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop

Gui, 6: Show, NA

hwnd2 := WinExist()

bitmapW := scoreh, bitmapH := scoreW

hbm := CreateDIBSection(bitmapW, bitmapH)

hdc := CreateCompatibleDC()

obm := SelectObject(hdc, hbm)

G := Gdip_GraphicsFromHDC(hdc)

UpdateLayeredWindow(hwnd2, hdc, HiScoreTopDistance+10, (A_ScreenHeight-bitmapH)//2, bitmapW, bitmapH)

Gdip_ImageRotateFlip(pBitmap, 3)

Gdip_DrawImage(G, pBitmap)

UpdateLayeredWindow(hwnd2, hdc)

Gdip_DisposeImage(pBitmap)

SelectObject(hdc, obm)

DeleteObject(hbm)

DeleteDC(hdc)

Gdip_DeleteGraphics(G)

return

Link to comment
Share on other sites

Great job man, is this using drawing gui code from bleasby?

It was a great code, i think he even made code for drawing all menus from script (without image).

Will have to check it and use it in new version of fplaunch :)

Link to comment
Share on other sites

I'm not sure who it was who made the gui but I did find it on the hyperpin forum, lost in the middle of a big thread somewhere. Definatley needs a credit there.

 

Yes, she's very nice and fits great within the existing menu. I think it is drawn with the gdip rather than an image ?

 

If this could make it into a newer version that would be sweet, save some peeps a bit of hassle!

 

Cheers! :D

Link to comment
Share on other sites

Here is some test code - fplaunch 1.295 wip 9 with hiscores enabled.

I patched this in a rush so expect some bugs, vp is tested, fp is not - but i don't know if i should even show scores on fp - since they are already there?

There are still lot's of things to do - so expect newer versions soon:

 

Installation - save your old fplaunch exe and ahk, put this one, recompile with basic version and put latest pinemhi files (exe and ini) in hyperpin directory - no need to create any folders.

Post results/bugs.

 

Code is in the next post under the spoiler.

Link to comment
Share on other sites

Nice one! Will try it in half an hour or so.

 

I patched this in a rush so expect some bugs, vp is tested, fp is not - but i don't know if i should even show scores on fp - since they are already there?

 

Well I would rather have fp in there. Whenever I pause a game it's done with the 'e' key and not how fp is set with the middle mouse button.

 

This scoreboard also looks better than the built in FP table. You'll also find that the built in table can sometimes be scue-wiff depending on size of your resolution. Half of it missing.

 

Maybe add a switch for it?

Link to comment
Share on other sites

Pretty much bug city my end mate. Would you like me to add it into the original WIP?

 

 

RunWait, %comspec% /c PINemHi %romname%>hi\VP\"%tablename%".txt,,hide

 

I'm not sure what the benefit was to having just being called hiscore.txt was?

 

Ok. Now I see. I prefer to keep a log of the hi scores. (Leaves options open to use outside of the pause menu, add to instruction card screen in main menu for instance)

 

The menus don't work as they are right now, fixing now. All it is , is the ball isn't moving.

 

Will keep editing this post.

 

Edit: I just revisted it and I have to say that I'm gonna give up with it and continue to use mine, sorry, just don't have the time to test when I have it working good anyway.

 

Really, all the problem is the ball not moving in menu and Future pinball now not printing to text, even though this works as it should through the CLI and the code is no different to what it was.

 

Future pinball also has a flashing and menu disappearing too.

Link to comment
Share on other sites

yeah i thought you would have lot's of bugs, i also had to change lot's of stuff - cause it looks like i have pinemhi.ini which has rom names with nv in the and you have without nv?

Do you have the latest version of pinemhi? I donwloaded mine yesterday.

Also i see for lot's of tables - ini file has name "Addams Family, The..." and my rom has nice name "The Addams Family ..." - will have to check which is more accurate.

 

i checked why circles are not moving - it is because menus and hiscores use all same variables - i changed variable names (graphics context and so on), and now circle moves.

 

as for fp - yeah that fp scores are really very ugly - maybe we should overwrite them - i will check that part of the code also

 

right now script is veeery slow cause it parses a lot of things on press of exit key (all files in nvram dir)

 

but i will search for romname on table start so menu will come up fast

 

what's the logic behind parsing nvram dir? taking latest nvram? unfortunatelly vp saves nvram only on exit so your nvram will be latest one only if you exit from table and start same table again - so i would not depend on it - it's better to update your pinemhi.ini with your table nice name and real name

 

saving of all hiscores in files is not necesary since goal is to have latest hi scores in that moment not from  previous run

 

biggest problem is what about unsupported roms and non rom tables - they will have no hi scores

Link to comment
Share on other sites

Hi Blur

 

I presume we both have latest v1.0 and ini contains the .nv. My ini doesn't contain The addams , only addams family.

 

but i will search for romname on table start so menu will come up fast

 

Before I had the text created on launch of a table, as soon as pinmame appeared, but I think there was a problem with older tables like the funhouse era that wouldn't work that way so I reverted back to saving the text on exit of VP.

 

This is when the script checks for IF ERROR on those older games.

 

Basicly as you exit the table (as you know the nvram is saved) but before visual pinball is closed you can manage to make the text of that latest nvram file. Instead of creating on the pause screen, this should make it faster and un-noticable.

I think this is how it was in the script I posted still.

 

You can remove the sleep commands, all that was doing was giving the script enough time to copy text over from c:/

 

 

saving of all hiscores in files is not necesary since goal is to have latest hi scores in that moment not from  previous run

 

Yep , you're right it's not necessary but like I mentioned I did have a goal in mind where I could see the scores before I launched a table. Either by adding a menu like the flyer/instruction card or incorporating into the instruction menu. I'm sure I had it working like that but the scores were printed off onto Hyperdmd and each time I selected a game they would come up onto hyperdmd. The files are only 1kb and even if we had 1000's i'm sure it wouldnt break the bank so to speak. ;p

 

 

biggest problem is what about unsupported roms and non rom tables - they will have no hi scores

I had already thought of that and it came to mind again when I played bodydumps new table today.

 

Sharpshooter (Game Plan) (1979) (Bodydump) (1.0) (FS).txt

 

Not supported rom : C:\Users\horse\Google Drive\Pinball NVRAM\sshooter.nv

 

 

Really it can be a simple check for "Not supported" on the first line in the text file before the pause screen is made? and to exit/break the function if it contains it and not create the gui.

 

Cheers!

 

Link to comment
Share on other sites

Great job man, is this using drawing gui code from bleasby?

It was a great code, i think he even made code for drawing all menus from script (without image).

Will have to check it and use it in new version of fplaunch :)

 

 

Hi guys,

 

Yeah, i did the menu code a long time ago. Good to see that you guys are using it (I did reply in the HyperSpin forum a weak ago about it, but i think that my post was flagged for moderation and never appeared at the forum).

 

Anyways, the code is not the most efficient one. I learned a few more tricks in the last two years that could be used on it if you want to develop a new fplaunch version including it.

 

 

The way it works is this: 

It was impossible to write the GDI+ text rotated (at least at that time), so I first draw the text normally in a layer, save this layer in memory as a bitmap, delete the text layer, rotate the bitmap, drawn the button components, and finally drawn the text bitmap above the buttons at the rotate hyperpin orientation.

The good about this is that it is very easy to add a lot of customization for the fplaunch menu, different text fonts for different pinball tables, different button colors,... just by editing a small global or per table ini file (just like HyperLaunch inis work). We could use our imagination with that.

 

 

Unfortunately, by now i don't have much time (I am helping djvj with the next HyperLaunch and you will see some nice features in the next version if you use HyperSpin too).

 

As soon as I have more time, we could keep the contact to start to help on that if you guys want it.

 

You probably already know, but the original code for the menu is in this post:

http://www.hyperspin-fe.com/forum/showthread.php?10935-FPLaunch-MOD-Pause-and-Loading-screens&p=154905#post154905

 

and the old code for the HyperPin menus is in this post: 

http://www.hyperspin-fe.com/forum/showthread.php?10935-FPLaunch-MOD-Pause-and-Loading-screens&p=155354#post155354

 

Cheers

Link to comment
Share on other sites

Hey bleasby - i was just checking your dynamic menus code from last link.

Almost forgot it for a year or so. No wonder when i look at the date - it was written at last Christmas eve :)

Great code. I will try to use that also. Right now i don't see text in menus and there is no hiscores but that's probably because i have basic ahk.

 

Will try to upgrade to ahk_L.

What ahk_Lversion should i use to be compatible with new hyperlaunch?
 
Horsey i was thiniking about latest hiscores - if vp saves nvram only on exit and never during the game??? then there's no use in running pinemhi on every key press. It will always be the same - i can just as well get it on start while table is loading and use it every time, right?
Or is the nvram saved right away when you change something in service menu or when you make a high score, did you tested it? Did anybody tested this - when is nvram saved?
 

post-48-0-57833200-1358892776_thumb.jpg

Link to comment
Share on other sites

Horsey i was thiniking about latest hiscores - if vp saves nvram only on exit and never during the game??? then there's no use in running pinemhi on every key press. It will always be the same - i can just as well get it on start while table is loading and use it every time, right?

Or is the nvram saved right away when you change something in service menu or when you make a high score, did you tested it? Did anybody tested this - when is nvram saved?
 

 

No there isn't , I did point this out in previous post. I'll re-quote myself for you :)

 

 

Before I had the text created on launch of a table, as soon as pinmame appeared, but I think there was a problem with older tables like the funhouse era that wouldn't work that way so I reverted back to saving the text on exit of VP.

 

The older games won't work like that on startup but the newer ones will. Which basicly leaves the only option on exit.

 

The rom either has to be closed to save or reset with F3.

 

WinWaitClose ahk_class VPinball

   GoSub PinEmHiScore

            GoSub bigbossClose

            GoSub, ExitScript

 

Calling function to create text. I don't have any speed issues with that.

 

 

Really in theory it should of worked on startup but I had to revert back for some reason. Maybe it was because I was using the filecopy from C:/

 

But again, from what I also wanted from it by collecting text files into a hi directory on exit,  it leaves me the option so I can add the very latest score into the hyperpin menu as well as pause screen.

Link to comment
Share on other sites

Hey bleasby - i was just checking your dynamic menus code from last link.

Almost forgot it for a year or so. No wonder when i look at the date - it was written at last Christmas eve :)

Great code. I will try to use that also. Right now i don't see text in menus and there is no hiscores but that's probably because i have basic ahk.

attachicon.gifmenu.jpg

Will try to upgrade to ahk_L.

What ahk_Lversion should i use to be compatible with new hyperlaunch?
 
 

 

Sorry for going away from the post subject, maybe we could create a alternative discussion about this someplace else.

 

Anyways, answering your questions:

 

Everything in hyperlaunch is made with the newer version of autohotkey. I believe that sometime ago they united the different versions of autohotkey (basic, L and U) into only one. Just install the new autohotkey with unicode. However, if you want to compile the HyperLaunch ahk, you need a alternative version because djvj makes use of the autohotkey.dll to allow some code to be outside of the compiled executable (the modules code).

 

Be aware that old code needs to be adapted to work in these newer version. The good thing is that they are much more powerful them the old ones. 

 

Probably the text is not showing in your computer because you don't have the font installed, try to change the line "MainMenuFont = Spin Cycle" to "= Arial" or something like it. If it is still not showing it is probably because the old code need some adaptations to be perfectly compatible with your autohotkey version.

 

Anyways, the way I did the text rotation before, creating GUIs with the text, to create the bitmap from screen with Gdip_BitmapFromScreen, and them rotating them with Gdip_ImageRotateFlip, is a bad solution for rotating the text. You can do the same thing without the numerous GUIs that I was creating, using only one GUI and a GDI graphics pointer. This will be much faster and more reliable.

 

If you want to make this, I can try to make a new code with these things inside, but I don't have much time right now, so I would took sometime before beying able to start it. If you want to get your hands dirt already I can try to help you whenever you have any doubt about it. 

Link to comment
Share on other sites

The older games won't work like that on startup but the newer ones will. Which basicly leaves the only option on exit.

I saw that part, I have no problems with funhouse, maybe you checked for title too early in the script.

 

 

Everything in hyperlaunch is made with the newer version of autohotkey. I believe that sometime ago they united the different versions of autohotkey (basic, L and U) into only one. Just install the new autohotkey with unicode. However, if you want to compile the HyperLaunch ahk, you need a alternative version because djvj makes use of the autohotkey.dll to allow some code to be outside of the compiled executable (the modules code).

 

Be aware that old code needs to be adapted to work in these newer version. The good thing is that they are much more powerful them the old ones. 

For start i will just add highscores and few other functionalities, and maybe migrate to ahk_L. Dynamic menus will come later. I tested with ahk_L and it shows text on menus.

Why unicode version - ansi is much faster with text?

Link to comment
Share on other sites

For start i will just add highscores and few other functionalities, and maybe migrate to ahk_L. Dynamic menus will come later. I tested with ahk_L and it shows text on menus.

Why unicode version - ansi is much faster with text?

 

Glad to know that it is working fine in ahk_l.

 

I prefer to do everything with Unicode because you are much more future proof with that. Besides, this is a must-have if you are talking about international users, different alphabets,... (with Unicode there is no problem when translating the menus to other languages, using different accents, even Chinese characters, meanwhile in ANSI you would have issues with that). About the velocity, yes ansi can be slightly faster, but to applications like fplaunch, when a visual pinball machine already needs a decent hardware to work fine, this is not a big issue in my opinion.

 

Just let me know if you need any help.

Link to comment
Share on other sites

There are 4 possible scenarios regarding hiscores:

1. table is rom based and rom is supported by pinemhi - you will see table name and hi scores - this works also for uvp and directb2s tables!

2. table is rom based but rom is not supported by pinemhi - you wil see table name and text "not supported rom ...romname" in the next line

3. table is rom based but rom title is not found in pinemhi ini file - you will see table name only - what you have to do in this case is add your rom title to pinemhi.ini so that script can relate rom title with rom name - i'm thinking about writing message - "ROM title ... not found in pinemhi.ini file"???

There are some roms with this problem - like addams family has title "The Addams Family (...) (...)" and pinemhi has entry - "Addams Family, The (...) (...)" so they don't match

4. table is not rom based (originals and em tables) - you will see table name only

 

How program works:

1. we get rom title from mame window

2. we relate this rom title to rom name over pinemhi.ini file which has list of all roms and their rom titles (we never look for latest file in nvram directory cause it is saved only after we exit)

3. for that rom we get hiscores with pinemhi (only on start of the table to speed up the process)

4. hiscores file is shown when exit key is pressed

Link to comment
Share on other sites

Here is new fplaunch 1.295 wip 9 with hiscores and title.

 

Very good no problems so far.  VP & FP.

 

I wouldn't mind having the exit menu selections lower down from the center. If you try medieval madness with long score this can fall behind menu.

Link to comment
Share on other sites

There are 4 possible scenarios regarding hiscores:

1. table is rom based and rom is supported by pinemhi - you will see table name and hi scores - this works also for uvp and directb2s tables!

2. table is rom based but rom is not supported by pinemhi - you wil see table name and text "not supported rom ...romname" in the next line

3. table is rom based but rom title is not found in pinemhi ini file - you will see table name only - what you have to do in this case is add your rom title to pinemhi.ini so that script can relate rom title with rom name - i'm thinking about writing message - "ROM title ... not found in pinemhi.ini file"???

There are some roms with this problem - like addams family has title "The Addams Family (...) (...)" and pinemhi has entry - "Addams Family, The (...) (...)" so they don't match

4. table is not rom based (originals and em tables) - you will see table name only

 

How program works:

1. we get rom title from mame window

2. we relate this rom title to rom name over pinemhi.ini file which has list of all roms and their rom titles (we never look for latest file in nvram directory cause it is saved only after we exit)

3. for that rom we get hiscores with pinemhi (only on start of the table to speed up the process)

4. hiscores file is shown when exit key is pressed

Hi Blur,

 

Nice work on the hiscore-support.

There's only a small problem with dmd's that are hidden (in the tablescript in the .vpt), these are mostly the alphanumeric pre 1982's tables.

I figured out a while ago that there is no nice-rom window name that you can grab when they are hidden.

 

This is the reason why i gave horseyhorsey the nvram sort to have them as well.

And of course for when the nice-rom name doesn't match i use that as a backup.

 

The rom transalation by the way is from the pinmame 2.4 version , the new entries from the 2.5 version are not included yet.

I extracted the info from pinmame but as you already noticed it isn't always correct regarding the nice-rom name and the real windowname.

 

Your steps to make it work look great, that would be a good way to implement it.

Maybe you can find a way to grab the hidden ones as well

 

If I have time I will see if i can update the rom translation bit to pinmame version 2.5

 

The output is segmented by the way so maybe there is a possibility to alternate pages?   (regarding the last question from horseyhorsey)

 

 

Dna Disturber

Link to comment
Share on other sites

Hi Blur,

Nice work on the hiscore-support.

There's only a small problem with dmd's that are hidden (in the tablescript in the .vpt), these are mostly the alphanumeric pre 1982's tables.

I figured out a while ago that there is no nice-rom window name that you can grab when they are hidden.

Tnx dna! I've tested a lot of uvp and b2s tables and never had any problem with not detecting mame title. Maybe it is because of "detect hidden windows on" or i use better place in script to check for mame window or maybe it is because of my setup (win 7 and pinmame 2.4). Let's wait and see if anybody will have problems with older tables.

 

For large hiscore that go under the menu - yup i saw just now how long they are in medieval madness, and i thought attack from mars is the biggest hiscore :)

Any way - i removed all bank lines from hi scores and they are still too large on full hd screen - so i will have to move menu down a bit

 

Still have some things to do - like - drawing hiscores image outside of visible screen to rotate it later - so it's not flashing on the screen.

 

Here is new version 1.295 wip 9 with blank lines removed and with message for rom titles not found (try with addams family)

 

old version removed - check next post for new one

 

Link to comment
Share on other sites

Here is another new version - hiscores are drawn outside of visible screen for rotation - so they will not blink in the middle of the screeen and menu is moved down a bit, and blank lines removed so that medieval madness hiscores fit above the menu.

In zip file you have ahk and exe which is compiled with latest ANSI ahk_L - you might wanna try it. If something doesn't work report and try to compile ahk file with basic version.

 

regards

blur

Link to comment
Share on other sites

Congrats on the move up to L

 

Nice. I didn't have chance to test previous but have just tested the one you just posted.  All seems to be running great.

 

Obviously changing addams entry to this in pinemhi.ini pulls score : The Addams Family (Prototype L-5) (L-7)=taf_l7.nv

 

Dna would you be willing to share how you are pulling the last score made?  I'd like to be able to do this for all players.

I've added a timer overlay that works alongside the leaderboard for use when I play 5 minute mode. Very handy.

Link to comment
Share on other sites

Congrats on the move up to L

 

Nice. I didn't have chance to test previous but have just tested the one you just posted.  All seems to be running great.

 

Obviously changing addams entry to this in pinemhi.ini pulls score : The Addams Family (Prototype L-5) (L-7)=taf_l7.nv

 

Dna would you be willing to share how you are pulling the last score made?  I'd like to be able to do this for all players.

I've added a timer overlay that works alongside the leaderboard for use when I play 5 minute mode. Very handy.

Haha nice one with the timer....

The last scores aren't that hard compared to the special scores....100s of hours spent in decoding...

Start a 4 player game , make some scores and exit.

After that just find the right byteadressess in the nvram.

They are all very recognizable , you just see the score as you should expect for instance 01 23 50

To make sure you got the right ones as they can sometimes be on several places alter them a bit and start the game again.

Do not start a game but look at the attraction , you should see the altered scores....you got the right ones..

I've only got a couple of player 1 last scores....being used in pinemhi leaderboard....i wrote the bit to extract it in Vb , not in autohotkey i'm afraid.....

Link to comment
Share on other sites

Here is a new version with support for different fp exe
put them in fpexetables.txt in settings directory
format is one line for table name - without fpt, and next line for fp exe you want to use with this table
same format is for vpexetables.txt - name is changed - it was vp908tables.txt before

pinemhi is included, fpclose vbs script is also included so you can try it in case you have problems with focus.

 

focus code is also improved so i hope you won't need fpclose

fplaunch 1.295wip9withHiScoresAndFPexe.zip

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...