Jump to content



Photo
- - - - -

How to set triggered lights to be permanent until next play in VPX?

Help Triggers VPX

  • Please log in to reply
1 reply to this topic

#1 Imriy

Imriy

    Neophyte

  • Members
  • Pip
  • 1 posts

  • Flag: United States of America

  • Favorite Pinball: Pin-Bot

Posted Today, 05:48 AM

Hello, 
I'm building an original game and am looking for some assistance in the way my triggers and 'lites' work. 
 
The goal: Have a rollover trigger turn on a score light (i.e. light up a letter and give score) and stay on, even if ball rolls over trigger again.

 

Maybe I'm using the wrong kind of trigger for this and i should use a Drop Target, but I'm not sure. 

 

The light starts the game in the off state. 

 

Here's the code. Ptrig and Plite is the trigger and light i'm trying to maintain lit, respectively. 

 

I am very new to coding in visual studio, so i apologize. 

 

edit: i wasn't very thoughrough with my problem. When the ball rolls over 'Ptrig' the light turns on. When it does this again, however, it turns off. I want it to stay on until the next ball is created. Eventually, I would like it to turn off after 3 balls,  but i want to proof this element first.

Sub Ptrig_hit
	AddScore 500
	If Plite.State = 1 Then	
		Plite.State = 0
	Else
		Plite.State = 1
	end If
End Sub

Edited by Imriy, Today, 05:50 AM.


#2 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,690 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted Today, 06:57 AM

You can set the light to turn on every time the ball passes,

 

Sub Ptrig_hit
	AddScore 500
	Plite.State = 1
End Sub

 

or you can turn the light on only if it isn't already on.

 

Sub Ptrig_hit
	AddScore 500
	If Plite.State = 0 Then	
		Plite.State = 1
	end If
End Sub

 







Also tagged with one or more of these keywords: Help, Triggers, VPX