Visual Pinball command Reference v0.9
by Fuzzel

This is a quick overview of all commands/variables VP knows. A lot of them haven't an effect from the script because they have an impact on the pre-rendering only.
Variables starting with a (*) can't be used from the script or don't have an effect.


TABLE
==============================================================================================================================================

Variables
---------

*Name(string) - table name
*Width(float) - Playfield width. default=1000
*Height(float) - Playfield height. default=2000
*GlassHeight(float) - Height of Glass above Playfield
*TableHeight(float)
*Inclination(float) - Angle of Table (used for Display only). default=43
*Rotation(float) - Rotation of Table (used mainly for FS/Cab tables: 270)
*Scalex(float) - X Scale of Table
*Scaley(float) - Y Scale of Table
*Xlatex(float) - X Offset of Table
*Xlatey(float) - Y Offset of Table
*Layback(float) - Skew of Table (used mainly for FS/Cab tables). default=0
*FieldOfView(float) - Perspective of Table. default=45
*MaxSeparation(float) - Maximum separation/scale effect for Stereo 3D (ranges from 0..1)
*ZPD(float) - Sets the depth where the Stereo 3D should happen (ranges from 0..1)
*PlayfieldColor(OLE_COLOR)
*BackDropColor(OLE_COLOR)
BackdropImage(string)

DMDWidth(int) - set width of DMD
DMDHeight(int) - set height of DMD
DMDPixels(VARIANT) - set array of (byte-)values (0..100), size needs to match the previously set width and height

*SlopeMax(float) - Angle of Playfield within Cabinet (used for Physics only)
*SlopeMin(float) - Angle of Playfield within Cabinet (used for Physics only)
*GlobalDifficulty(float) - Mainly chooses/weights between SlopeMax and SlopeMin, but also affects precision of flippers/scattering
Gravity(float) - default=0.86543
HardFriction(float) - default=0.0025
HardScatter(float) - default=0
*OverridePhysics(int) - overrides the table physics settings with pre defined settings defined under Preferences -> Physics Options.
                        You can define up to 8 different physics settings for the table and the flippers. Save them to one of the 8 slots and
                        by assigning the slot number to this OverridePhysics it overrides these settings. default=0 (means use table settings)

PhysicsLoopTime(int) - the meaning of this has changed starting with 9.2.1: it specifies the maximum number of iterations spent in the physics update.
                       by setting it f.e. to 1, the rendered frame updates will -always- match the physics updates, everything above 1 allows for multiple physics updates per frame
                       (2, 3 or 4 can be good values for this, as it slows down the physics temporarily if the FPS drop below 50, 33 or 25 in these cases). default=-1 (which means infinite updates allowed)
YieldTime(int) - time in milliseconds to sleep during each frame - can help side threads like vpinmame. default=0

BallImage(string) 
BallFrontDecal(string) - image of the ball front decal
BallDecalMode(bool) - switch between using the ball decal as ball logo or ball 'scratches'

*DisplayGrid(bool) - default=true
*DisplayBackdrop(bool) - displays backdrop image in editor. default=true
*Image(string) - playfield image

*EnableAntialiasing(bool) - enables AA for this table if you have set 'Enable AntiAliasing' in the video options. default=false
*EnableFXAA(bool) - enables FXAA for this table if you have set 'Enable FXAA' in the video options. default=false
*RenderEMReels(bool) - default=true						
*RenderDecals(bool) - default=true
*TableAdaptiveVSync(int) - sets adaptive vsync option for this table (-1=use global setting, 0=off, 1=automatic, any other number is refresh rate in Hz)
*BallReflection - enable ball reflection on table. depending on the global video setting 'Reflect Ball on Playfield' this is on or off. Or it is defined specific for this table.
*ReflectionStrength(int) - defines the reflection strength of the ball reflection (0-255)
*BallTrail - enable ball trail/motion blur on table. depending on the global video setting 'Ball Trail/Motion Blur' this is on or off. Or it is defined specific for this table.
*TrailStrength(int) - defines the strength of the ball trail (0-255)
*RampAccuracy(int) - defines the ramp accuracy for this table and overrides the global setting from the video options (range 0-10).

PlungerNormalize(int) - Mech-Plunger component adjustment or weak spring, aging. default=100
PlungerFilter(bool) - default=false
*Accelerometer(bool) 
*AccelNormalMount(bool)
*AccelerometerAngle(float)
*JoltAmount(int)
*TiltAmount(int)
*JoltTriggerTime(int)
*TiltTriggerTime(int)
*DeadZone(int)
*DeadSlider(int)
NudgeTime(float)

*TableSoundVolume(int) - Scales the global sound volume (in percent). default=100
*TableMusicVolume(int) - Scales the global music volume (in percent). default=100

ShowDT(bool) - Desktop mode enabled (true) or Rotated Fullscreen mode enabled (false)

*LightAmbient(OLE_COLOR) - changes the ambient light contribution for each material, please always try to keep this at full Black
*Light0Emission(OLE_COLOR) - changes the light contribution for each material (currently light0 emission is copied to light1, too)
LightEmissionScale(float)
EnvironmentEmissionScale(float)
AOScale(float) - scaling factor when blending the ambient occlusion
BloomStrength(float) - scaling factor when blurring the clipped framebuffer contribution (leave at 1 for kinda natural glow)
NightDay(int) - 0..100 value set in the UI (by the user) that defines if its night or day, so that the script can tweak table elements based on that value
*LightHeight(float) - height of lights
*LightRange(float) - range of lights

Methods
-------

Nudge(float Angle, float Force)
PlaySound(string, int loopcount, float volume, float pan, float randompitch, int pitch, bool usesame, bool restart)
FireKnocker(int Count)
QuitPlayer(int CloseType)
VPBuildVersion - deprecated
VersionMajor - major VP version number
VersionMinor - minor VP version number
VersionRevision - VP version revision
GetBalls(Ball) - returns all Balls on the table
GetElements(Editable) - returns all Elements on the table
GetElementByName(string) - returns a certain Element, based on the name

Callback
--------

OnBallBallCollision(ball1, ball2, velocity)


BUMPER
==============================================================================================================================================

Variables
---------

*Name(string)
*Radius(float) - default=45.0
*X(float) - X position
*Y(float) - Y position
Orientation(float)
UserValue(any)
*Surface(string)
Force(float)
Threshold(float)
TimerEnabled(bool)
TimerInterval(int)
*Color(OLE_COLOR)
*SideColor(OLE_COLOR)
*CastShadow(bool) - default=true
*Disabled(bool) - default=false
*CapVisible(bool) - default=true
*BaseVisible(bool) - default=true
RingSpeed


DECAL
==============================================================================================================================================

Variables
---------

*Rotation(float)
*Width(float)
*Height(float)
*X(float)
*Y(float)
*Type(DecalType) - 0=Text, 1=Image
*Image(string) - texture name
*Text(string)
*SizingType(SizingType) - 0=AutoSize, 1=AutoWidth, 2=ManualSize
*FontColor(OLE_COLOR)
*Font(IFontDisp)
*HasVerticalText(bool)
*Surface(string)


TEXTBOX
==============================================================================================================================================

BackColor
FontColor
Text
Font
Width
Height
Alignment
IsTransparent
TimerEnabled
TimerInterval
X
Y
Name
UserValue(any)


EMREEL
==============================================================================================================================================

Variables
---------

*Name(string)
Width(float)
Height(float)
*X(float)
*Y(float)
Range(float)
*BackColor(OLE_COLOR)
*Image(string) - picture name
Reels(float)
Spacing(float)
IsTransparent(bool)
Sound(string)
Steps(float)
TimerEnabled(bool)
TimerInterval(int)
UpdateInterval(int)
UserValue(any)
*UserImageGrid(bool)
ImagesPerGridRow(int)

Methods
-------

AddValue(int value)
ResetToZero()
SpinReel(int ReelNumber, int PulseCount)
SetValue(int value)


FLIPPER
==============================================================================================================================================

Variables
---------

*X(float)
*Y(float)
*BaseRadius(float)
*EndRadius(float)
*Length(float)
*StartAngle(float)
*EndAngle(float)
*FlipperRadiusMin(float)
CurrentAngle(float) - only readable

Friction(float)
RampUp(float)
Elasticity(float)
ElasticityFalloff(float)
Return(float)
*Mass(float)
*Strength(float)
OverridePhysics(int) - overrides the flipper physics settings with pre defined settings defined under Preferences -> Physics Options.
                       You can define up to 8 different physics settings for the table and the flippers. Save them to one of the 8 slots and
                       by assigning the slot number to this OverridePhysics it overrides these settings. default=0 (means use table settings)
TimerEnabled(bool)
TimerInterval(int)
*Color(OLE_COLOR)
*RubberColor(OLE_COLOR)
*RubberThickness(int)
*Visible(bool)
*Enabled(bool)
*RubberHeight(int)
*RubberWidth(int)
*Surface(string)

Methods
-------

RotateToStart()
RotateToEnd()


GATE
==============================================================================================================================================

Variables
---------

*Name(string)
*X(float)
*Y(float)
*Length(float)
*Height(float)
*Rotation(float)
TimerEnabled(bool)
TimerInterval(int)
Open(bool)
*Material(string)
Elasticity(float)
*Surface(string)
UserValue(any)
*CloseAngle(float)
*OpenAngle(float)
Collidable(bool)
Friction(float)
*Visible(bool)
ShowBracket(bool)
CurrentAngle(float) - only readable, it returns the current open angle

Methods
-------

Move(int dir, float speed, float angle) - dir(0/1)


KICKER
==============================================================================================================================================

Variables
---------

*Name(string)
*X(float)
*Y(float)
TimerEnabled(bool)
TimerInterval(int)
Enabled(bool)
*DrawStyle(KickerType) - 0=Hidden, 1=Hole, 2=Cup, 3=Invisible
*Color(OLE_COLOR)
*Surface(string)
UserValue(any)
Scatter(float)
Fall Through(bool) - if checked the ball will fall through the surface assigned to the kicker, only if the surface is higher than the playfield
HitHeight(float)
*Orientation(float)
*Radius(float)

Methods
-------

CreateBall()
CreateSizedBall(float radius)
CreateSizedBallWithMass(float radius, float mass)
DestroyBall(int ballId)
Kick(float angle, float speed, float inclination)
KickXYZ(float angle, float speed, float inclination, float x, float y, float z)
KickZ(float angle, float speed, float inclination, float heightz)
BallCntOver(int)


LIGHT
==============================================================================================================================================

Variables
---------

*Name(string)
*X(float)
*Y(float)
*Shape(Shape) - 0=Circle, 1=Custom
Falloff(float)
FalloffPower(float)
State(LightState) - 0=Off, 1=On, 2=Blinking
*Color(OLE_COLOR)
Intensity(float) - sets the lights brightness/emission
IntensityScale(float) - sets the lights brightness/emission scale, so that one can fade in/out all affected lights with the same scaling factor
TimerEnabled(bool)
TimerInterval(int)
BlinkPattern(string)
BlinkInterval(int)
*Surface(string)
UserValue(any)
*Image(string)
DepthBias(float)
FadeSpeedUp(float) - speed to fade into on state
FadeSpeedDown(float) - speed to fade into off state
Bulb(int)
ShowBulbMesh(int)
ScaleBulbMesh(float)
BulbModulateVsAdd(float) - blends between modulating and additive when bulb is enabled (0..1)


PLUNGER
==============================================================================================================================================

Variables
---------

*Name(string)
*X(float)
*Y(float)
*PullSpeed(float)
FireSpeed(float)
TimerEnabled(bool)
TimerInterval(int)
*Surface(string)
UserValue(any)
*Color(OLE_COLOR)
*Image(string) - texture name
*MeshPLunger(bool)
*AutoPlunger(bool)
*Visible(bool)
MechStrength(float)
ParkPosition(float)
Stroke(float)
ScatterVelocity(float)
BreakOverVelocity(float)

Methods
-------

Pullback()
Fire()
CreateBall(IBall **ball)
Position(int value) - added for mechanical plunger position BDS
MotionDevice(int value) - added for uShockType


PRIMITIVE
==============================================================================================================================================

Variables
---------

*Name(string)
Sides(float) - amount of sides for the old standard primitive
TopVisible(bool) - toggle visibility
TopColor(OLE_COLOR) - topColor of the old standard primitive (only valid if no image was set)
SideColor(OLE_COLOR) - sideColor of the old standard primitive (only valid if no image was set)
DrawTexturesInside(bool) - textures the inside of the old standard primitive
Image(string) - texture name
X(float) - X position
Y(float) - Y position
Z(float) - Z position
Size_X(float) - X size
Size_Y(float) - Y size
Size_Z(float) - Z size
RotAndTra0(float) or RotX(float) - rotates the primitive around it's X axis
RotAndTra1(float) or RotY(float) - rotates the primitive around it's Y axis
RotAndTra2(float) or RotZ(float) - rotates the primitive around it's Z axis
RotAndTra3(float) or TransX(float) - translates the primitive along it's X axis
RotAndTra4(float) or TransY(float) - translates the primitive along it's Y axis
RotAndTra5(float) or TransZ(float) - translates the primitive along it's Z axis
RotAndTra6(float) or ObjRotX(float) - rotates the X axis of the primitive's local coordinate system. This is used to orientate the object first, after that RotXYZ will rotate the object around this rotated coordinate system
RotAndTra7(float) or ObjRotY(float) - rotates the Y axis of the primitive's local coordinate system. This is used to orientate the object first, after that RotXYZ will rotate the object around this rotated coordinate system
RotAndTra8(float) or ObjRotZ(float) - rotates the Z axis of the primitive's local coordinate system. This is used to orientate the object first, after that RotXYZ will rotate the object around this rotated coordinate system
*EnableStaticRendering(bool) - if set the primitive is only rendered once (like walls) any dynamic changes later 
                               won't have an effect. This is useful for objects like posts or static toys, because this won't have an impact of the perfomance
HasHitEvent(bool) - enables the support for a hit event in the script (it's the same as for walls)
Threshold(float) - hit threshold for firing the hit event
Collidable(bool) - enables/disables collision detection, this can be used from within the script.
Elasticity(float)
ElasticityFalloff(float)
Friction(float) 
Scatter(float)
*IsToy(bool) - disables collision handling completely. It overwrites the Collidable-flag and can't be used from within the script. This option is useful if you have real toys
               or static primitives which are never hitable at all.


RAMP
==============================================================================================================================================

Variables
---------

*Name(string)
HeightBottom(float)
HeightTop(float)
WidthBottom(float)
WidthTop(float)
*Type(RampType) - 0=Flat, 1=4Wire, 2=2Wire, 3=3WireLeft, 4=3WireRight, 5=Wire
Image(string) - texture name
ImageAlignment(RampImageAlignment) - 0=ImageModeWorld, 1=ImageModeWrap
HasWallImage(bool) - apply image to walls
LeftWallHeight(float)
RightWallHeight(float)
UserValue(any)
*CastShadow(bool)
VisibleLeftWallHeight(float)
VisibleRightWallHeight(float)
Elasticity(float)
Collidable(bool)
Visible(bool)
Friction(float)
Scatter(float)


SPINNER
==============================================================================================================================================

Variables
---------

*Name(string)
*X(float)
*Y(float)
TimerEnabled(bool)
TimerInterval(int)
*Length(float)
*Rotation(float)
*Height(float)
*OverHang(float)
Friction(float)
Image(string)
*Material(string)
*Surface(float)
UserValue(any)
*CastShadow(bool)
*ShowBracket(bool)
*AngleMax(float)
*AngleMin(float)
Elasticity(float)
*Visible(bool)
CurrentAngle(float) - only readable

TRIGGER
==============================================================================================================================================

Variables
---------

*Name(string)
*X(float)
*Y(float)
*Radius(float)
TimerEnabled(bool)
TimerInterval(int)
*Enabled(bool)
*Visible(bool)
*TriggerShape(Shape) - 0=None, 1=Wire, 2=Star
Surface(string)
UserValue(any)
HitHeight(float)
Rotation(float)

Methods
-------

BallCntOver(int value)
DestroyBall(int ballId)


WALL
==============================================================================================================================================

Variables
---------

*Name(string)
TimerEnabled(bool)
TimerInterval(int)
*HasHitEvent(bool)
Threshold(float)
*Image(string) - texture name
*SideColor(OLE_COLOR)
*ImageAlignment(ImageAlignment) - 0=ImageAlignWorld, 1=ImageAlignTopLeft, 2=ImageAlignCenter
*HeightBottom(float)
*HeightTop(float)
*FaceColor(OLE_COLOR)
*CanDrop(bool)
Collideable(bool)
IsBottomSolid(bool)
IsDropped(bool)
*DisplayTexture(bool)
Elasticity(float)
*CastsShadow(bool)
*SideImage(string)
*Visible(bool)
Disabled(bool)
*SideVisible(bool)
UserValue(any)
*SlingshotColor(OLE_COLOR)
SlingshotThreshold(float)
*SlingshotAnimation(bool)
*FlipbookAnimation(bool)
Friction(float)
Scatter(float)

FLASHER
==============================================================================================================================================

Variables
---------

*Name(string)
TimerEnabled(bool)
TimerInterval(int)
ImageA(string) - texture name for image A
ImageB(string) - texture name for image B
Filter(string) - use one of the following filters to blend ImageA > ImageB: 'None', 'Additive', 'Multiply', 'Overlay', 'Screen' (filter names are case sensitive!)
                 this feature only works if you defined both images
Amount(int)    - defines the filter amount how much of ImageB is filtered over ImageA in percent (0..100, can be set to >100 though)
Mode           - 0=ImageModeWorld, 1=ImageModeWrap
*DisplayTexture(bool)
Opacity(int) - lets you define the blend amount 0..100% (you can use values >100% though to for example enhance the strength of flashers in additive alpha blending mode)
IntensityScale(float) - sets the flashers brightness/emission scale, so that one can fade in/out all affected flashers with the same scaling factor
Color - defines the color of the element in the editor. If you don't want to colorize the image set the color to blank white (RGB 255,255,255)
Visible(bool) - shows/hides the flasher
AddBlend(bool) - use additive alpha blending instead of classical alpha blending
ImageAlignment
ModulateVsAdd(float) - blends between modulating and additive when bulb is enabled (0..1)

BALL
==============================================================================================================================================

Variables
---------

Color(OLE_COLOR) - sets color of ball
Mass(float)
Radius(float)
X(float)
Y(float)
Z(float)
VelX(float)
VelY(float)
VelZ(float)
Image(string)

RUBBER
==============================================================================================================================================

Variables
---------
*Name(string)
*HasHitEvent(bool)
*Thickness(int)
*Collidable(bool)
*Material(string)
Visible(bool)
*EnableStaticRendering(bool) - if set the rubber is only rendered once (like walls) any dynamic changes later 
                               won't have an effect. This is useful for static rubbers like rubbers on posts. 
Image(string) - texture name
Elasticity(float)
ElasticityFalloff(float)
Friction(float)
Scatter(float)
RotX(float)                 - angle to rotate the whole rubber around the X axis (inclination)
RotY(float)                 - angle to rotate the whole rubber around the Y axis (skew)

