Jump to content



Photo
* * * * * 18 votes

VP10 is here (beta)

VP10

  • Please log in to reply
3889 replies to this topic

#2161 KieferSkunk

KieferSkunk

    Enthusiast

  • VIP
  • 96 posts
  • Location:Seattle, WA area

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 05 June 2015 - 06:36 PM

With the new VBS scripts the impulse plunger only works the first launch, there is something that I have to change to make it work?
 
Thanks
 
Max


Oh dear, that might be a bug. I'll take a look ASAP.

#2162 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,660 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 05 June 2015 - 06:36 PM

Well, reading the thread you should have spotted when the transparency in the VP10 got changed :). Now you can actually actually specify how much transparency you want from a PNG, or better said how much of the alpha transparency you want to be visible. When you import an image, you will see at the right bottom of the window an "Alpha Mask" and a value from 0 to 255. 1 is the default, which means that most of the alpha pixels will be visible. But if you want more transparency (this is less alpha pixels visible) then you increase this number. So in you case I guess that a number of 128 will just do fine :)

 

That's all. No bugs here, just features :)

 

 

Thanks JP for testing this! saves me some time..



#2163 Shockman

Shockman

    Pinball Fan

  • VIP
  • 1,716 posts
  • Location:Portland Or.

  • Flag: United States of America

  • Favorite Pinball: Star Trek

Posted 05 June 2015 - 07:11 PM

Oh just one reminder, I saw on some VP10 tables that all rubbers have a hit event even though they don't use them in the script. For better performance only activate the hit event on those elements you actually use in the script.
The hit event is an expensive COM call and should only be used when needed, therefore the hit event is unchecked for rubbers when you create a new one.

Expensive COM call? That is interesting. Every rubber I have put on a table for years has had a hit event not only by default but by design. If it only applies to newly created ones it is no big deal, just changing up long used table building way. The hit event for rubber is to trigger a sound. Many other tables as well.

 

Since rubbers are hit though and the program reacts to it, by using the settings given individually to each one, even without the hit event set, could one of those settings be a sound?

 

If they are in a collection that is used to trigger a sound, does each one need the hit event set by the builder?



#2164 KieferSkunk

KieferSkunk

    Enthusiast

  • VIP
  • 96 posts
  • Location:Seattle, WA area

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 05 June 2015 - 07:15 PM

Attached File  core345.zip   24.37KB   4 downloads

With the new VBS scripts the impulse plunger only works the first launch, there is something that I have to change to make it work?
 
Thanks
 
Max


Oh dear, that might be a bug. I'll take a look ASAP.

 

 

Yep, I think I found the problem.  Copy/paste error on my part.

 

If you go to line 598 of core.vbs and replace this line:

If IsObject(mDict(Item)) Then

with

If IsObject(mDict(aKey)) Then

The silly thing should start working correctly.

 

Sorry folks.

 

I'll have an update off to toxie shortly.

 

Okay, no, I'm wrong.  There is definitely still a bug there.  I'm still investigating - hang tight.  It looks to me like the same bug that may be affecting this may also affect cvpmMagnet and cvpmTurntable, since they use the same methods to track which balls are in the area of influence.  I'll let you know what I find.

 

UPDATE: Okay, yeah, I've tracked it down to a bug in the updated cvpmDictionary - the .Remove method isn't actually removing keys from the MS dictionary like it should be - instead, it's replacing the Item at that key with "Empty".  I'm working on a fix now.  (Seems odd that it would be doing that, given I'm literally just passing the key along to MSDict.Remove .)

 

UPDATE 2: Huh.  Okay, it WAS that line, apparently.  The reason the fix didn't work for me was that I was saving my working copy of the script in the wrong place. :P  Go figure.

 

Okay, so yeah, as a temporary fix, just change the one line of core.vbs as shown above.


Edited by KieferSkunk, 05 June 2015 - 08:23 PM.


#2165 KieferSkunk

KieferSkunk

    Enthusiast

  • VIP
  • 96 posts
  • Location:Seattle, WA area

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 05 June 2015 - 08:24 PM

The message board is being a little strange at the moment.  If you can see an attachment on this reply, download it to replace your current core.vbs with the bugfixed one.  I'll make sure this gets added to the current distribution as well.

 

Attached File  core345-bugfixed-no-really.zip   24.37KB   40 downloads


Edited by KieferSkunk, 06 June 2015 - 06:53 AM.


#2166 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,660 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 05 June 2015 - 08:31 PM

cool.. thanks for the quick fix..



#2167 Toxy

Toxy

    Addicted

  • Gold Supporter
  • 60 posts
  • Location:United Kingdom

  • Flag: United Kingdom

  • Favorite Pinball: Congo, Theatre of Magic, Fish Tales.

Posted 05 June 2015 - 09:59 PM

Thanks KieferSkunk.



#2168 KieferSkunk

KieferSkunk

    Enthusiast

  • VIP
  • 96 posts
  • Location:Seattle, WA area

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 05 June 2015 - 10:44 PM

Got a question for table scripters out there:

 

I'm working on some updates to the BallStack class, and I keep running into some problems with how cvpmBallStack is designed.  As it is right now, cvpmBallStack has two "operating modes" - Saucer and Trough.  There are only a couple of things these two modes have in common, but for the most part these two concepts are very different from one another, and the current class implementation mixes the concepts too much for my liking.  That's making my updates difficult, so I have a proposed change here:

 

- Add "cvpmTrough" and "cvpmSaucer" classes, which each take over for the two "cvpmBallStack" operating modes.

- Keep cvpmBallStack unchanged - it becomes a "legacy" class and would be kept around for compatibility with non-updated tables.

 

The new Trough class would be designed for all subways and main ball troughs and would cleanly handle trough-specific concepts, including adding balls at the entrance, stacking balls at the exit, kicking balls out, handling trough switches, etc.

- This class would be able to handle any number of balls (it can have a set size and then "queue up" additional balls outside of it, and you would be able to add as many switches as you have "ball slots" in the trough, if you so desire.

 

The new Saucer class would be designed for all top-side saucers where there is no concept of a "trough" and only one ball can occupy the saucer at a time.  It would still support two kick directions, Z-force, etc.

 

Here is how you might use these new classes in a typical table:

Dim trough, leftSaucer

Set trough = new cvpmTrough : With trough
    .MaxBalls = 6      ' 6 ball slots
    .InitSw Array(29, 30, 31, 32, 33)   ' Set any number of switches starting at exit
    .InitEntry kickTEntry, 28, 9        ' Set entrance kicker, associated switch and solenoid
    .InitExit kickTExit, 10, 90, 8      ' Exit kicker, solenoid, dir, force
    .InitKickVariance 2, 2              ' Vary force and direction by N units each
    .MaxBallsPerKick = 2                ' Kick up to 2 stacked balls out of exit
    .InitExitSnd "kickEmpty", "kickBall"
    .Balls = 5                          ' Trough starts with 5 balls in it.
End With

Set leftSaucer = new cvpmSaucer : With leftSaucer
    .InitKicker kickSaucer, 47, 13, 180, 6, 2  ' Kicker, switch, solenoid, direction, force, Z-force
    .InitAltKick 270, 6, 2                     ' Alternate kick dir, force, Z-force
    .InitKickVariance 2, 2                     ' Vary force and direction by N units each
    .InitExitSnd "kickEmpty", "kickBall"
    .CreateEvents "leftSaucer"
    .AddBall                                   ' Start full.
End With

If you don't like this change and would prefer to continue just using cvpmBallStack in its current form, I can still do my updates - they're just more complicated and harder to understand (and will take more time).

 

(EDIT: Removed Twilight Zone examples, as the scenario I mentioned there doesn't actually exist - balls stack up on the exit kicker no matter where they come from.)


Edited by KieferSkunk, 05 June 2015 - 11:43 PM.


#2169 jpsalas

jpsalas

    Grand Schtroumpf

  • VIP
  • 6,416 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 06 June 2015 - 01:22 AM

It sounds good to me, KieferSkunk. Just keep the cvpmBallStack for compatibility with older tables, as you already said. And remember to update the documentation file, vbsdoc.html :)


These are my tables, sorted by date, all them playable with VPX 7 or newer:

vp.jpg

After 18 years making tables, it is time to take a rest and let new authors do their thing.

I guess at last I'll play some more pinball :). But I'm sure I'll make some table updates from time to time :)


#2170 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,060 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 06 June 2015 - 01:26 AM

New classes are fine with me.  Probably safer too so no chance of breaking compatibility



#2171 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,513 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 06 June 2015 - 06:12 AM

The message board is being a little strange at the moment.  If you can see an attachment on this reply, download it to replace your current core.vbs with the bugfixed one.  I'll make sure this gets added to the current distribution as well.

 

attachicon.gifcore345.zip

This core.vbs gives me an error message:

 
Line: 1
Undefined variable: 'mDebug'

 
The fixing of the line 598 seems to work well!

 

Thanks

 

Max



#2172 KieferSkunk

KieferSkunk

    Enthusiast

  • VIP
  • 96 posts
  • Location:Seattle, WA area

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 06 June 2015 - 06:28 AM

This core.vbs gives me an error message:
 
Line: 1
Undefined variable: 'mDebug'
 
The fixing of the line 598 seems to work well!
 
Thanks
 
Max


Argh! Thought I'd gotten all the debug stuff out. I'll put up another update shortly.

#2173 KieferSkunk

KieferSkunk

    Enthusiast

  • VIP
  • 96 posts
  • Location:Seattle, WA area

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 06 June 2015 - 06:55 AM

Alrighty, sorry about that.  Serves me right for trying to strip out debug code at the last second without testing it.  (I tested it this time.  It works now, I promise. :))

 

Attached File  core345-bugfixed-no-really.zip   24.37KB   96 downloads



#2174 arngrim

arngrim

    DJ Force Feedback

  • VIP
  • 2,188 posts
  • Location:Charleroi, Belgium

  • Flag: Belgium

  • Favorite Pinball: Monster bash



Posted 06 June 2015 - 07:13 AM

these scripts are really great :)

 

it could be great if we have a script for loading the controllers, and disabling the mech sounds

 

this is what is/was used for a long time

 

Sub LoadVPM(VPMver, VBSfile, VBSver)
       On Error Resume Next
       If ScriptEngineMajorVersion < 5 Then MsgBox "VB Script Engine 5.0 or higher required"
       ExecuteGlobal GetTextFile(VBSfile)
       If Err Then MsgBox "Unable to open " & VBSfile & ". Ensure that it is in the same folder as this table. " & vbNewLine & Err.Description
  'Set Controller = CreateObject("B2S.Server")
       Set Controller = CreateObject("vpinmame.controller")
       If Err Then MsgBox "Can't Load VPinMAME." & vbNewLine & Err.Description
       If VPMver > "" Then If Controller.Version < VPMver Or Err Then MsgBox "VPinMAME ver " & VPMver & " required."
       If VPinMAMEDriverVer < VBSver Or Err Then MsgBox VBSFile & " ver " & VBSver & " or higher required."
       On Error Goto 0
     End Sub
 
 
after some research with gtxjoe, i use this with all my mods :
 
'******************* Options *********************
' DMD/Backglass Controller Setting
Const cController = 0 '0=Use value defined in cController.txt, 1=VPinMAME, 2=UVP server, 3=B2S server, 4=B2S with DOF (disable VP mech sounds)
'*************************************************
 
Dim cNewController
Sub LoadVPM(VPMver, VBSfile, VBSver)
Dim FileObj, ControllerFile, TextStr
 
On Error Resume Next
If ScriptEngineMajorVersion < 5 Then MsgBox "VB Script Engine 5.0 or higher required"
ExecuteGlobal GetTextFile(VBSfile)
If Err Then MsgBox "Unable to open " & VBSfile & ". Ensure that it is in the same folder as this table. " & vbNewLine & Err.Description
 
cNewController = 1
If cController = 0 then
Set FileObj=CreateObject("Scripting.FileSystemObject")
If Not FileObj.FolderExists(UserDirectory) then 
Msgbox "Visual Pinball\User directory does not exist. Defaulting to vPinMame"
ElseIf Not FileObj.FileExists(UserDirectory & "cController.txt") then
Set ControllerFile=FileObj.CreateTextFile(UserDirectory & "cController.txt",True)
ControllerFile.WriteLine 1: ControllerFile.Close
Else
Set ControllerFile=FileObj.GetFile(UserDirectory & "cController.txt")
Set TextStr=ControllerFile.OpenAsTextStream(1,0)
If (TextStr.AtEndOfStream=True) then
Set ControllerFile=FileObj.CreateTextFile(UserDirectory & "cController.txt",True)
ControllerFile.WriteLine 1: ControllerFile.Close
Else
cNewController=Textstr.ReadLine: TextStr.Close
End If
End If
Else
cNewController = cController
End If
 
Select Case cNewController
Case 1
Set Controller = CreateObject("VPinMAME.Controller")
If Err Then MsgBox "Can't Load VPinMAME." & vbNewLine & Err.Description
If VPMver>"" Then If Controller.Version < VPMver Or Err Then MsgBox "VPinMAME ver " & VPMver & " required."
If VPinMAMEDriverVer < VBSver Or Err Then MsgBox VBSFile & " ver " & VBSver & " or higher required."
Case 2
Set Controller = CreateObject("UltraVP.BackglassServ")
Case 3,4
Set Controller = CreateObject("B2S.Server")
End Select
On Error Goto 0
End Sub
 
'*************************************************************
'Toggle DOF sounds on/off based on cController value
'*************************************************************
Dim ToggleMechSounds
Function SoundFX (sound)
    If cNewController= 4 and ToggleMechSounds = 0 Then
        SoundFX = ""
    Else
        SoundFX = sound
    End If
End Function
 
Sub DOF(dofevent, dofstate)
If cNewController>2 Then
If dofstate = 2 Then
Controller.B2SSetData dofevent, 1:Controller.B2SSetData dofevent, 0
Else
Controller.B2SSetData dofevent, dofstate
End If
End If
End Sub
 
 
 
so it needs a ccontroller.txt in user folder of vp, value 1 in it = vpinmame controller, 2 uvp, 3 b2s.server, 4 b2s.server + disable mech sounds for those who have force feedback in their cabs
 

the soundfx method is surrounded for every sound that needs to be shut with option 4, and the sub dof send info to b2s.server for scripted events for DOF

 

everybody will benefit from it, authors and users, is it feasible?



#2175 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,660 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 06 June 2015 - 07:51 AM

good catch arngrim. now that we finally have a vbs wizard back on board, why not incorporate all the code that is recommended to use nowadays directly in the core files (and have them revisited by somebody who actually knows the core :)).



#2176 KieferSkunk

KieferSkunk

    Enthusiast

  • VIP
  • 96 posts
  • Location:Seattle, WA area

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 06 June 2015 - 08:03 AM

@Arngrim: is that something that would be universal for all tables? If so, that shouldn't be difficult to incorporate. Would want to learn a bit more about it.

#2177 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,513 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 06 June 2015 - 08:21 AM

Alrighty, sorry about that.  Serves me right for trying to strip out debug code at the last second without testing it.  (I tested it this time.  It works now, I promise. :))

 

attachicon.gifcore345-bugfixed-no-really.zip

Thanks, this works fine.

 

 
The kickers raised from the playfield, on a wall, the ball passes through the wall and gets stuck under, work in legacy mode.

 

Thanks

 

Max



#2178 arngrim

arngrim

    DJ Force Feedback

  • VIP
  • 2,188 posts
  • Location:Charleroi, Belgium

  • Flag: Belgium

  • Favorite Pinball: Monster bash



Posted 06 June 2015 - 04:00 PM

sure, any questions just ask

 

yes it can be universal for all tables, including EM

 

the initial requirement is to have the ability to change of controller without opening the script of the table

 

so we need a place where to store the configuration, which is now the user folder of vp.

 

for the soundfx method,

 

PlaySound "FlipperUp" becomes PlaySound SoundFx("FlipperUp"), and if ccontroller = 4, sound is muted in the soundfx method, else sound is played.

 

The majority of the sounds can be muted because they are redondant with force feedback, but not all, like rollovers, plunger, drain, kicker in, rubbers, metal hit  

 

for the DOF method, it can be used if the user has DOF or not, if ccontroller = 3 or 4, that's why i put if ccontroller > 2. if controller is vpinmame.controller, it will give an error, because behind that method there is the B2SSetData functionality which is a B2S.Server command 

 

example how it is used

 

Sub Sol5(Enabled)
If Enabled Then
If Phase=0 Then
' vpmFlasher BrightMan,True
Else
dtL.DropSol_On
DOF 101, 2
End If
Else
' If Phase=0 Then vpmFlasher BrightMan,False
End If
End Sub

 

there's no direct solenoid that i can map, so i create my own script event which will interact which will be propagated into b2.server when program goes to that part of the code

 

any improvement suggestions are welcome 

 

@Arngrim: is that something that would be universal for all tables? If so, that shouldn't be difficult to incorporate. Would want to learn a bit more about it.


Edited by arngrim, 06 June 2015 - 04:01 PM.


#2179 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,334 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 07 June 2015 - 05:26 AM

plunger on kingpin stops working after the first plunge with the new vbscipts


nevermind i have extremely poor reading comprehension skills



#2180 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,334 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 07 June 2015 - 07:37 AM

Ppw0KJR.png

any solution for this?







Also tagged with one or more of these keywords: VP10