Register    Login    Forum    FAQ    PinSimDB.org

Board index » Resources » Tutorials, how-to's, bug report and docs




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How to Display Bonus and Show it adding to score
 Post Posted: Thu May 12, 2016 10:40 am 
Offline

Joined: Sun Apr 05, 2015 5:39 pm
Posts: 6
I just got one question that i'm sure you pro's out there have an answer for. I'm trying to display the bonus onto my Secondary display and show it being added up on my Primary display where the Current Player is. I made a Bonus based off the Sci-fi table that is from future pinball if that helps any.

Example to show you what I might be doing wrong:

' Add any bonus point & multiply it by Bonus Multiplier
Dim AwardPoints
AwardPoints = 2000 * BonusMultiplier(CurrentPlayer)
AddScore(AwardPoints)
DispSeg2.QueueText "BONUS =", seBlink, 2000, , TRUE
HudSeg2.QueueText "BONUS =", seBlink, 2000, , TRUE
DispSeg3.QueueText "" & FormatScore (DeadBonus(CurrentPlayer))
HudSeg3.QueueText "" & FormatScore (DeadBonus(CurrentPlayer))


If there is an easier method, feel free to let me know. I have no problem with short, sweet, and simple.


Top 
 Profile  
 
 Post subject: Re: How to Display Bonus and Show it adding to score
 Post Posted: Fri May 13, 2016 3:26 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
Code:
Dim AwardPoints
Dim DeadBonus(4)
AwardPoints = 2000 * BonusMultiplier(CurrentPlayer)
DeadBonus(CurrentPlayer) = AwardPoints
DispSeg2.QueueText "BONUS =", seBlink, 2000, , TRUE
HudSeg2.QueueText "BONUS =", seBlink, 2000, , TRUE
DispSeg3.QueueText "" & FormatScore (DeadBonus(CurrentPlayer))
HudSeg3.QueueText "" & FormatScore (DeadBonus(CurrentPlayer))
TotalScoreDelay.enabled= true
TotalScoreDelay.interval 2000

Sub TotalScoreDelay_expired()
TotalScoreDelay.enabled = False
AddScore(AwardPoints)
End Sub



Away from computer so I cant verify but something along these lines might work?
it involves adding a timer called "TotalScoreDelay"


Top 
 Profile  
 
 Post subject: Re: How to Display Bonus and Show it adding to score
 Post Posted: Fri May 13, 2016 10:25 am 
Offline

Joined: Sun Apr 05, 2015 5:39 pm
Posts: 6
Thanks for the help Gimli. I will give it a try and let you know how it works.


Top 
 Profile  
 
 Post subject: Re: How to Display Bonus and Show it adding to score
 Post Posted: Fri May 13, 2016 11:00 am 
Offline

Joined: Sun Apr 05, 2015 5:39 pm
Posts: 6
Strange. I did what you said and now it doesn't even give the bonus points or show my "Bonus =" that was flash on the one display. Now both are blank and no points rewarded. I will post you every piece of code that ties to DeadBonus so you could get better idea.

Code:
 Game Specific Variables
Dim DeadBonus              ' Sets dead bonus Variable


' Tilting wipes bonus out
   DeadBonus = 0



' Reset Bonus after losing a ball
   DeadBonus = 0




Sub EndOfBallTimer_Expired()
   ' disable the timer
   EndOfBallTimer.Enabled = FALSE

   ' if were tilted, reset the internal tilted flag (this will also
   ' set fpTiltWarnings back to zero) which is useful if we are changing player LOL
   fpTilted = FALSE

   ' have we finished counting down the bonus
   If (DeadBonus = 0) Then
   ' has the player won an extra-ball ? (might be multiple outstanding)
      If (ExtraBallsAwards(CurrentPlayer) <> 0) Then

         'AddDebugText "Extra Ball"

         ' yep got to give it to them
         ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) - 1

         ' if no more EB's then turn off any shoot again light
         If (ExtraBallsAwards(CurrentPlayer) = 0) Then
            ShootAgainLight.State = BulbOff
         End If

         ' You may wish to do a bit of a song and dance at this point

         ' Create a new ball in the shooters lane
         CreateNewBall()

      Else   ' no extra balls

         BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer) - 1

         ' was that the last ball ?
         If (BallsRemaining(CurrentPlayer) <= 0) Then

            'AddDebugText "No More Balls, High Score Entry"

            ' Submit the currentplayers score to the High Score system built into Future Pinball
            ' if they have gotten a high score then it will ask them for their initials.  If not
            ' it will call the FuturePinball_NameEntryComplete right away
            'bEnteringAHighScore = TRUE
            'EnterHighScore(CurrentPlayer)
            inithighscore
            ' you may wish to play some music at this point
            StopMusic(1)
            PlayMusic 2, "RainBackground", TRUE

         Else

            ' not the last ball (for that player)
            ' if multiple players are playing then move onto the next one
            EndOfBallComplete()

         End If
      End If
   Else
      ' We are still counting bonus down
      If (DeadBonus > 0) Then
         IncrementDeadBonus(-1)
      End If
      
      ' Add any bonus point & multiply it by Bonus Multiplier
      Dim AwardPoints
      Dim DeadBonus(4)
      AwardPoints = 2000 * BonusMultiplier(CurrentPlayer)
      ' may show bonus being added on display
      DeadBonus(CurrentPlayer) = AwardPoints
      DispSeg2.QueueText "BONUS =", seBlink, 2000, , TRUE
      HudSeg2.QueueText "BONUS =", seBlink, 2000, , TRUE
      DispSeg3.QueueText "" & FormatScore (DeadBonus(CurrentPlayer))
      HudSeg3.QueueText "" & FormatScore (DeadBonus(CurrentPlayer))
      TotalScoreDelay.enabled= true
      TotalScoreDelay.interval 2000

      ' Play a Bonus Count Sound
      
      
      ' Set the timer to Repeat and get faster each time
      If (EndOfBallTimer.Interval > 50) Then
         EndOfBallTimer.Interval = EndOfBallTimer.Interval - 50
      End If
      EndOfBallTimer.Enabled = True
   End If
End Sub



' Increment the DeadBonus Amount
'
Sub IncrementDeadBonus(Amount)
   Dim Value

   ' increment the bonus by the specified amount
   DeadBonus = DeadBonus + Amount
   ' the bonus can only go to a maximum of 20 points
   If (DeadBonus > 20) Then
      DeadBonus = 20
   End If

   ' if we are adding to the bonus play a sound
   If (Amount >= 0) Then
      
   End If

   Value = DeadBonus

   ' if the bonus is over 20
   If (Value >= 20) Then
      Value = Value - 20
   End If

   ' much the same but now if the bonus is still over 10
   If (Value >= 10) Then
      Value = Value - 10
   End If
End Sub


' I put IncrementDeadBonus into one of these targets

' RedTargetS1 has been hit
'
Sub RedTargetS1_Hit() 'this target is hit
   AddScore(1000) 'add points
   RedTargetL1.State = BulbOn 'Turns Light on

IF(RedTargetL1.State = BulbOn AND RedTargetL2.State = BulbOn) THEN
   RedTargetL1.FlashForMs 2000, 200, BulbOff
   RedTargetL2.FlashForMs 2000, 200, BulbOff
   RampL1.State = BulbOn
   AddScore(5000) 'add points
   IncrementDeadBonus(1)
   END IF
End Sub   'end Target


Top 
 Profile  
 
 Post subject: Re: How to Display Bonus and Show it adding to score
 Post Posted: Fri May 13, 2016 4:41 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
Sorry to confuse , I might have to see your table
I am away for another week
Depends how deadbonus, awardpoints are related etc...


Top 
 Profile  
 
 Post subject: Re: How to Display Bonus and Show it adding to score
 Post Posted: Fri May 13, 2016 8:08 pm 
Offline

Joined: Sun Apr 05, 2015 5:39 pm
Posts: 6
No problem. When you get back let me know and you can just download my table at the link provided https://www.dropbox.com/s/9vruoos3x4zl9i4/Return%20of%20the%20Living%20Dead%20v2.0.zip?dl=0


Check out my new Website too if you like http://www.jabspinball.co.nf/


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 6 posts ] 

Board index » Resources » Tutorials, how-to's, bug report and docs


Who is online

Users browsing this forum: No registered users and 5 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to: