Jump to content



Photo
- - - - -

Why can't I set a Mech Tilt button in VP?


  • Please log in to reply
52 replies to this topic

#21 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 19 June 2015 - 06:48 AM

Do you use the second script of kodiac? I don´t have any bangback; and i have two warnings bevor tilt. Never had any issues with the tiltbob and it works flawless...

Sub table1_KeyDown(ByVal Keycode)
If Keycode = MechanicalTilt Then vpmTimer.PulseSw vpmNudge.TiltSwitch

 

Ooh...  Silly me.  I didn't see that.   I'll try it thanks.



 


#22 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 19 June 2015 - 05:22 PM

So, it looks like if you set Mech tilt to something other than T, and then use this code...

 

If Keycode = MechanicalTilt Then vpmTimer.PulseSw vpmNudge.TiltSwitch

 

I think it works?    Some tables still seem to give me 2 warning and a tilt automatically, for 1 press.

 

I'll keep messing around with it.  Thanks for your help.



 


#23 wrd1972

wrd1972

    Authoring Padawan

  • Platinum Supporter
  • 2,265 posts
  • Location:Central KY. USA

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 01 July 2015 - 02:30 AM

 

Do you use the second script of kodiac? I don´t have any bangback; and i have two warnings bevor tilt. Never had any issues with the tiltbob and it works flawless...

Sub table1_KeyDown(ByVal Keycode)
If Keycode = MechanicalTilt Then vpmTimer.PulseSw vpmNudge.TiltSwitch

 

Ooh...  Silly me.  I didn't see that.   I'll try it thanks.

 

 

Can I please get a more detailed instruction on how to use the above fix? I tried and could not get it to work. Does this need to be done for every table?

 

Thanks

Bill


My VP Pincab /MAME Arcade  Specs: Dell T3400 workstation with Core2 Quad core 3.0GHZ (Q9650) CPU - 8GB of RAM - Nvidia  GTX 970

40" PF Sony gaming LED TV, Dual 21" Dell monitors in the backbox - Pinscape dual boards - Full DOF - Full MAME arcade support.


#24 Knorr

Knorr

    Enthusiast

  • Platinum Supporter
  • 221 posts
  • Location:Amstetten

  • Flag: Austria

  • Favorite Pinball: Dirty Harry

Posted 02 July 2015 - 07:06 PM

 

Do you use the second script of kodiac? I don´t have any bangback; and i have two warnings bevor tilt. Never had any issues with the tiltbob and it works flawless...

Sub table1_KeyDown(ByVal Keycode)
If Keycode = MechanicalTilt Then vpmTimer.PulseSw vpmNudge.TiltSwitch
 
Ooh...  Silly me.  I didn't see that.   I'll try it thanks.
 
 
Can I please get a more detailed instruction on how to use the above fix? I tried and could not get it to work. Does this need to be done for every table?
 
Thanks
Bill
Look at post 8

#25 wrd1972

wrd1972

    Authoring Padawan

  • Platinum Supporter
  • 2,265 posts
  • Location:Central KY. USA

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 05 July 2015 - 03:18 AM

Ok I edited my tables with the posted line. The tilt behavior is much improved but I am still getting that huge ball jump when a tilt event occurs. Is there a way to fix that?

 

Thanks


My VP Pincab /MAME Arcade  Specs: Dell T3400 workstation with Core2 Quad core 3.0GHZ (Q9650) CPU - 8GB of RAM - Nvidia  GTX 970

40" PF Sony gaming LED TV, Dual 21" Dell monitors in the backbox - Pinscape dual boards - Full DOF - Full MAME arcade support.


#26 Knorr

Knorr

    Enthusiast

  • Platinum Supporter
  • 221 posts
  • Location:Amstetten

  • Flag: Austria

  • Favorite Pinball: Dirty Harry

Posted 05 July 2015 - 03:43 AM

Ok I edited my tables with the posted line. The tilt behavior is much improved but I am still getting that huge ball jump when a tilt event occurs. Is there a way to fix that?
 
Thanks

Try to use any other letter then "T" in the key setting

#27 wrd1972

wrd1972

    Authoring Padawan

  • Platinum Supporter
  • 2,265 posts
  • Location:Central KY. USA

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 17 July 2015 - 11:10 PM

OK for the "mech tilt" function, I changed the keyboard letter from "T", to "R". Tilt bobber is "button 15" and I tied it to the mech tilt function and it is not working.

Do I have to make a tweak in all of the tables for the letter switch?

What am I doing wrong here?

 

Thanks


My VP Pincab /MAME Arcade  Specs: Dell T3400 workstation with Core2 Quad core 3.0GHZ (Q9650) CPU - 8GB of RAM - Nvidia  GTX 970

40" PF Sony gaming LED TV, Dual 21" Dell monitors in the backbox - Pinscape dual boards - Full DOF - Full MAME arcade support.


#28 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 28 July 2015 - 04:51 AM

OK for the "mech tilt" function, I changed the keyboard letter from "T", to "R". Tilt bobber is "button 15" and I tied it to the mech tilt function and it is not working.

Do I have to make a tweak in all of the tables for the letter switch?

What am I doing wrong here?

 

Thanks

 

I am still working on this myself, but I think I have it figured out...

 

You need to change the mech tilt button in VP key settings to something other than 'T'  (Lets say "R")

Then tie your tilt bob into your iPac and have it register as "R"

Then you need to add this line into EVERY TABLE....

 

If Keycode = MechanicalTilt Then vpmTimer.PulseSw vpmNudge.TiltSwitch

 

Put the above line anywhere below the following line in the script..

Sub table1_KeyDown(ByVal Keycode)

 

(If you leave the mech tilt button as T, and disregard the above code..  It should still work, but you will get the ball 'bangback'...... That is what 'T' is set for in VPMKeys.vbs)

 

My only question now is...  Are Stern tables supposed to tilt if you do a quick double hit on the tilt bob? I do in manually to make sure it only hits twice, and thats how they are behaving here.   I assumed I should get a double warning, and not a tilt.    If I wait for 10 seconds or so after a single hit, then I can get my second warning without tilting..  Bit a quick double hit always tilts on Stern tables.

 

Also..  I don't think that pinmame has this "Debounce timer" as mentioned here...

https://pinside.com/...t-warnings-work


Edited by Rawd, 28 July 2015 - 05:08 AM.


 


#29 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 29 July 2015 - 12:39 AM

Yeah.. So it looks like this code would need to be added to every single table to get the tilt to work properly without the 'Bangback' effect on the ball.

 

Is there any way that "Mech Tilt" could be added to VPMkeys.vbs?


Edited by Rawd, 29 July 2015 - 12:41 AM.


 


#30 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,323 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 29 July 2015 - 05:06 PM

Have you seen my NudgePlugIn.vbs script?  It *might* be what you need here.

' MJR's nudge plug-in for cabinets with accelerometers and tilt bobs
' Anyone can use this freely for any purpose, but it has NO WARRANTY of any kind
'
' If your pin cab has an analog accelerometer and a real tilt bob,
' this plug-in will improve how tables handle input from the tilt bob
' switch.  With the standard VP core scripts, the tilt bob has the
' unwanted effect of sending a big simulated jolt to the table
' physics.  If you have an accelerometer, you don't want that extra
' "fake" jolt, because the ball is already getting the right amount
' of nudge action from the accelerometer input.
'
' This script plugs into the VP core scripts to disable the extra,
' fake jolt.  When the tilt bob switch fires, VP will simply pulse
' the ROM tilt switch.
'
' Use this script ONLY if you have BOTH an analog accelerometer AND
' a physical tilt bob switch.  If you don't have an accelerometer,
' you don't want this script, because it will disable all keyboard
' nudging.  (If for some reason you want BOTH accelerometer AND
' keyboard nudging, you'll also have to skip this script, since it
' disables the latter.)
'
' To set this up, follow these steps:
'
' 1. Put this file in your Visual Pinball\Tables directory.
'    It MUST be named NudgePlugIn.vbs
'
' 2. In the Visual Pinball Preferences > Keys dialog, make sure the 
'    key for "Mech Tilt" is set to "T" (that's the default).
'
' 3. In your keyboard encoder setup (i-Pac, etc), set the keystroke
'    that your tilt bob switch sends to "T".  If you're using a
'    key encoder that uses the joystick interface instead of the
'    keyboard, set the "Mech Tilt" entry in the VP Keys dialog to 
'    the button number that your tilt bob is wired to.
'
' Virtually all modern ROM-based tables should work correctly after
' you follow the steps above.  If you find that a table still does
' fake nudging when you press "T" or make contact with your tilt bob
' switch, that table probably has its own special code to handle the
' nudge keys, rather than relying on the VP core scripts (as most
' tables do).  Search the table's script for key handles that respond
' to "keyBangBack" or key code 20 (they're the same thing - that's
' the internal script mapping for the "T" key).  Replace whatever it's
' doing there with a call to vpmNudge.DoNudge 0,6.
'
' Older EM tables that don't have ROM-based controllers are more 
' likely to have custom scripts for this, since the VP common core
' scripts are mostly designed for ROM tables.  If the tilt bob 
' doesn't seem to have any effect in an old EM table, search its
' scripts for "TiltKey" - you'll probably find key handlers for
' LeftTiltKey, RightTiltKey, and CenterTiltKey.  If there's no
' handler for key 20 or keyBangBack, simply add one that does the
' same thing as the others, but omit any call to "Nudge".  E.g.,
' Loserman!'s Hot Shot (Gottlieb 1973) has scripts like this:
'
'  Sub Table1_KeyDown(ByVal keycode)
'     if keycode = CenterTiltKey Then
'        Nudge 90,2
'        TiltIt
'     end if
'     ... many more cases follow ...
'  End Sub
' 
' If you find something like that, you can simply add a new case like
' this:
'
'     if keycode = 20 then TiltIt ' key 20 = keyBangBack = "T" 
'
' In other words, simply call the same subroutine that the other
' handlers call, skipping the call to Nudge (which does that fake
' nudge that we don't want).
 
Class cvpmNudge2
Public TiltSwitch, Sensitivity, TiltObj
 
Public Sub DoNudge(ByVal aDir, ByVal aForce)
               If TiltSwitch <> 0 Then vpmTimer.PulseSw TiltSwitch
        End sub
 
        Public Sub Update : End Sub
        Public Sub Reset : End Sub
        Public Sub SolGameOn(aEnabled) : End Sub
End Class
 


#31 boiydiego

boiydiego

    Pinball Fan

  • Members
  • PipPipPipPip
  • 978 posts
  • Location:baal

  • Flag: Belgium

  • Favorite Pinball: flinstones,t2 chrome edition,wcs,afm,fish tales,medieval,rollercoaster tycoon,taxi

Posted 29 July 2015 - 11:14 PM

that will fix his problem fixed mine ;-) thx again for that MJR


boiydiego___gebruik-n2kbkyc.png


#32 wrd1972

wrd1972

    Authoring Padawan

  • Platinum Supporter
  • 2,265 posts
  • Location:Central KY. USA

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 29 July 2015 - 11:23 PM

MrJ,

Is there supposed to be an attached script to download? I dont see it.


My VP Pincab /MAME Arcade  Specs: Dell T3400 workstation with Core2 Quad core 3.0GHZ (Q9650) CPU - 8GB of RAM - Nvidia  GTX 970

40" PF Sony gaming LED TV, Dual 21" Dell monitors in the backbox - Pinscape dual boards - Full DOF - Full MAME arcade support.


#33 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,369 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 30 July 2015 - 12:57 AM

it's in his post, the script lookin bits



#34 wrd1972

wrd1972

    Authoring Padawan

  • Platinum Supporter
  • 2,265 posts
  • Location:Central KY. USA

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 30 July 2015 - 01:11 AM

it's in his post, the script lookin bits

Sorry, but I am just not good at this stuff.

 

So I take the total contents above and copy it into a wordfile, then rename it:

NudgePlugIn.vbs

And this is now the script that goes in the tables folder?


My VP Pincab /MAME Arcade  Specs: Dell T3400 workstation with Core2 Quad core 3.0GHZ (Q9650) CPU - 8GB of RAM - Nvidia  GTX 970

40" PF Sony gaming LED TV, Dual 21" Dell monitors in the backbox - Pinscape dual boards - Full DOF - Full MAME arcade support.


#35 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 30 July 2015 - 01:18 AM

 

Have you seen my NudgePlugIn.vbs script?  It *might* be what you need here.

 

That is exactly what was needed!   Thank you VERY much!  Works beauty.


 

it's in his post, the script lookin bits

Sorry, but I am just not good at this stuff.

 

So I take the total contents above and copy it into a wordfile, then rename it:

NudgePlugIn.vbs

And this is now the script that goes in the tables folder?

 

Yup.



 


#36 wrd1972

wrd1972

    Authoring Padawan

  • Platinum Supporter
  • 2,265 posts
  • Location:Central KY. USA

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 31 July 2015 - 02:25 PM

Got it working.

Thanks to all.


My VP Pincab /MAME Arcade  Specs: Dell T3400 workstation with Core2 Quad core 3.0GHZ (Q9650) CPU - 8GB of RAM - Nvidia  GTX 970

40" PF Sony gaming LED TV, Dual 21" Dell monitors in the backbox - Pinscape dual boards - Full DOF - Full MAME arcade support.


#37 hocuslocus

hocuslocus

    Neophyte

  • Platinum Supporter
  • 8 posts
  • Location:Houston, Texas

  • Flag: United States of America

  • Favorite Pinball: WOZ, Champion Pub, Medieval Madness

Posted 23 May 2016 - 12:26 AM

I really didn't want to add that line to every table. since tables are constantly being updated it would be a pain in the ass.

so I added the line to each tables key handling script i.e. atari1.vbs, wpc.vbs, de.vbs etc....

even though it's still a lot of modifying it's better then modifying 200+ scripts.

they all look pretty similar some a little different, still not sure about bally games though can't seem to get those to work. I've gone through several tables and it seems like it works ok so...

at this point:

 

Function vpmKeyUp (ByVal keycode)

    On Error Resume Next

    vpmKeyUp = True ' Assume we handle the key

    With Controller

    If Keycode = MechanicalTilt Then vpmTimer.PulseSw vpmNudge.TiltSwitch                                                                  <<<<<<<<<<<<<<HERE

    If keycode = RightFlipperKey Then.Switch (swLRFlip) = False : If cSingleRFlip Or Err Then .Switch(swURFlip) = False

 

 

I was trying to find a way to modify the core.vbs or by adding GlobalPlugIn.vbs and adding a function that would then be called by all the table scripts. Since the tables handle keys different ways, it's impossible to add that vpmKeyUp function in the core.vbs script. I'm not familiar enough with programming to come up with a better solution but.... I know the majority of the people don't have cabinets for their virtual machine and the ones that do probably don't care about a real plumb bob. but I'm surprised this wasn't written in as an option somewhere.  If anyone has a more elegant solution please let me know.

 

and yes you can either rename the script called NudgePlugIn_blur2NoAccel to NudgePlugIn or just copy the appropriate parts over to core.vbs and comment out the rest.

 

as far the EM tables, from what I have seen all the tilt's subs are named something different so there is no fix one solution as far as I know.

 

example this is what I did with flying carpet

added a subroutine

 

Sub mechTilt

' If Tilttimer.Enabled = True Then

'  TiltSens = TiltSens + 1                                       

'  if TiltSens = 1 Then                                            

 

Tilt = True

 

tilttxt.text = "TILT"

if B2SOn Then Controller.B2SSetTilt 33,1

If B2SOn Then Controller.B2SSetdata 1, 0

playsound "Tilt"

turnoff

'  End if

'  Else

'  TiltSens = 0                                                       

'  Tilttimer.Enabled = True                                     

'  End If                                                                 

end Sub

 

**** Then I added a statement calling the sub under another sub

Sub Flying_Carpet_Keydown(ByVal keycode)   ** after this

 

If Keycode = MechanicalTilt then mechTilt  <<<  HERE

 

if you want more then a one hit tilt like a two hit uncomment out the 8 lines and adjust the "if TiltSens =  1 Then" to another number.

 

I'm sure there is a way to modify all the more current EM tables using controller.vbs but I'm still really new to VBS and programming in general.

seems like the slamtilt switch key is on almost all the tables, but not tilt.

 

maybe some day


Edited by hocuslocus, 23 May 2016 - 12:27 AM.


#38 hocuslocus

hocuslocus

    Neophyte

  • Platinum Supporter
  • 8 posts
  • Location:Houston, Texas

  • Flag: United States of America

  • Favorite Pinball: WOZ, Champion Pub, Medieval Madness

Posted 24 May 2016 - 06:42 AM

k, well I was able to get a little help modifying vbs scripts without having to go to each individual one.

this way they all get updated in 2 seconds.

I have both an .exe that will put the desired line in the correct place, and the tcl code so if you want to modify it to add something in a different place without having to go into each script you can.

 

for the .exe just open the folder where your table scripts are and add this in the same folder double click it and it will pop up with a white box click the X and your done. So anytime in the future they update the table scripts just run the .exe again. it will add the line

If Keycode = MechanicalTilt Then vpmTimer.PulseSW vpmNudge.TiltSwitch

in the correct place in all the script with matching characters.

 

make sure not to run it more then once it will add the line twice. not sure if that will cause any problems.

 

the tcl code you need to download tcl tk in order to use it. right click and open with word pad or what ever you use. and where it says

if {[string first "LeftFlipperKey" $line] >=0 &&

[string first "False" $line ] >=0 } {

puts $fo "       If Keycode = MechanicalTilt Then vpmTimer.PulseSw vpmNudge.TiltSwitch"

 

the first "" is where it first identify certain characters if it identifies those and the second set  ""

it will out put the line

 

If Keycode = MechanicalTilt Then vpmTimer.PulseSw vpmNudge.TiltSwitch

 

right below it.  but as you can see you can use this to change and words you wish.

just run it the same way you would the .exe add it to the same folder with the scripts you want to modify, click it, exit and your done. only difference is you have to have tcl tk in order to the the .tcl file.

 

 

https://drive.google...d1U&usp=sharing

 

why can't you  paste in this forum?



#39 wrd1972

wrd1972

    Authoring Padawan

  • Platinum Supporter
  • 2,265 posts
  • Location:Central KY. USA

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 24 May 2016 - 12:38 PM

If this is doing what I think it is doing, thanks a million for this little app. I agree that tailoring each table is a PITA and especially on the ones that tend to be revised. So just to be clear, this app is only tweaking the scripts in the script file and NOT the table scripts. Correct?


My VP Pincab /MAME Arcade  Specs: Dell T3400 workstation with Core2 Quad core 3.0GHZ (Q9650) CPU - 8GB of RAM - Nvidia  GTX 970

40" PF Sony gaming LED TV, Dual 21" Dell monitors in the backbox - Pinscape dual boards - Full DOF - Full MAME arcade support.


#40 hocuslocus

hocuslocus

    Neophyte

  • Platinum Supporter
  • 8 posts
  • Location:Houston, Texas

  • Flag: United States of America

  • Favorite Pinball: WOZ, Champion Pub, Medieval Madness

Posted 30 May 2016 - 02:12 AM

you are correct sir, the table scripts are tied to the vpt or vpx files so the only way to modify them is to open visual pinball or download the patching software (when there is a table mod).

 

Haven't had a chance to look at the bally tables to find out why they aren't working. If you find out let me know. as far as I remember, I don't think they worked even when putting that line in each of the scripts.


Edited by hocuslocus, 30 May 2016 - 02:22 AM.