Jump to content



Photo
- - - - -

How to change a drop targets state in script

Help script targets coding

  • Please log in to reply
3 replies to this topic

#1 Jackmc7r

Jackmc7r

    Neophyte

  • Members
  • Pip
  • 2 posts

  • Flag: United States of America

  • Favorite Pinball: Jurassic Park Stern

Posted 12 March 2024 - 08:50 PM

I am going to preface this with the fact that I am blundering my way through the coding side of this program. I do not have a history in programming outside of plc/industrial equipment.

 

My issue is I cannot figure out how to influence a drop target state with the code.

My goal is to have a drop target only drop once it's been hit 5 times.

From what I've gathered the drop targets have 2 states Target_hit is the ball coming into contact with the target which starts the drop animation. and Target_dropped which is the state at the end of the animation.

I typed this up when I was first trying to work around it and it just crashes because im changing a state instead of influencing it.

Either way it doesn't work because I don't know what to reference to tell the target to reset.

 

 

Sub Waterfall_Target_Hit()
    dim WFC
    WFC = WFC + 1
    if WFC >= 5 then  Waterfall_Target_Raised = True and Waterfall_Target_Dropped = False
    ifelse Waterfall_Target_Dropped = True and Waterfall_Target_Raised = False
End Sub


"Only dinosaurs can eat balls" - The dinosaurs


#2 hmueck

hmueck

    MaX

  • VIP
  • 2,190 posts
  • Location:Hamburg

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

  • Favorite Pinball: IPDB Top 300



Contributor

Posted 12 March 2024 - 09:12 PM

Dim WFC 'only dim once outside of sub

WaterfallTarget_DropSpeed=0 'Target will not drop when hit

 

Sub WaterfallTarget_hit() 'target is hit

   WFC=WFC+1

   If WFC >=5 then
      WaterfallTarget_DropSpeed=0.5 'let it drop next time

   End If

End Sub


VPX0beta tables: 29cff786951ed9c1a70fc1fa47f5e3c1.png 0cecd68ffa2537a7262337834a05bbbe.png Finish them if you like!

#3 Jackmc7r

Jackmc7r

    Neophyte

  • Members
  • Pip
  • 2 posts

  • Flag: United States of America

  • Favorite Pinball: Jurassic Park Stern

Posted 12 March 2024 - 09:30 PM

Dim WFC 'only dim once outside of sub

WaterfallTarget_DropSpeed=0 'Target will not drop when hit

 

Sub WaterfallTarget_hit() 'target is hit

   WFC=WFC+1

   If WFC >=5 then
      WaterfallTarget_DropSpeed=0.5 'let it drop next time

   End If

End Sub

It's saying that the "WaterfallTarget_DropSpeed" variable isn't defined. and also how would I make the target come back up once a condition was met?


"Only dinosaurs can eat balls" - The dinosaurs


#4 hmueck

hmueck

    MaX

  • VIP
  • 2,190 posts
  • Location:Hamburg

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

  • Favorite Pinball: IPDB Top 300



Contributor

Posted 12 March 2024 - 09:37 PM

Sorry, it's .dropspeed, not _dropspeed.

Dim WFC 'only dim once outside of sub

WaterfallTarget.DropSpeed=0 'Target will not drop when hit
 
Sub WaterfallTarget_hit() 'target is hit
   WFC=WFC+1
   If WFC >=5 then

      WaterfallTarget.DropSpeed=0.5 'let it drop next time

   End If
End Sub

If conditionismet=true
   WFC=0
   WaterfallTarget.isdropped=0 'make droptarget not down
End If

 


VPX0beta tables: 29cff786951ed9c1a70fc1fa47f5e3c1.png 0cecd68ffa2537a7262337834a05bbbe.png Finish them if you like!





Also tagged with one or more of these keywords: Help, script, targets, coding