VPX Documentation
Primitive
3min
variables variables are items in vpx you can set, adjust or call call detail example 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 normalmap(string) normal map 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, metal ramps, or static toys, because this won't have an impact of the perfomance static objects are also rendered in higher quality than dynamic ones not adjustable by script 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 hitthreshold(float) holds the current hit threshold if a ball has hit the primitive collidable(bool) enables/disables collision detection, this can be used from within the script elasticity(float) elasticityfalloff(float) friction(float) 0 1 scatter(float) istoy(bool) this option should always be set if the primitive will never be collideable it disables collision handling and all physics preprocessing completely it overwrites the collidable flag and can't be used from within the script useful if you have real toys or static primitives which are never hitable at all and are just there for the 'looks' if collideable is false with while toy is false, vpx still calculates the collision mapping in case it is later changed by script, which impacts table start performance reflectionenabled(bool) default=true disablelighting(bool) blenddisablelighting(float) 0 1, same as disablelighting, but can blend between the two extremes blenddisablelightingfrombelow(float) 0 1, similar to disablelighting, but will block light coming from below (e g from light elements) backfacesenabled(bool) default=false, if enabled will also show/render the backfacing triangles (if a transparent material is used) uservalue(any) can store any user defined value for re use later on the following only applies to mesh primitives with an animation sequence playanim(float startframe, float speed) start playing the sequence from 'startframe' til the end with frame rate 'speed' playanimendless(float speed) start playing the sequence in a loop with frame rate 'speed' stopanim() stop the animation continueanim(float speed) continue a stopped animation with frame rate 'speed' showframe(float framenr) show the mesh at frame 'framenr', where 'framenr' can also be a fractional frame number like 1 23 vp will interpolate between subframes events event detail example init ( timer) currently disabled hit dispinterface iprimitiveevents { properties methods \[id(dispid gameevents init)] void init(); // \[id(dispid timerevents timer)] void timer(); \[id(dispid hitevents hit)] void hit(); }