Jump to content



Photo
- - - - -

My first table (Hogan's Heroes)


  • Please log in to reply
366 replies to this topic

#241 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 30 July 2010 - 01:27 AM

Looking at how to programmatically disable and enable the flippers on the lower mini playfield as to only enable when the ball hits the underground scoop to enter the underground playfield and to disable them when the ball hits either drain in the mini playfield.

I could have been smart, but I never learned anything by being smart!

 

 


#242 Bob5453

Bob5453

    I'm taking a nap

  • VIP
  • 3,896 posts
  • Location:Near Dayton, Ohio USA

  • Flag: United States of America

  • Favorite Pinball: Any table I can play while sitting in a rocking chair




  • Trophies:

Posted 30 July 2010 - 01:52 AM

QUOTE (Practicedummy @ Jul 29 2010, 09:27 PM) <{POST_SNAPBACK}>
Looking at how to programmatically disable and enable the flippers on the lower mini playfield as to only enable when the ball hits the underground scoop to enter the underground playfield and to disable them when the ball hits either drain in the mini playfield.


Dim MiniPlayfield

MiniPlayfield = True 'set it to true when you want the flippers to flip

If MiniPlayfield = True Then LowerLeftFlipper.RotateToEnd

If MiniPlayfield = True Then LowerLeftFlipper.RotateToStart

MiniPlayfield = False ' set it to false when you don't want them to flip

You will also need to LowerLeftFlipper.RotateToStart when you set MiniPlayfield to False, so the flippers always return to the starting position, rather than stuck in the up position.

Posted Image

You have discovered an Easter egg. Pat yourself on the back.


#243 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 30 July 2010 - 02:13 AM

Where do I insert the loop statement in?

Here's the code that handles the ball destruction and creation for the underground playfield and subsequent events if this helps out in helping me put in the code. I renamed miniplayfield to MiniPlayfieldFlippers for ease of reading:

Sub UndergroundEntranceScoop_Hit()
UndergroundEntranceScoop.DestroyBall
InPlayUndergroundKicker.CreateBall
UndergroundEntranceScoopTimer.Enabled=True
MiniPlayfieldFlippers.Enabled= True

End Sub

Sub UndergroundEntranceScoopTimer_Timer()
InPlayUndergroundKicker.Kick 180, 10
UndergroundEntranceScoopTimer.Enabled=False

End Sub

Sub LeftUndergroundDrain_Hit()
LeftUndergroundDrain.DestroyBall
HeroesTarget1.IsDropped=False
HeroesTarget2.IsDropped=False
HeroesTarget3.IsDropped=False
HeroesTarget4.IsDropped=False
HeroesTarget5.IsDropped=False
HeroesTarget6.IsDropped=False
MiniPlayfieldFlippers.Enabled= False
TreestumpHatchClosed.IsDropped=True
TreestumpHatchOpened.IsDropped=False
TreestumpHatchTimer.Enabled=True

End Sub

Sub RightUndergroundDrain_Hit()
RightUndergroundDrain.DestroyBall
HeroesTarget1.IsDropped=False
HeroesTarget2.IsDropped=False
HeroesTarget3.IsDropped=False
HeroesTarget4.IsDropped=False
HeroesTarget5.IsDropped=False
HeroesTarget6.IsDropped=False
MiniPlayfieldFlippers.Enabled= False
TreestumpHatchClosed.IsDropped=True
TreestumpHatchOpened.IsDropped=False
TreestumpHatchTimer.Enabled=True

End Sub

Sub TreestumpHatchTimer_Timer()
TreestumpKicker.CreateBall
TreestumpKicker.Kick 170, 20, 1
TreestumpHatchOpened.IsDropped=True
TreestumpHatchClosed.IsDropped=False
TreestumpHatchTimer.Enabled=False

End Sub

Edited by Practicedummy, 30 July 2010 - 02:15 AM.

I could have been smart, but I never learned anything by being smart!

 

 


#244 Bob5453

Bob5453

    I'm taking a nap

  • VIP
  • 3,896 posts
  • Location:Near Dayton, Ohio USA

  • Flag: United States of America

  • Favorite Pinball: Any table I can play while sitting in a rocking chair




  • Trophies:

Posted 30 July 2010 - 02:14 AM

QUOTE (Practicedummy @ Jul 29 2010, 10:05 PM) <{POST_SNAPBACK}>
Where do I insert the loop statement in?


You don't need a Loop statement. That's all you need above. You are just adding a condition to the lower flipper code. You just set MiniPlayfied to True when you enter the lower playfield, like at a trigger or some other object that has a Hit event. Then when you leave the miniplayfield, set it to False.

Posted Image

You have discovered an Easter egg. Pat yourself on the back.


#245 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 30 July 2010 - 02:17 AM

Ah ok I will enter the code as stated and try it out. Thanks Bob!

I could have been smart, but I never learned anything by being smart!

 

 


#246 Bob5453

Bob5453

    I'm taking a nap

  • VIP
  • 3,896 posts
  • Location:Near Dayton, Ohio USA

  • Flag: United States of America

  • Favorite Pinball: Any table I can play while sitting in a rocking chair




  • Trophies:

Posted 30 July 2010 - 02:26 AM

Remember you are just adding the

If MiniPlayfield = True Then

to the Keyup and Keydown subs where you already have the flipper code.

Let us know how it goes.

Posted Image

You have discovered an Easter egg. Pat yourself on the back.


#247 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 30 July 2010 - 02:33 AM

Get error code when the underground scoop is hit: Object Required MiniPlayfieldFlippers

MiniPlayfieldFlippers.Enabled= True is highlighted in red.

Almost forgot, the mini playfield flippers don't flip when the table starts, which is one of the desirable effects I was going for so we are halfway there. biggrin.gif

Edited by Practicedummy, 30 July 2010 - 02:45 AM.

I could have been smart, but I never learned anything by being smart!

 

 


#248 Bob5453

Bob5453

    I'm taking a nap

  • VIP
  • 3,896 posts
  • Location:Near Dayton, Ohio USA

  • Flag: United States of America

  • Favorite Pinball: Any table I can play while sitting in a rocking chair




  • Trophies:

Posted 30 July 2010 - 02:58 AM

QUOTE (Practicedummy @ Jul 29 2010, 10:33 PM) <{POST_SNAPBACK}>
Get error code when the underground scoop is hit: Object Required MiniPlayfieldFlippers

MiniPlayfieldFlippers.Enabled= True is highlighted in red.

Almost forgot, the mini playfield flippers don't flip when the table starts, which is one of the desirable effects I was going for so we are halfway there. biggrin.gif


My way doesn't need the

MiniPlayfieldFlippers.Enabled= True

I don't know if you can use the disable with flippers anyway

Posted Image

You have discovered an Easter egg. Pat yourself on the back.


#249 Wizards_Hat

Wizards_Hat

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 1,258 posts
  • Location:Manchester, UK

  • Flag: United Kingdom

  • Favorite Pinball: STTNG




  • Trophies:

Posted 30 July 2010 - 05:54 AM

QUOTE (Bob5453 @ Jul 30 2010, 02:52 AM) <{POST_SNAPBACK}>
QUOTE (Practicedummy @ Jul 29 2010, 09:27 PM) <{POST_SNAPBACK}>
Looking at how to programmatically disable and enable the flippers on the lower mini playfield as to only enable when the ball hits the underground scoop to enter the underground playfield and to disable them when the ball hits either drain in the mini playfield.


Dim MiniPlayfield

MiniPlayfield = True 'set it to true when you want the flippers to flip

If MiniPlayfield = True Then LowerLeftFlipper.RotateToEnd

If MiniPlayfield = True Then LowerLeftFlipper.RotateToStart

MiniPlayfield = False ' set it to false when you don't want them to flip

You will also need to LowerLeftFlipper.RotateToStart when you set MiniPlayfield to False, so the flippers always return to the starting position, rather than stuck in the up position.

You are right Bob, but I don't think PD "gets" where you are asking him to put these lines of code - even when I first read the above, I thought you were telling him to throw the flippers up when the ball entered the miniplayfield, and then lower when it exits!

So....PD what Bob wants you to do is this:
CODE
Dim MiniPlayfieldFlippers  'Or whatever you want to call this variable - it will be used to let the table know if the ball is in the miniplayfiled or not

Sub UndergroundEntranceScoop_Hit()
UndergroundEntranceScoop.DestroyBall
InPlayUndergroundKicker.CreateBall
UndergroundEntranceScoopTimer.Enabled=True
MiniPlayfieldFlippers= True    'NOT ".enabled" - that would imply that MiniPlayfieldFlippers is a vp object, like a timer, or target etc, whereas it's only a variable.
End Sub

'Then in the _keydown sub (unless you have renamed your table this will be "Sub Table1_KeyDown(byVal keycode)"
'You need to include the lines
If Keycode=LeftFlipperKey and MiniPlayfieldFlippers=true then MiniPlayfieldLeftFlipper.RotateToEnd            'Assuming your mini playfield flippers are called MiniPlayfieldLeftFlipper (etc)
If Keycode=RightFlipperKey and MiniPlayfieldFlippers=true then MiniPlayfieldRightFlipper.RotateToEnd

'Then in the _keyup sub (unless you have renamed your table this will be "Sub Table1_KeyUp(byVal keycode)"
'You need to include the lines
If Keycode=LeftFlipperKey and MiniPlayfieldFlippers=true then MiniPlayfieldLeftFlipper.RotateToStart            'Assuming your mini playfield flippers are called MiniPlayfieldLeftFlipper (etc)
If Keycode=RightFlipperKey and MiniPlayfieldFlippers=true then MiniPlayfieldRightFlipper.RotateToStart

'Then you need to tell the drains to turn that MiniPlayfieldFlippers variable to false
Sub LeftUndergroundDrain_Hit()
LeftUndergroundDrain.DestroyBall
HeroesTarget1.IsDropped=False
HeroesTarget2.IsDropped=False
HeroesTarget3.IsDropped=False
HeroesTarget4.IsDropped=False
HeroesTarget5.IsDropped=False
HeroesTarget6.IsDropped=False
MiniPlayfieldFlippers= False      'Again all I've done here is removed the ".enabled" which implies it's a playfield object
MiniPlayfieldLeftFlipper.RotateToStart    'Reset the miniplayfield flippers when the ball leaves the miniplayfield
MiniPlayfieldRightFlipper.RotateToStart
TreestumpHatchClosed.IsDropped=True
TreestumpHatchOpened.IsDropped=False
TreestumpHatchTimer.Enabled=True

End Sub

Sub RightUndergroundDrain_Hit()
RightUndergroundDrain.DestroyBall
HeroesTarget1.IsDropped=False
HeroesTarget2.IsDropped=False
HeroesTarget3.IsDropped=False
HeroesTarget4.IsDropped=False
HeroesTarget5.IsDropped=False
HeroesTarget6.IsDropped=False
MiniPlayfieldFlippers= False      'Again all I've done here is removed the ".enabled" which implies it's a playfield object
MiniPlayfieldLeftFlipper.RotateToStart    'Reset the miniplayfield flippers when the ball leaves the miniplayfield
MiniPlayfieldRightFlipper.RotateToStart
TreestumpHatchClosed.IsDropped=True
TreestumpHatchOpened.IsDropped=False
TreestumpHatchTimer.Enabled=True

End Sub

That's it.
You can cut down the coding a bit by making a collection of the 2 drains - seeing as they do exactly the same thing (I have done exactly this on the example table below)

I have attached an example table - using the code above - i.e. your code with those necessary bits added - & I've kept the names the same so you can see what's going on.

Hope this helps.
Regards,
Dan.

Attached Files


A wizard only needs one ball...but can handle six.

#250 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 30 July 2010 - 10:21 AM

That did the trick Wizard's Hat! I also did likewise with the Klink's Office mini playfield and got the desired result. Thank you and Bob for the input! biggrin.gif

I am thinking about altering the plunger next and am going to look at faralos' template to see how it is done.

Edited by Practicedummy, 30 July 2010 - 10:24 AM.

I could have been smart, but I never learned anything by being smart!

 

 


#251 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 30 July 2010 - 11:55 AM

Coded the Klnk's Office and Heroes' drop targets to reset when all of them have been dropped. Now working on adjusting the left part of the loop. Too many cheap drains when the ball exits from the left side of the loop and left target ramp.

I could have been smart, but I never learned anything by being smart!

 

 


#252 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 30 July 2010 - 12:52 PM

Wanting to add a unique type of tilt. Already entered a dim statement: Dim TiltCount As Integer and some code in the tilt keys code blocks that add 1 to the TiltCount every time a tilt key is used.
Just need to know what code to enter that when the TiltCount reaches 10, the tilt keys disabled until the ball drains. Entered if statement: If TiltCount = 10 Then .

Hope I am on the right track. biggrin.gif

I could have been smart, but I never learned anything by being smart!

 

 


#253 Wizards_Hat

Wizards_Hat

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 1,258 posts
  • Location:Manchester, UK

  • Flag: United Kingdom

  • Favorite Pinball: STTNG




  • Trophies:

Posted 30 July 2010 - 01:04 PM

QUOTE (Practicedummy @ Jul 30 2010, 01:52 PM) <{POST_SNAPBACK}>
Wanting to add a unique type of tilt. Already entered a dim statement: Dim TiltCount As Integer and some code in the tilt keys code blocks that add 1 to the TiltCount every time a tilt key is used.
Just need to know what code to enter that when the TiltCount reaches 10, the tilt keys disabled until the ball drains. Entered if statement: If TiltCount = 10 Then .

Hope I am on the right track. biggrin.gif

It's the flippers you really want to disable when tilt happens - you might not want to actually disable the tilt...most times I tilt on a real machine is if the ball gets stuck somewhere and you're trying to free it.

To stop the flippers you only need to add a little to the "if" statements in the keyup & keydown subs.
e.g.
CODE
Sub Table1_KeyUp(byVal keycode)
       If Keycode=LeftFlipperKey and GameOn=true and Tilt=false then LeftFlipper.RotateToEnd

or
       If keycode=LeftFlipperKey and GameOn=true and Tilt<10 then LeftFlipper.RotateToEnd


Whatever you prefer.

Personally I wouldn't just go with the number of tilt key presses - there are several methods that people have used to be much more realistic.

Regards,
Dan.
A wizard only needs one ball...but can handle six.

#254 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 30 July 2010 - 03:27 PM

The reason I want to enable a limited number of tilt key presses is due to the gameplay itself. Due to the design of my table, there is a decent chance for a cheap drain. By giving the player a 10 tilt key press limit, it gives them a good chance to extend gameplay by being able to hammer on a tilt key to alter the ball enough to keep it in play. I know this isn't very lifelike here, but it helps with the gameplay overall. biggrin.gif

I could have been smart, but I never learned anything by being smart!

 

 


#255 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 01 August 2010 - 02:42 AM

Two-thirds of the way done with the project I am doing for my aunt (non-pinball related). Should be back to recording audio for my table towards the end of the week. biggrin.gif

I could have been smart, but I never learned anything by being smart!

 

 


#256 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 03 August 2010 - 03:32 PM

Looks like I have just about everything finished on the table design. Just have to decide on an image for the underground playfield and lights. After I finish the audio recording, will start on the coding (with possibly some help on the harder stuff).

I could have been smart, but I never learned anything by being smart!

 

 


#257 faralos

faralos

    VPF Veteran

  • Members
  • PipPipPipPipPipPip
  • 7,838 posts
  • Location:Eastern Pa,USA

  • Flag: United States of America

  • Favorite Pinball: Flash (Williams) 1979, Flash2 Updated




  • Trophies:

Posted 03 August 2010 - 05:55 PM

well since it's underground, can ya' put in the bunk bed that lifts up to show the shaft leading to their tunnel? or how about just a dark shaft of some sorts with maybe wooden walls or something to that effect? a mine shaft perhaps?
"Don’t let the noise of others’ opinions drown out your own inner voice.
And most important, have the courage to follow your heart and intuition.”
----Steve Jobs


#258 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 04 August 2010 - 12:25 AM

Thought I was almost finished with the playfield desing and completely forgot about the plunger lane! biggrin.gif

Made copies of the plunger lane ,decoration that faralos made for me, changed the texture and added them in a line all the way to the end of the plunger lane:



Most likely gonna have to take a screenshot off one of the dvd's for my underground playfield for a suitable decoration.

Edited by Practicedummy, 04 August 2010 - 12:26 AM.

I could have been smart, but I never learned anything by being smart!

 

 


#259 faralos

faralos

    VPF Veteran

  • Members
  • PipPipPipPipPipPip
  • 7,838 posts
  • Location:Eastern Pa,USA

  • Flag: United States of America

  • Favorite Pinball: Flash (Williams) 1979, Flash2 Updated




  • Trophies:

Posted 04 August 2010 - 02:29 PM

you're right! They do look like bullets, especially since that is the intention now anyways. good going so far, (man, I really am stuck on those trees, they are incredibly done!) Have you decided on the lower table image, yet? You mention that you'll pull a pic off a dvd, or is it gonna be a surprise for us? Maybe better that way (don't want to give away everything just yet!) wink.gif biggrin.gif
"Don’t let the noise of others’ opinions drown out your own inner voice.
And most important, have the courage to follow your heart and intuition.”
----Steve Jobs


#260 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 04 August 2010 - 05:28 PM

Yes I plan to pull a pic off my dvd's. It will be a bit of work to find one without one or more characters being in it but I should be able to manage.

Here's the current work submitted for more playtesting. I have made the ramps non-collidable so the ball can roll under them and hit the kickers which kick the ball back down fast (F-14 Tomcat-like).

Hogan's Heroes 8-4-10

Edited by Practicedummy, 04 August 2010 - 05:39 PM.

I could have been smart, but I never learned anything by being smart!