Jump to content



Photo
- - - - -

Coding the script

code script

  • Please log in to reply
15 replies to this topic

#1 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 23 October 2023 - 05:08 PM

Hi, is there an instruction manual for learn how to write code for the script?

 

Thanks.



#2 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 23 October 2023 - 06:26 PM

The 5 Visual Pinmame tutorials are good for understanding how rom table are scripted

https://www.vpforums...hp?showforum=27

#3 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 24 October 2023 - 01:52 PM

Thanks, but is there a documentation with every command? Something as java doc.



#4 jpsalas

jpsalas

    Grand Schtroumpf

  • VIP
  • 7,315 posts
  • Location:I'm Spanish, but I live in Oslo (Norway)

  • Flag: Norway

  • Favorite Pinball: I like both new and old, but I guess I prefer modern tables with some rules and goals to achieve.



Posted 24 October 2023 - 01:57 PM

Take a look at the file vbsdoc_outdated.html which is the explanations of the calls to the core.vbs. Even if it is called "outdated" it is very very useful. 

 

Also take a look at the CommandReference.txt for all the extra vbscript commands VPX understands.

 

The files are available in the vpx zip file.


If you want to check my latest uploads then click on the image below:

 

vp.jpg

 

Next table? A tribute table to Stern's Foo Fighters


#5 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 25 October 2023 - 09:51 PM

Thanks. But let me to say, it is not so good.

Anyway, let me to know if I've understood one thing.

 

In the script there are only sub.

These sub are called when an event happens (i.e. a target is hit)

So, with the sub we can manage, the sound, the score and the rules of the game.

Am I correct?

 

If I am, which is the file where these sub are called?

 

Thanks.


Edited by boriskarloff, 25 October 2023 - 10:56 PM.


#6 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,670 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 26 October 2023 - 12:16 PM

Thanks. But let me to say, it is not so good.

Anyway, let me to know if I've understood one thing.

 

In the script there are only sub.

These sub are called when an event happens (i.e. a target is hit)

So, with the sub we can manage, the sound, the score and the rules of the game.

Am I correct?

 

If I am, which is the file where these sub are called?

 

Thanks.

They could be files located in a specific folder, but generally they almost never are,

Images and sounds are imported within VP into the Image and Sound Manager.

 

In the case of VPinMame tables the scripts connect the mechanical and electrical part created in the VP editor with the ROM,

acting as an interface between VP and the emulator,

the ROM manages sound effects, scores, rules, display/DMD, lights, flippers, solenoids...

 

Instead, in the case of the original or electromechanical tables, the scripts manage every aspect, sounds, scores, rules, lights, etc.



#7 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 26 October 2023 - 07:59 PM

Thanks but it is not the answer about my question.

#8 jpsalas

jpsalas

    Grand Schtroumpf

  • VIP
  • 7,315 posts
  • Location:I'm Spanish, but I live in Oslo (Norway)

  • Flag: Norway

  • Favorite Pinball: I like both new and old, but I guess I prefer modern tables with some rules and goals to achieve.



Posted 26 October 2023 - 08:16 PM

Maybe what you ask is how the script works, and maybe you need and introduction to VBScript, since that is the programming language VPX uses for the scripts. Something like here:

VBScript Tutorial (tutorialspoint.com)

 

VBScript was designed to used with Internet Explorer and the Office programs, so the tutorials used to have a lot of display thing we don't use in VPX. Still it is good to go though a VBScript tutorial, just to learn the basics. Then VPX has a lot of extra commands to handle all the ball hit events, and also to handle to communications with a rom, as there are tables using a rom and tables which do not use a rom (the so called originals and/or EM tables).


If you want to check my latest uploads then click on the image below:

 

vp.jpg

 

Next table? A tribute table to Stern's Foo Fighters


#9 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 26 October 2023 - 09:23 PM

Thanks, maybe I try to ask in another way.

In your Ghostbusters pinball script there is: Sub RealTime_Timer (or any other Sub, i.e. sw1_Hit() )

 

Who calls this Sub? Where is the file calls this Sub?

Thanks.


Edited by boriskarloff, 26 October 2023 - 09:44 PM.


#10 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,859 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 26 October 2023 - 10:26 PM

Thanks, maybe I try to ask in another way.

In your Ghostbusters pinball script there is: Sub RealTime_Timer (or any other Sub, i.e. sw1_Hit() )

 

Who calls this Sub? Where is the file calls this Sub?

Thanks.

the timer itself calls the sub, as long as the timer is enabled


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


#11 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,670 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 27 October 2023 - 08:26 AM

Thanks, maybe I try to ask in another way.

In your Ghostbusters pinball script there is: Sub RealTime_Timer (or any other Sub, i.e. sw1_Hit() )

 

Who calls this Sub?

Thanks.

Or within another subroutine there is the call that activates the timer.

RealTime.Enabled = 1

 

Sw1 could be a switch (rollover, optocoupler, target), and it is activated when the ball hits it.



#12 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,859 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 27 October 2023 - 08:42 AM

in VPX terms, sw1 is a table object that is collidable and is set to have a hit event.

can be a wall or a switch or a target or a kicker or bumper etc

 

objects can also have an objectname_unhit event

useful for like a kicker, where the ball may sit there for a time

can also be useful for switches, if they are tracking the existence of a stationary ball, but usually a kicker is used for that to prevent a ball that is constantly bobbling around

but could be used to check what position a captive ball is in, as those balls are not locked. Like in big bang bar

 

slingshots have an event but it is objectname_slingshot
which is more useful since a slingshot generally only has an event when it is hit hard enough to trigger it


Edited by wiesshund, 27 October 2023 - 08:45 AM.

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


#13 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 28 October 2023 - 11:02 AM

Thanks to everyone.



#14 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 28 October 2023 - 12:21 PM

https://docs.orbital...x-documentation

#15 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 28 October 2023 - 01:53 PM

 

This is the DOC!

 

Thanks.



#16 Fusionwerks

Fusionwerks

    Poorly recovering pinball addict

  • Platinum Supporter
  • 417 posts

  • Flag: United States of America

  • Favorite Pinball: JP (DE), Deadpool, James Bond 007

Posted 28 October 2023 - 02:54 PM

It's the same document and same information as the command reference.txt file that JP pointed you to a few days ago, just in a nicer page by page layout...
In fact the command reference is probably more up to date.

Edited by Fusionwerks, 28 October 2023 - 02:56 PM.






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