BasicGame - Visual Pinball Script

BasicGame-PinGod.vbs

A script with the same name is included with the table. This will be used with the visual pinball script editor.

This can make it easier to edit outside of table, keep track of changes etc. At the top of this image it shows MODIFYING EXTERNAL.


PinGod.VP.Controller


The first section marked in red is the PinGod.VP.Controller initialization.

image image


Game Project Location


When debugging, if the games Godot project is relative to the table (the same as this repo), then you won’t have to adjust the script for the GameDirectory.

But if you need to, you can change the default Const GameDirectory = "..\BasicGameGodot" to:

Const GameDirectory = "C:\Yourfilepath\BasicGameGodot"

image image

Variabledoes what?
IsDebugSet controller in debug launch project directories
GameDirectoryGame Project to launch, see above
UseSolenoidsSet controller to check for states
UsePdbLedsPROC led states. This project is set to leds for the ball save light
UseLampsUse lamps or leds, or both

Variables declared for table objects. Dim bsTrough, bsSaucer


Table Events


Getting the controller to act on some table events. Stopping the game window and pause / resume

image image


Table Init


Visual pinball Table1_Init controller is Run, how it is run depends on the IsDebug flag set.


Init game


This sub routine is much like a PinMame game setup and we use core_c_sharp.vbs which is pretty much the core.vbs.

  • vpmMapLights AllLamps This runs updated lamps from this collection. The lamp number is in the VP Light objects TimerInterval
  • vpmCreateEvents AllSwitches This runs updated switches from this collection. The switch number is set inside the VP Triggers TimerInterval variable
  • PinMame timers enabled
  • Create Ball Trough set to bsTrough
  • Create Auto Plunger set to plungerIM
  • Create Kicker set to bsSaucer
  • Set vpm nudging

image image


Keyboard


Both Table1_Key routines use a check if Controller.GameRunning = 0 then Exit Sub 'exit because no display is available


Solenoids Callbacks


Callbackdoes what?
PinGodAliveif you need to know if the pingod window is alive
bsTrough.solOutEvent for the trough we created. Kick the ball
bsSaucer.solOutEvent for the kicker on the table
FlippersEnabledenable/disble flippers
AutoPlungerInvokes PlungerIM.AutoFire
Lampshow1Runs a light sequence
DisableLampShowsStopPlay light sequence

image image


Display settings


Display can be adjusted by using F2 on the window, move and resize and save the position.

.DisplayX = 1920 - 512
.DisplayY = 10
.DisplayWidth = 512 ' 1024 FS
.DisplayHeight = 300 ' 600  FS
.DisplayAlwaysOnTop = True
.DisplayFullScreen = False 'Providing the position is on another display it should fullscreen to window
.DisplayLowDpi 	= False
.DisplayNoWindow = False

Default Machine Switches


These are used by Visual Pinball common switches which are mapped to keyboard. From PinGod.VP/scripts/PinGod.vbs

Cabinet switches
Const swCoin1  = 0
Const swCoin2  = 1
Const swCoin3  = 2
Const swCoin4  = 3
Const swCancel = 4
Const swDown   = 5
Const swUp     = 6
Const swEnter  = 7
Const swCoinDoor  = 8
Const swLLFlip = 9
Const swLRFlip = 11
Const swULFlip = 13
Const swURFlip = 15
Const swSlamTilt = 16
Const swTilt = 17
Const swStartButton = 19

Script Notes / Guide


  • Switch events can be sent with Controller.Switch 20, 1. Usually this is Controller.Switch(20) = 1.