Jump to content



Photo
- - - - -

Putting poker cards on backglass of original game


  • Please log in to reply
6 replies to this topic

#1 luvthatapex

luvthatapex

    Pinball Fan

  • VIP
  • 1,435 posts

  • Flag: United States of America

  • Favorite Pinball: Tron



Posted 22 September 2017 - 01:57 PM

Is it possible to put 5 playing cards (from a possible deck of 26) on the backglass with the B2S designer? I have an original table I'm working on and I have the players hand (5 poker cards) show on the playfield as an image popup at the end of the game, but it would be nice to see the 5 cards on the backglass instead. 

 

Here is my code to pop up the cards at the end of the game. How do I get these 5 images on the backglass?

 

Sub ShowMeTheCards()
'Here we display the cards at the end of the game
Dim i
i=0
if light2.state=2 Then 
i=i+1:EVAL("card"&i).image = "KDIAMONDS"
End If
if light3.state=2 Then 
i=i+1:EVAL("card"&i).image = "ACLUBS"
End If
if light4.state=2 Then 
i=i+1:EVAL("card"&i).image = "9HEARTS"
End If
if light5.state=2 Then 
i=i+1:EVAL("card"&i).image = "QSPADES"
End If
if light6.state=2 Then 
i=i+1:EVAL("card"&i).image = "JHEARTS"
End If
if light7.state=2 Then 
i=i+1:EVAL("card"&i).image = "10SPADES"
End If
if light8.state=2 Then 
i=i+1:EVAL("card"&i).image = "JCLUBS"
End If
if light9.state=2 Then 
i=i+1::EVAL("card"&i).image ="ADIAMONDS"
End If
if light10.state=2 Then 
i=i+1::EVAL("card"&i).image ="10HEARTS"
End If
if light11.state=2 Then 
i=i+1::EVAL("card"&i).image ="9SPADES"
End If
if light12.state=2 Then 
i=i+1::EVAL("card"&i).image ="10DIAMONDS"
End If
if light13.state=2 Then 
i=i+1::EVAL("card"&i).image ="AHEARTS"
End If
if light14.state=2 Then 
i=i+1::EVAL("card"&i).image ="KSPADES"
End If
if light15.state=2 Then 
i=i+1::EVAL("card"&i).image ="JOKER"
End If
if light16.state=2 Then 
i=i+1::EVAL("card"&i).image ="QDIAMONDS"
End If
if light17.state=2 Then 
i=i+1::EVAL("card"&i).image ="KCLUBS"
End If
if light18.state=2 Then 
i=i+1::EVAL("card"&i).image ="JDIAMONDS"
End If
if light19.state=2 Then 
i=i+1::EVAL("card"&i).image ="QCLUBS"
End If
if light20.state=2 Then 
i=i+1::EVAL("card"&i).image ="JSPADES"
End If
if light21.state=2 Then 
i=i+1::EVAL("card"&i).image ="9DIAMONDS"
End If
if light22.state=2 Then 
i=i+1::EVAL("card"&i).image ="QHEARTS"
End If
if light23.state=2 Then 
i=i+1::EVAL("card"&i).image ="9CLUBS"
End If
if light24.state=2 Then 
i=i+1::EVAL("card"&i).image ="ASPADES"
End If
if light25.state=2 Then 
i=i+1::EVAL("card"&i).image ="10CLUBS"
End If
if light26.state=2 Then 
i=i+1::EVAL("card"&i).image ="KHEARTS"
End If
End Sub
 


#2 STAT

STAT

    Pinball and Arcade Freak

  • VIP
  • 4,986 posts
  • Location:Wels - Austria

  • Flag: Austria

  • Favorite Pinball: Twilight Zone

Posted 22 September 2017 - 02:09 PM

Illumination / Add new Illumination Snippit ... (drag to/or Enter Position)
Then Select Element on BG, give them a ID and VALUE (in Illumination Window), example: 51,1 for Card 1, next: 51, 2 for Card 2, ...
 
VP Script Code:
Controller:B2SSetData 51,0 'all Cards at #1 off
Controller.B2SSetData 51,10 'Card 10 at #1 on
 
I think you have to do this 5-times, with every Card Block of "5 Cards" ... use 52, 53, 54 and 55 ID for Cards # 2,3,4,5 and give them another Position on Glass
 
Next Example: Controller.B2SSetData 52,13 'Card 13 at #2 on
 
This are the Basics, and the Way how i would do that.


Edited by STAT, 22 September 2017 - 02:37 PM.


#3 luvthatapex

luvthatapex

    Pinball Fan

  • VIP
  • 1,435 posts

  • Flag: United States of America

  • Favorite Pinball: Tron



Posted 22 September 2017 - 03:10 PM

Thanks. I put the backglass in the b2sdesigner and created just a backglass directb2s to see how it looks. I have hundreds of directb2s backglasses working.

I can;t seem to get this or any other directb2s backglass to display with my table. I have the table and the directb2s backglass the same filename so it should load right up when I start the table. If I rename the pokerhand backglass to another table filename it would on that table, so I know the directb2s is ok.

 

Here is the code I have. I thought this is all I need to launch the directb2s backglass since the code is in the controller.vbs?

 
Option Explicit
Randomize
 
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the Controller.vbs file in order to run this table (installed with the VPX package in the scripts folder)"
On Error Goto 0
 
Const cGameName = "PokerHand"
B2SOn=True
 

 

Illumination / Add new Illumination Snippit ... (drag to/or Enter Position)
Then Select Element on BG, give them a ID and VALUE (in Illumination Window), example: 51,1 for Card 1, next: 51, 2 for Card 2, ...
 
VP Script Code:
Controller:B2SSetData 51,0 'all Cards at #1 off
Controller.B2SSetData 51,10 'Card 10 at #1 on
 
I think you have to do this 5-times, with every Card Block of "5 Cards" ... use 52, 53, 54 and 55 ID for Cards # 2,3,4,5 and give them another Position on Glass
 
Next Example: Controller.B2SSetData 52,13 'Card 13 at #2 on
 
This are the Basics, and the Way how i would do that.



#4 sliderpoint

sliderpoint

    Pinball Fan

  • Members
  • PipPipPipPip
  • 760 posts
  • Location:Spokane, WA

  • Flag: United States of America

  • Favorite Pinball: Metallica

Posted 22 September 2017 - 03:55 PM

Strange, you are correct, that should work.

 

You don't really need B2Son=True, that actually gets defined by the controller.vbs.  But that shouldn't stop anything from working.  I think someone else would need to see the files to try to help figure out what is causing it not to work.

 

-Mike

 

Edit:  Try adding this as a line to your table_Init, this should do it.

 

     LoadEM


Edited by sliderpoint, 22 September 2017 - 04:01 PM.


#5 luvthatapex

luvthatapex

    Pinball Fan

  • VIP
  • 1,435 posts

  • Flag: United States of America

  • Favorite Pinball: Tron



Posted 22 September 2017 - 04:17 PM

Wow man you are awesome! That did it. Now I see my plain backglass and can get to work adding the goodies to it. Thanks so much!

 

 

Strange, you are correct, that should work.

 

You don't really need B2Son=True, that actually gets defined by the controller.vbs.  But that shouldn't stop anything from working.  I think someone else would need to see the files to try to help figure out what is causing it not to work.

 

-Mike

 

Edit:  Try adding this as a line to your table_Init, this should do it.

 

     LoadEM



#6 sliderpoint

sliderpoint

    Pinball Fan

  • Members
  • PipPipPipPip
  • 760 posts
  • Location:Spokane, WA

  • Flag: United States of America

  • Favorite Pinball: Metallica

Posted 22 September 2017 - 04:20 PM

Glad it worked. Make sure you add some kind of a stop at the end of your file so the BG will stop running as well when you exit.

 

eg: 

 

Sub Table1_Exit
If B2SOn Then Controller.Stop
End Sub


#7 luvthatapex

luvthatapex

    Pinball Fan

  • VIP
  • 1,435 posts

  • Flag: United States of America

  • Favorite Pinball: Tron



Posted 22 September 2017 - 05:53 PM

ok, I got the first card to display on the backglass, so this will work. Thanks guys, I just have to add 100 more cards to the backglass and add some logic to the game code. Fun stuff!