Skip to content

Commit

Permalink
Add B2STools/B2SRandom.cmd to randomize many Backglasses when activat…
Browse files Browse the repository at this point in the history
…ed in Pinup Popper or similar
  • Loading branch information
JockeJarre committed Apr 7, 2024
1 parent f006180 commit 438d2fc
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
33 changes: 33 additions & 0 deletions B2STools/B2SRandom.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@echo off
REM ___ ___ ___
REM | _ )_ ) __|
REM | _ \/ /\__ \
REM |___/___|___/ Random
REM
REM This script can be used to randomize different backglasses before starting Visual Pinball
REM
REM To activate it, add the following line in the Popper Launch script
REM CALL C:\vPinball\B2SServer\B2STools\B2SRandom.cmd "[GAMEFULLNAME]"
REM
REM If you start a table "table.vpx" in the folder "D:\vPinball\VisualPinball\Tables\" it will try to find
REM D:\vPinball\VisualPinball\Tables\table-#.directb2s where # is a random number.
REM If it is found, the file D:\vPinball\VisualPinball\Tables\table-#.directb2s is copied over D:\vPinball\VisualPinball\Tables\table.directb2s

REM Extract path + name without extension
set b2sfullname=%~dpn1

REM Uncomment following line to log how this script was called.
REM echo %0 %* >> %0.log

REM Count the amount of b2sfullname-?.directb2s alt directb2s files there is.
for /F %%i in ('dir /A:-D /B "%b2sfullname%-?.directb2s" 2^>nul ^| find /c /v ""') do set COUNT=%%i

REM Step out if there is no alt directb2s files available
if %COUNT% == 0 goto :EOF

REM Generate random number between 1 and the %COUNT%
set /a num=%random% %%%COUNT% + 1

if not exist "%b2sfullname%-%num%.directb2s" goto :EOF

copy /Y "%b2sfullname%-%num%.directb2s" "%b2sfullname%.directb2s"
15 changes: 14 additions & 1 deletion B2STools/B2STools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
| _ \/ /\__ \ | |/ _ \/ _ \ (_-<
|___/___|___/ |_|\___/\___/_/__/

- directb2sReelSoundsONOFF.cmd

Older pinball machines used reels to display scores on the screen. B2S Server has built-in sounds for the reel movements. Some table authors do not like these sounds and want to control them from the table instead.

Expand All @@ -11,4 +12,16 @@ What it technically does is add some "Sound1-6" attributes to the Score tags in

<Score Parent="Backglass" ID="1" B2SStartDigit="0" Digits="5" Spacing="100" Sound1="" Sound2="" Sound3="" />

This will tell the B2S Server to keep quiet for these reels.
This will tell the B2S Server to keep quiet for these reels.

- B2SRandom.cmd

B2SRandom can be used to randomize different backglasses before starting Visual Pinball

To activate it, add the following line in the Popper Launch script

CALL C:\vPinball\B2SServer\B2STools\B2SRandom.cmd "[GAMEFULLNAME]"

If you start a table "table.vpx" in the folder "D:\vPinball\VisualPinball\Tables\" it will try to find
D:\vPinball\VisualPinball\Tables\table-#.directb2s where # is a random number.
If it is found, the file D:\vPinball\VisualPinball\Tables\table-#.directb2s is copied over D:\vPinball\VisualPinball\Tables\table.directb2s
14 changes: 14 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
2.1.1

- Add B2STools/B2SRandom.cmd to randomize many Backglasses when activated in Pinup Popper or similar
- Backglasses using overlapping partly transparent pictures get it's events merged. This is now deactivated by default.
Can be activated in the direct2BS file (there is NO GUI): <MergeBulbs Value="1" />
- Add support for PWM modified tables, the light turn on values > 64, if it is a PWM activated table:
There is a new setting for VPinMame.SolMask(2) to set the output mode:
0 = default
1 = modulated (PWM) solenoid (exist for some years already)
2 = new PWM mode (all solenoids but also lamps, and value if physic meaning, not smoothed out binary state)
For this new mode, we now hardcode a value 64, if the lamp intensity exceed this value, it is binary 1
- b2s_screenresidentifier: Add Comments hidded behind the taskbar #77

2.1.0

- There was an issue with certain rollover lights all turning on at the same time.
Thanks to jejevpuniverse, Hauntfreaks and Cliffy we solved solved this problem.
- Small problem with B2SWindowPunch fixed (B2SInit.bat had problems)
Expand Down

0 comments on commit 438d2fc

Please sign in to comment.