Jump to content



Photo
- - - - -

Tweak Menu - where's the documentation or how-to?


  • Please log in to reply
7 replies to this topic

#1 Ltek

Ltek

    Enthusiast

  • Members
  • PipPipPip
  • 126 posts

  • Flag: United States of America

  • Favorite Pinball: Volkan, Bounty Hunter, IT, Tron Classic, Harry Potter, Iron Man, Avengers LE, Dragon's Lair

Posted 21 April 2024 - 06:53 PM

I've searched all over but cannot find any docs or how-to on creating a tweak menu to add to a legacy table
 
I'm very new and spent a ton of time learning to do some table mods. I've looked at several tables with Tweak Menus but cant figure out thing much of anything. For instance...
 
What are the script/code prereqs?
Does the .option method only render the menu or does it also read and then save the entries to the INI automatically?
etc
 
thx


#2 Mike DA Spike

Mike DA Spike

    Pinball Fan

  • Platinum Supporter
  • 1,201 posts
  • Location:Hoofddorp

  • Flag: Netherlands

  • Favorite Pinball: Too many to mention

Posted 23 April 2024 - 05:20 PM

Not sure what you mean with legace table, bit the tweak menu is in vpx 10.8 a new feature.
I checked it myself (little reverse engineering) and the .options read and write values.

There small documentation on the vp github page

Not sure if yo uwant to know, but found documentation about the new f12 menu option : https://github.com/v...erence.md#table

> Arguments are: option name, minimum value, maximum value, step between valid values, default value, unit (0=None, 1=Percent), an optional arry of literal strings

331ddabcc742f0ba74791e946eb0f791.gif Try PinballX Database manager as a replacement of PinballX's game list manager
With special thanks to Scutters 


#3 unclewilly

unclewilly

    sofa king.....

  • VIP
  • 5,083 posts
  • Location:Baltimore, Maryland

  • Flag: United States of America

  • Favorite Pinball: tz, tom, big hurt, who dunnit



Posted 23 April 2024 - 08:42 PM

Look at robot invasion. Just search options in the script

"it will all be ok in the end, if it's not ok, it's not the end"
 
Monster Bash VP10 WIP https://dl.dropboxus... (vpx)WIP15.vpx

uw2.gif


#4 Wizball

Wizball

    Enthusiast

  • Members
  • PipPipPip
  • 178 posts

  • Flag: ---------

  • Favorite Pinball: Tales of the Arabian Nights

Posted 23 April 2024 - 08:58 PM

VPX handles all the reading and writing of the ini file when options are changed in the tweak menu.

From the script side, reading an option with the option menu will automatically create it in the tweak menu with its default value.

When the player changes an option in the tweak menu, VPX will call the Table1_OptionEvent function.

 

example:

Dim volumeDial ' A variable that the Table1_OptionEvent updates
Dim stagedFlippers ' A variable that the Table1_OptionEvent updates

' Called when options are tweaked by the player. 
' - 0: game has started, good time to load options and adjust accordingly
' - 1: an option has changed
' - 2: options have been reset
' - 3: player closed the tweak UI, good time to update staticly prerendered parts
' Table1.Option arguments are: 
' - option name, minimum value, maximum value, step between valid values, default value, unit (0=None, 1=Percent), an optional arry of literal strings
Sub Table1_OptionEvent(ByVal eventId)
' A volume setting:
' Minimum value: 0
' Maximum value: 1
' Change by 0.01 (1%) at a time in the tweak menu
' Default of 0.8 (80%)
' Unit is a percentage
' No text for options
    volumeDial = Table1.Option("Mechanical Volume", 0, 1, 0.01, 0.8, 1)
' A setting with one of a set of options:
' Minimum value: 0 (first option, "Normal")
' Maximum value: 1 (second option, "Staged")
' Change by 1 step at a time in the tweak menu
' Default 0 (first option)
' Unit is NOT a percentage
' Options have text "Normal" and "Staged" in the UI
    stagedFlippers = Table1.Option("Staged Flippers", 0, 1, 1, 0, 0, Array("Normal", "Staged"))
End Sub

 



#5 Fusionwerks

Fusionwerks

    Poorly recovering pinball addict

  • Platinum Supporter
  • 347 posts

  • Flag: United States of America

  • Favorite Pinball: JP (DE), Elvira's HoH, ToM

Posted 23 April 2024 - 09:52 PM

I have been looking for this!

so if you set up an option for example: adjust outlane post positions (easy, medium, hard) i assume the player has to restart the table to take effect?



#6 Wizball

Wizball

    Enthusiast

  • Members
  • PipPipPip
  • 178 posts

  • Flag: ---------

  • Favorite Pinball: Tales of the Arabian Nights

Posted 23 April 2024 - 10:05 PM

I have been looking for this!

so if you set up an option for example: adjust outlane post positions (easy, medium, hard) i assume the player has to restart the table to take effect?

You should be able to use the Table1_OptionEvent function to update the posts when the option is changed. Just make sure that the post visuals aren't rendered statically.



#7 Ltek

Ltek

    Enthusiast

  • Members
  • PipPipPip
  • 126 posts

  • Flag: United States of America

  • Favorite Pinball: Volkan, Bounty Hunter, IT, Tron Classic, Harry Potter, Iron Man, Avengers LE, Dragon's Lair

Posted 29 April 2024 - 06:02 PM

thanks all... Wiz, your example is super helpful!



#8 Ltek

Ltek

    Enthusiast

  • Members
  • PipPipPip
  • 126 posts

  • Flag: United States of America

  • Favorite Pinball: Volkan, Bounty Hunter, IT, Tron Classic, Harry Potter, Iron Man, Avengers LE, Dragon's Lair

Posted 30 April 2024 - 10:43 PM

wizball & unclewilly

 

Separate question... I was using Flipper/Magna buttons to change some settings (before play starts) and I'd like to keep those... its far easier to make quick changes with them on things like colors and get immediate visuals on them. SOOO the question... How can I set read/set those INI values/variables using the flipper/magna keycode subs I already have working?

 

*example*

 

Option Menu code...  BallTrailGlowSetting = Table1.Option("Trail Glow", 0, 10, 1, 5, 0)

 

With magna button I want to set BallTrailGlowSetting and have the setting/selection saved to the INI

 

thx for the help!!!


Edited by Ltek, Yesterday, 03:14 AM.