Jump to content



Photo
- - - - -

Any Guides out there that covers the basics of scripting?

script scripting help

  • Please log in to reply
5 replies to this topic

#1 DOOMSKERKE

DOOMSKERKE

    Neophyte

  • Members
  • Pip
  • 4 posts

  • Flag: Belgium

  • Favorite Pinball: anyone thats on freeplay

Posted 03 October 2022 - 12:50 PM

So i recently started messing around with the table maker, and i wonder if theres any tutorials on the basics of scripting

like how do i set a timer after a trigger/gate is hit for a light and its duration its on?

how to empliment a scorereel/DMD and how to add scoring to a game.
 

or tables where i can look around in the code to reverse engineer the scripting to learn the mechanics of it

i hardly found any tutorials online for that side of VPX
 



#2 bigus1

bigus1

    Pinball Fan

  • Members
  • PipPipPipPip
  • 989 posts
  • Location:Brisbane, Australia

  • Flag: Australia

  • Favorite Pinball: Firepower

Posted 03 October 2022 - 01:28 PM

This is how to turn a light on and off when something is hit.

 

Sub Wall3_Hit: light4.Duration 1, 1250, 0 : End Sub      

 

The light4 in this case will stay on for 1250ms.  (1=state, 1250=ms, 0=state)

 

DMD is built-in for ROM tables. Check-out the example tables for code examples.


 

 



#3 xenonph

xenonph

    I have Pinball Fever!

  • VIP
  • 4,136 posts
  • Location:Castle Rock, WA.

  • Flag: United States of America

  • Favorite Pinball: TRON Classic-Congo-Xenon-PINBOT-BOP-LOTR-A Real American Hero OPERATION PINBALL-Millionaire-Whirlwind-Krull-NFL-BlackKnight-FishTales

Contributor

Posted 04 October 2022 - 03:06 PM

Look in your Visual Pinball folder, and you will find a Doc folder.

Inside your Doc folder you will find a Command Reference.txt that shows all of the script commands and methods of using them.


CHECK OUT THIS TUTORIAL http://www.vpforums....howtopic=32515
TO USE DB2S BACKGLASS PROGRAM WITH DESKTOP TABLES ON 1 MONITOR
 

#4 malform11

malform11

    Enthusiast

  • Members
  • PipPipPip
  • 104 posts
  • Location:dallas texas

  • Flag: United States of America

  • Favorite Pinball: TALES OF THE ARABIAN NIGHTS

Posted 11 October 2022 - 04:36 AM

Sub Wall3_Hit: light4.Duration 1, 1250, 0 : End Sub   

is how you code for an existing table that refers to an existing ROM.

 

If you want to make an original table, there are no real guides.

 

I took a year to learn VP. After much work I devised code to run a Virtual Pinball game. I uploaded "Pin City" with much of the code. I took another two years to improve the code.

The code is very modular. It is easy, intuitive. With just a few changes one can code a completely different table. No one thought about coding a table the way I did, and it is perfect for quickly and easily creating new games.

 

Problem is I don't want to give away the improved code. I have a much-improved version of "Pin City" myself, sorry that I won't upload it. The first version should get you started.



#5 bigus1

bigus1

    Pinball Fan

  • Members
  • PipPipPipPip
  • 989 posts
  • Location:Brisbane, Australia

  • Flag: Australia

  • Favorite Pinball: Firepower

Posted 11 October 2022 - 05:34 AM

That code doesn't have anything to do with roms.



#6 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,871 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 11 October 2022 - 10:25 AM

Sub Wall3_Hit: light4.Duration 1, 1250, 0 : End Sub   

is how you code for an existing table that refers to an existing ROM.

 

 

 

no, you code very little in that aspect for a ROM driven table

you dont tell what lights come on, the rom tells you

you just set the vpm lamp id in the lights timer tab in the interval box

add them to a collection you can call aLights

 then in your script 

 

vpmMapLights ALights ' ROM controlled lamps

and the rom controls them, provided you set their id's correctly

 

other stuff looks like this

if it interacts with the rom, then you are simply passing messages to the rom

 

Sub Bumper1_Hit:vpmtimer.pulsesw(18):End Sub
Sub Bumper2_Hit:vpmtimer.pulsesw(17):End Sub
 
Sub RSling_slingshot:vpmtimer.pulsesw(19):End Sub
Sub LSling_slingshot:vpmtimer.pulsesw(20):End Sub
 
Sub RSpinner_spin:vpmtimer.pulsesw(33):End Sub
Sub LSpinner_spin:vpmtimer.pulsesw(34):End Sub
 
Sub Target_C25_hit:vpmtimer.pulsesw(49):End Sub
Sub Target_C26_hit:vpmtimer.pulsesw(50):End Sub
Sub Target_C27_hit:vpmtimer.pulsesw(51):End Sub
Sub Target_C28_hit:vpmtimer.pulsesw(52):End Sub
Sub Target_C29_hit:vpmtimer.pulsesw(53):End Sub
Sub Target_C30_hit:vpmtimer.pulsesw(54):End Sub
 
Sub C21_Hit:Controller.Switch(43) = 1:End Sub
Sub C21_Unhit:Controller.Switch(43) = 0:End Sub
 
 
and if the rom is talking back to you, via solenoids
then you have solenoid callbacks
 
SolCallback(20) = "b19_sol" ' ejects ball from kicker in lower PF bonus pocket when C42(70) is closed
SolCallback(16)="bsHole2.SolOut"
SolCallback(17)="TopHoleOut_Right"
SolCallback(18)="TopHoleOut_Left"
SolCallback(14)="DropTargetBank1.SolDropUp" 'b13
SolCallback(13)="DropTargetBank2.SolDropUp" 'b12
SolCallback(15)="DropTargetBank3.SolDropUp" 'b14
 
 
 
Sub b19_sol(Enabled) 'BallRelease
If Enabled Then
OutHole.kick 70, 15
controller.Switch(6)=0
End If
end sub

If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways

Spend it on Hookers and Blow






Also tagged with one or more of these keywords: script, scripting, help