Jump to content



Photo
- - - - -

Multiple lights turning on one light.


  • Please log in to reply
3 replies to this topic

#1 spikedsteel

spikedsteel

    Neophyte

  • Members
  • Pip
  • 3 posts

  • Flag: Canada

  • Favorite Pinball: The chrome ones that are round are my favorite.

Posted 26 May 2015 - 11:29 PM

Sorry to bother you all, I have been trying to fix this now for a few hours and I am frustrated with it. I am new to scripting and I am trying to get three lights to light off of one. 

 

This is the script I thought would do it, but I must be missing something.

 

I'm sorry if it is something basic this is my first time. I get the first three to light up, but then i cant get them to light the other one.

' upper targets to light multi ball

sub target1_Hit()
    addscore(100)
    bulb1.FlashForMs 200, 100, BulbOn


end sub

sub target3_Hit()
    addscore(100)
    bulb3.FlashForMs 200, 100, BulbOn

end sub

sub target2_Hit()
    addscore(100)
    bulb2.FlashForMs 200, 100, Bulbon



end sub


' light multi ball light

If (bulb1.state = bulbon) and (bulb2.state = bulbon) and (bulb3.state = bulbon) then
    multi.FlashForMs 200, 100, BulbOn

end if 


#2 SpectreRose

SpectreRose

    Hobbyist

  • Members
  • PipPip
  • 28 posts

  • Flag: ---------

  • Favorite Pinball: I love too many I can't decide!

Posted 27 May 2015 - 12:39 AM

Three lights to light off of one what? One... target?

 

Regardless, I think I see one minor problem. I don't recall being able to get the "and" thing to work as I recall being taught in class. Try breaking it down into something like this:

If (bulb1.state = bulbon) and 
   If (bulb2.state = bulbon) and 
      If (bulb3.state = bulbon) then
    multi.FlashForMs 200, 100, BulbOn
      End If
   End If
End If

Might not be what you're going for though, but it's the best I can guess at given the information provided at this time. Just in case that doesn't work, you might want to try substituting those "and"s with "then"s instead.


Edited by SpectreRose, 27 May 2015 - 12:41 AM.


#3 spikedsteel

spikedsteel

    Neophyte

  • Members
  • Pip
  • 3 posts

  • Flag: Canada

  • Favorite Pinball: The chrome ones that are round are my favorite.

Posted 27 May 2015 - 01:39 AM

Sorry thank you for the info I will see what I Can do with it.

 

The Idea is that i have three targets and when hit each one lights up the light behind it, When all three targets are hit and all three lights lit, then the lights would triggers another light named multi ,To show that you are ready to start multi-ball.

 

5 min later before hitting send

 

Thank you some much its then's not and's and they are on different lines. it is only my second day of scripting thank you for the help.

' upper targets to light individual lights and when comboed mulit light is triggered

sub target1_Hit()
if (bulb1.state = bulbon) then
   If (bulb2.state = bulbon) then
      If (bulb3.state = bulbon) then
    multi.FlashForMs 200, 100, BulbOn
      End If
   End If
End If
    addscore(100)
    bulb1.FlashForMs 200, 100, BulbOn


end sub

sub target3_Hit()
if   (bulb1.state = bulbon) then
   If (bulb2.state = bulbon) then
      If (bulb3.state = bulbon) then
    multi.FlashForMs 200, 100, BulbOn
      End If
   End If
End If
    addscore(100)
    bulb3.FlashForMs 200, 100, BulbOn

end sub

sub target2_Hit()
if   (bulb1.state = bulbon) then
   If (bulb2.state = bulbon) then
      If (bulb3.state = bulbon) then
    multi.FlashForMs 200, 100, BulbOn
      End If
   End If
End If
    addscore(100)
    bulb2.FlashForMs 200, 100, Bulbon



end sub

Edited by spikedsteel, 27 May 2015 - 01:41 AM.


#4 spikedsteel

spikedsteel

    Neophyte

  • Members
  • Pip
  • 3 posts

  • Flag: Canada

  • Favorite Pinball: The chrome ones that are round are my favorite.

Posted 27 May 2015 - 03:03 AM

when i try and add my kick in to create a multi ball it stops the light multi light from activating when the three are turned on

sub Kicker2_Hit()
If (multi.State = BulbOff)Then
    ADDSCORE(333)
    LeftSlingshotBulb1.FlashForMs  200, 100, BulbOff
			LeftSlingshotBulb2.FlashForMs  200, 100, BulbOff
			RightSlingshotBulb1.FlashForMs 200, 100, BulbOff
			RightSlingshotBulb2.FlashForMs 200, 100, BulbOff
         multi.FlashForMs 200, 100, BulbOff
    kickertimer2.enabled = true
end if
end sub

sub kicker2_hit()  
If (multi.State = Bulbon)Then
multiTimer.Enabled = True
end if
end sub

sub multiTimer_Expired()
multitimer.enabled = FALSE
Kicker2.solenoidpulse()
Hole2.Createball()
Hole2.SolenoidPulse()
Hole4.Createball()
Hole4.SolenoidPulse()
AddScore(1000)
End Sub


Sub kickertimer2_expired()      
    kickertimer2.enabled = FALSE      ' So turn OFF the timer
    kicker2.solenoidpulse()          ' Kick the ball out


end sub