Visual Pinball 9 command Reference v0.2
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 changed by the script (most can be read though) or don't have an effect.


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

Variables
---------

*Name(string) - table name
*FileName(string) - file name (without path and extension)
*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)

*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
MaxBallSpeed(float) - default=60.0
DampingFriction(float) - default=0.95
*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
BallBackDecal(string) - image of the ball back decal

*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
*RenderShadows(bool) - default=true
*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)
*AlphaRampAccuracy(int) - defines the alpha 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)
*AccelerometerAmp(float)
*AccelerManualAmp(float)
*JoltAmount(int)
*TiltAmount(int)
*JoltTriggerTime(int)
*TiltTriggerTime(int)
*DeadZone(int)
*DeadSlider(int)

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

*Light0Ambient(OLE_COLOR) - changes the ambient color contribution for each material from light0
*Light0Diffuse(OLE_COLOR) - changes the diffuse color contribution for each material from light0
*Light0Specular(OLE_COLOR) - changes the specular color contribution for each material from light0
*Light0PX(float) - X position of light0 (PXPYPZ and DXDYDZ being both 0,0,0 means to use the old defaults of VP) 
*Light0PY(float) - Y position of light0 (PX and PY are relative to the playfield width and height)
*Light0PZ(float) - Z position of light0 (PZ varies the height of the light)
*Light0DX(float) - X direction of light0 (only valid if Light0Type is 0 or 1 (directional)) (DXDYDZ being 0,0,-1 means that the light shines directly from above)
*Light0DY(float) - Y direction of light0 (only valid if Light0Type is 0 or 1 (directional))
*Light0DZ(float) - Z direction of light0 (only valid if Light0Type is 0 or 1 (directional))
*Light0Type(int) - 0=directional, 1=spot, 2=point
*Light1Ambient(OLE_COLOR) - changes the ambient color contribution for each material from light1
*Light1Diffuse(OLE_COLOR) - changes the diffuse color contribution for each material from light1
*Light1Specular(OLE_COLOR) - changes the specular color contribution for each material from light1
*Light1PX(float) - X position of light1 (PXPYPZ and DXDYDZ being both 0,0,0 means to use the old defaults of VP)
*Light1PY(float) - Y position of light1 (PX and PY are relative to the playfield width and height)
*Light1PZ(float) - Z position of light1 (PZ varies the height of the light)
*Light1DX(float) - X direction of light1 (only valid if Light1Type is 0 or 1 (directional)) (DXDYDZ being 0,0,-1 means that the light shines directly from above)
*Light1DY(float) - Y direction of light1 (only valid if Light1Type is 0 or 1 (directional))
*Light1DZ(float) - Z direction of light1 (only valid if Light1Type is 0 or 1 (directional))
*Light1Type(int) - 0=directional, 1=spot, 2=point
*NormalizeNormals(int) - Exact lighting on dynamic objects (try on your table on/off and see if the change is dramatic, if it is then better enable it). default=0
*ShadowX(float) - defines the shadow X direction (-1.0..+1.0) default=0.0, because the shadow generation is a fake this is not 100% accurate (if X and Y are both zero one can have an ambient occlusion like effect)
*ShadowY(float) - defines the shadow Y direction (-1.0..+1.0) default=0.0, because the shadow generation is a fake this is not 100% accurate

Methods
-------

Nudge(float Angle, float Force)
StartShake()
StopShake()
PlaySound(string, int loopcount, float volume, float pan, float randompitch, int pitch, bool usesame, bool restart)
FireKnocker(int Count)
QuitPlayer(int CloseType)
Version(int) - returns the Visual Pinball version number (i.e. 9.2.0: 9200)
VersionMajor - major VP version number
VersionMinor - minor VP version number
VersionRevision - VP version revision


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

Variables
---------

*Name(string)
*Radius(float) - default=45.0
*X(float) - X position
*Y(float) - Y position
State(LightState) - 0=Off, 1=On, 2=Blinking
BlinkPattern(string) - default=10
BlinkInterval(int) - default=125 milliseconds
FlashWhenHit(bool) - default=true
UserValue(any)
*Surface(string)
Force(float)
Threshold(float)
TimerEnabled(bool)
TimerInterval(int)
*Overhang(float) - default=25
*Color(OLE_COLOR)
*SideColor(OLE_COLOR)
*Image(string) - texture name
*CastShadow(bool) - default=true
*Disabled(bool) - default=false
*Visible(bool) - default=true
*SideVisible(bool) - default=true


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)


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

Variables
---------

*Name(string)
Width(float)
Height(float)
*X(float)
*Y(float)
*Type(ReelType) - 0=Text, 1=Image
Range(float)
*BackColor(OLE_COLOR)
*Image(string) - picture name
*FontColor(OLE_COLOR)
*ReelColor(OLE_COLOR)
Font(IFontDisp)
Reels(float)
Spacing(float)
IsTransparent(bool)
Sound(string)
Steps(float)
IsShading(bool)
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

Mass(float)
PowerLaw(float)
*ObliqueCorrection(float)
ScatterAngle(float)
Elasticity(float)
Recoil(float)
Return(float)
*Speed(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)
*ImageFront(string)
*ImageBack(string)
*Color(OLE_COLOR)
Elasticity(float)
*Surface(string)
UserValue(any)
*CloseAngle(float)
*OpenAngle(float)
Collidable(bool)
Friction(float)
Animations(int)
*Visible(bool)
Supports(bool)
*EnableLighting(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)
HitHeight(float)

Methods
-------

CreateBall(IBall **ball)
CreateSizedBall(IBall **ball)
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
*Radius(float)
State(LightState) - 0=Off, 1=On, 2=Blinking
*Color(OLE_COLOR)
TimerEnabled(bool)
TimerInterval(int)
BlinkPattern(string)
BlinkInterval(int)
*BorderColor(OLE_COLOR)
*BorderWidth(float)
*Surface(string)
UserValue(any)
*OffImage(string)
*OnImage(string)
*EnableOffLighting(bool) - defines if the off image/shape should be shaded or not
*EnableOnLighting(bool) - defines if the on image/shape should be shaded or not
*OnImageIsLightmap(int) - if set to 1 the on image is used as a add. alpha blend image, this works only on custom light shapes


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

Variables
---------

*Name(string)
*X(float)
*Y(float)
*PullSpeed(float)
FireSpeed(float)
TimerEnabled(bool)
TimerInterval(int)
*Surface(string)
UserValue(any)
*Type(PlungerType) - 0=Original, 1=Modern
*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
AxisScaleX_Y(float) - scale X-Y axis
AxisScaleX_Z(float) - scale X-Z axis
AxisScaleY_X(float) - scale Y-X axis
AxisScaleY_Z(float) - scale Y-Z axis
AxisScaleZ_X(float) - scale Z-X axis
AxisScaleZ_Y(float) - scale Z-Y axis
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
EnableLighting(bool) - enable/disable lighting for this primitive. You should use the table lights 0/1 to get best results
*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
EnableSphereMapping(bool) - enable/disable sphere mapping/environment mapping (useful for faking good looking reflections).
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.
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)
Color(OLE_COLOR)
*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)
*Solid(bool) - standard solid ramp mode
*Acrylic(bool) - deprecated acrylic ramp mode, please use alpha instead
Alpha(bool) - alpha ramp mode, switches ramp from static to dynamic rendering (that also allows for full transparency control)
UserValue(bool)
*CastShadow(bool)
VisibleLeftWallHeight(float)
VisibleRightWallHeight(float)
Elasticity(float)
Collidable(bool)
IsVisible(bool)
Friction(float)
Scatter(float)
Modify3DStereo(bool) - modifies the depth buffer, which can look confusing if the ramp is used for 2D flasher or GI effects, etc and the Stereo 3D rendering is used, thus it should be disabled for flashers, GI, etc
AddBlend(bool) - use additive blending instead of classical alpha blending
EnableLightingImage(bool) - defines if the image/ramp should be shaded or not


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

Variables
---------

*Name(string)
*X(float)
*Y(float)
TimerEnabled(bool)
TimerInterval(int)
*Length(float)
*Rotation(float)
*Height(float)
*OverHang(float)
Friction(float)
*ImageFront(string)
*ImageBack(string)
*Color(OLE_COLOR)
*Surface(float)
UserValue(any)
*CastShadow(bool)
*Supports(bool)
*AngleMax(float)
*AngleMin(float)
Elasticity(float)
*Animations(int)
*Visible(bool)
CurrentAngle(float) - only readable

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

Variables
---------

*Name(string)
*X(float)
*Y(float)
*Radius(float)
TimerEnabled(bool)
TimerInterval(int)
*Enabled(bool)
*Visible(bool)
*Shape(Shape) - 0=Circle, 1=Custom
Surface(string)
UserValue(any)
HitHeight(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)
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)
*EnableLighting(bool) - defines if the image/wall should be shaded or not

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

Variables
---------

*Name(string)
TimerEnabled(bool)
TimerInterval(int)
Image(string) - texture name
*DisplayTexture(bool)
Alpha - lets you define an alpha factor(0..255) for additive alpha blending and it only works on flashers which 'Additive Alpha Bl.' checked or setting AddBlend(TRUE)
Color - defines the color of the element in the editor. If 'Additive Alpha Bl.' isn't checked this will colorize the image too. If you don't want to colorize the image set the color to 
        blank white (RGB 255,255,255)
IsVisible(bool) - shows/hides the flasher
AddBlend(bool) - use additive alpha blending instead of classical alpha blending

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

Variables
---------

DisableLighting(bool) - enables/disables lighting of the ball
Color(OLE_COLOR) - if lighting disabled, sets color of ball
