Jump to content



Photo
- - - - -

Ramps Dropables Tutorial


  • Please log in to reply
64 replies to this topic

#1 requlem

requlem

    Enthusiast

  • VIP
  • 319 posts

  • Flag: Argentina

  • Favorite Pinball: Addams family



Posted 12 June 2011 - 12:05 AM

Ramp Dropable Tutorial

Version: 1.1
Category: Tutorials

Author(s): Zedonius

Description:
Here is an example of ramp dropables (works only with alpha ramps)
If keycode=32 then 'Use "D" to Drop the ramp
Ramp1.WidthBottom=0 'Sets the Width to 0 so has the appearance of not being there
Ramp1.WidthTop=0
Ramp1.Collidable=false 'Ball does not interact with ramp
End If

If keycode=19 then 'Use "R" to raise the ramp
Ramp1.WidthBottom=250 'Sets the width of the ramp to make it "appear"
Ramp1.WidthTop=250 ' - these values can be set to anything, not necessarily the initial ramp values
Ramp1.Collidable=true 'Ball does now interact with ramp
End If

Light1.state = 1 'Refresh the light state to force VP to re-draw the whole playfield
Light1.state = 0

View File

Submitted by requlem, on Jun 11 2011, 08:05 PM

Edited by requlem, 12 June 2011 - 04:24 PM.

If someone wants help to the cause or are grateful with my creations. You can donate without compromises to https://www.paypal.me/Zedonius

#2 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 12 June 2011 - 01:12 AM

What are ramp dropables? I'm confused.

#3 Practicedummy

Practicedummy

    Multi-Level Madman

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

  • Flag: United States of America

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


  • Trophies:

Posted 12 June 2011 - 01:24 AM

Ramps that can pop up or go down when a certain event happens in a pinball game. Think of PinBot.

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

 

 


#4 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 12 June 2011 - 03:50 AM

QUOTE (rob046 @ Jun 11 2011, 07:12 PM) <{POST_SNAPBACK}>
What are ramp dropables? I'm confused.


Requiem recently discovered that you can change a ramps width/height in real-time, by turning a light state on and off to refresh. It is news to me.. and wonderful news. smile.gif

I am imagining the possibilities of animating models with timers this way. I am curious how the ball is affected on a moving ramp. I am going to look more into this when I have some time off.

THANKS Requiem!

Edit: Your demo table doesn't seem to work. The flippers and plunger are not releasing when you let go of the key... and the ramp is not animating. hmm.

Edit2: You have (2) Table1_KeyUp(ByVal keycode) subs. I integrated the ramp code into the first one, and deleted the other. The flippers and plunger now work, but the ramp is still not moving. hmmm

Edit3: I tried this..

Sub Table1_KeyDown(ByVal keycode)

If keycode = PlungerKey Then
Plunger.PullBack
End If

If keycode = LeftFlipperKey Then
LeftFlipper.RotateToEnd
PlaySound "FlipperUp"
Ramp1.WidthBottom = 0
Ramp1.WidthTop = 0
Light1.state = 1
Light1.state = 0

End If



And.....

Sub Table1_KeyUp(ByVal keycode)

If keycode = PlungerKey Then
Plunger.Fire
End If

If keycode = LeftFlipperKey Then
LeftFlipper.RotateToStart
PlaySound "FlipperDown"
Ramp1.WidthBottom = 250
Ramp1.WidthTop = 250
Light1.state = 1
Light1.state = 0
end if



No luck with that either... Now I am really confused..

Edit 4: I added an image to the light. The table starts with the light off. When I press the flipper the light comes on, and remains on. Shouldn't it pretty much be shut off all the time, and maybe come on for a split second when you hit the flipper?

Has anyone else been able to get the demo table working?

Edited by Rawd, 12 June 2011 - 04:57 AM.


 


#5 requlem

requlem

    Enthusiast

  • VIP
  • 319 posts

  • Flag: Argentina

  • Favorite Pinball: Addams family



Posted 12 June 2011 - 05:29 AM

QUOTE (Rawd @ Jun 12 2011, 12:50 AM) <{POST_SNAPBACK}>
QUOTE (rob046 @ Jun 11 2011, 07:12 PM) <{POST_SNAPBACK}>
What are ramp dropables? I'm confused.


Requiem recently discovered that you can change a ramps width/height in real-time, by turning a light state on and off to refresh. It is news to me.. and wonderful news. smile.gif

I am imagining the possibilities of animating models with timers this way. I am curious how the ball is affected on a moving ramp. I am going to look more into this when I have some time off.

THANKS Requiem!

Edit: Your demo table doesn't seem to work. The flippers and plunger are not releasing when you let go of the key... and the ramp is not animating. hmm.

Edit2: You have (2) Table1_KeyUp(ByVal keycode) subs. I integrated the ramp code into the first one, and deleted the other. The flippers and plunger now work, but the ramp is still not moving. hmmm

Edit3: I tried this..

Sub Table1_KeyDown(ByVal keycode)

If keycode = PlungerKey Then
Plunger.PullBack
End If

If keycode = LeftFlipperKey Then
LeftFlipper.RotateToEnd
PlaySound "FlipperUp"
Ramp1.WidthBottom = 0
Ramp1.WidthTop = 0
Light1.state = 1
Light1.state = 0

End If



And.....

Sub Table1_KeyUp(ByVal keycode)

If keycode = PlungerKey Then
Plunger.Fire
End If

If keycode = LeftFlipperKey Then
LeftFlipper.RotateToStart
PlaySound "FlipperDown"
Ramp1.WidthBottom = 250
Ramp1.WidthTop = 250
Light1.state = 1
Light1.state = 0
end if



No luck with that either... Now I am really confused..

Edit 4: I added an image to the light. The table starts with the light off. When I press the flipper the light comes on, and remains on. Shouldn't it pretty much be shut off all the time, and maybe come on for a split second when you hit the flipper?

Has anyone else been able to get the demo table working?


i download it for test and is working. Red ramp destroyed and Blue ramp apear. Ramp1 under Ramp2 (Ramp1 disapear and showing Ramp2)

Edited by requlem, 12 June 2011 - 05:37 AM.

If someone wants help to the cause or are grateful with my creations. You can donate without compromises to https://www.paypal.me/Zedonius

#6 ynneBBenny

ynneBBenny

    Benny

  • Charter Member
  • 419 posts
  • Location:Melbourne Australia

  • Flag: Australia

  • Favorite Pinball: Fire Power

Posted 12 June 2011 - 06:14 AM

Yes the plunger and flippers stick in position on my computer too.

#7 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 12 June 2011 - 06:16 AM

QUOTE (WWW @ Jun 12 2011, 12:14 AM) <{POST_SNAPBACK}>
Yes the plunger and flippers stick in position on my computer too.


Is your ramp animating?

QUOTE (requlem @ Jun 11 2011, 11:29 PM) <{POST_SNAPBACK}>
i download it for test and is working. Red ramp destroyed and Blue ramp apear. Ramp1 under Ramp2 (Ramp1 disapear and showing Ramp2)


Very strange.

Edited by Rawd, 12 June 2011 - 06:18 AM.


 


#8 ynneBBenny

ynneBBenny

    Benny

  • Charter Member
  • 419 posts
  • Location:Melbourne Australia

  • Flag: Australia

  • Favorite Pinball: Fire Power

Posted 12 June 2011 - 06:17 AM

QUOTE (Rawd @ Jun 12 2011, 04:16 PM) <{POST_SNAPBACK}>
QUOTE (WWW @ Jun 12 2011, 12:14 AM) <{POST_SNAPBACK}>
Yes the plunger and flippers stick in position on my computer too.


Is your ramp animating?


Nup

EDIT I tried it in VP 8 and 9

Edited by WWW, 12 June 2011 - 06:18 AM.


#9 requlem

requlem

    Enthusiast

  • VIP
  • 319 posts

  • Flag: Argentina

  • Favorite Pinball: Addams family



Posted 12 June 2011 - 06:30 AM

plunger and flippers stick but if you click Left flipper and Right Flipper ramp drops. This code is for test purpose, you cannot implemet to your pinball like this

Edited by requlem, 12 June 2011 - 06:33 AM.

If someone wants help to the cause or are grateful with my creations. You can donate without compromises to https://www.paypal.me/Zedonius

#10 Wizards_Hat

Wizards_Hat

    Pinball Fan

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

  • Flag: United Kingdom

  • Favorite Pinball: STTNG




  • Trophies:

Posted 12 June 2011 - 06:37 AM

Fantastic find!! Properly droppable ramps are going to be cool.

It did work for me...but I found it slightly confusing.

I also moved the code so that there was only one Keyup sub.
I have adapted it so that it only has one ramp - and that the ramp touches the playfield - i.e. is actually a ramp not a flat surface floating above the playfield.
I also added colliable true/false to the script so that a "dropped" ramp will not interfere with the ball.

Now I have it so that pressing D "Drops" the ramp, and pressing R "Raises" the ramp.

As this is a mod of someone else's work - I will not post it here until Requlem says it's ok.

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

#11 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 12 June 2011 - 06:40 AM

QUOTE (requlem @ Jun 12 2011, 12:30 AM) <{POST_SNAPBACK}>
plunger and flippers stick but if you click Left flipper and Right Flipper ramp drops. This code is for test purpose, you cannot implemet to your pinball like this


The problem is that my ramp is not working. This is strange that it works on your machine and not ours.

QUOTE (Wizards_Hat @ Jun 12 2011, 12:37 AM) <{POST_SNAPBACK}>
Fantastic find!! Properly droppable ramps are going to be cool.

It did work for me...but I found it slightly confusing.

I also moved the code so that there was only one Keyup sub.
I have adapted it so that it only has one ramp - and that the ramp touches the playfield - i.e. is actually a ramp not a flat surface floating above the playfield.
I also added colliable true/false to the script so that a "dropped" ramp will not interfere with the ball.

Now I have it so that pressing D "Drops" the ramp, and pressing R "Raises" the ramp.

As this is a mod of someone else's work - I will not post it here until Requlem says it's ok.

Regards,
Dan.


Works for you. Damn. Now I am REALLY confused.


 


#12 requlem

requlem

    Enthusiast

  • VIP
  • 319 posts

  • Flag: Argentina

  • Favorite Pinball: Addams family



Posted 12 June 2011 - 06:48 AM

it works. I have Visual Pinball 912

PD: Do you have Device rendering enabled?

Edited by requlem, 12 June 2011 - 06:50 AM.

If someone wants help to the cause or are grateful with my creations. You can donate without compromises to https://www.paypal.me/Zedonius

#13 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 12 June 2011 - 06:58 AM

QUOTE (requlem @ Jun 12 2011, 12:48 AM) <{POST_SNAPBACK}>
it works. I have Visual Pinball 912

PD: Do you have Device rendering enabled?


I am also on 912. Vista64bit. I just tested with hardware rendering off and on. I will test it on my windows xp cabinet tomorrow.

All I see is a blue ramp that never disappears.


 


#14 requlem

requlem

    Enthusiast

  • VIP
  • 319 posts

  • Flag: Argentina

  • Favorite Pinball: Addams family



Posted 12 June 2011 - 07:05 AM

I upload a new modified version coded by Wizards_Hat thx for this dude. You can try with this.
If someone wants help to the cause or are grateful with my creations. You can donate without compromises to https://www.paypal.me/Zedonius

#15 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 12 June 2011 - 07:13 AM

QUOTE (requlem @ Jun 12 2011, 01:05 AM) <{POST_SNAPBACK}>
I upload a new modified version coded by Wizards_Hat thx for this dude. You can try with this.


I got out of bed to check this out. it doesn't work here. sad.gif

I tried sliding the alpha slider, hd render on and off, reorder objects.


 


#16 ynneBBenny

ynneBBenny

    Benny

  • Charter Member
  • 419 posts
  • Location:Melbourne Australia

  • Flag: Australia

  • Favorite Pinball: Fire Power

Posted 12 June 2011 - 07:14 AM

Using VP 8 the flippers and plunger now work, but the minute you raise or lower you get the error as in the pic attached.
Using VP912 all works but the raise lower just does nothing without an error message though.

Attached Files


Edited by WWW, 12 June 2011 - 07:16 AM.


#17 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 12 June 2011 - 07:23 AM

QUOTE (WWW @ Jun 12 2011, 01:14 AM) <{POST_SNAPBACK}>
Using VP912 all works but the raise lower just does nothing without an error message though.


I am kind of glad that it is not just me, but I hope we can get to the bottom of this because it is an excellent feature in VP. I see JP already updated Dracula to use this, so I will have to test that as well.

Edited by Rawd, 12 June 2011 - 07:23 AM.


 


#18 Wizards_Hat

Wizards_Hat

    Pinball Fan

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

  • Flag: United Kingdom

  • Favorite Pinball: STTNG




  • Trophies:

Posted 12 June 2011 - 09:49 AM

QUOTE (WWW @ Jun 12 2011, 08:14 AM) <{POST_SNAPBACK}>
Using VP 8 the flippers and plunger now work, but the minute you raise or lower you get the error as in the pic attached.
Using VP912 all works but the raise lower just does nothing without an error message though.

You would definately get that error in VP8 as collidable was only added with VP9.

Very odd that it works here (I just re-downloaded it to make sure it hadn't got corrupted), but not for you guys. I'm going to try it on my laptop & see what happens there.

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

#19 rascal

rascal

    two-faced as they come

  • VIP
  • 1,374 posts
  • Location:Indiana USA

  • Flag: United States of America

  • Favorite Pinball: Bally Eight Ball



Posted 12 June 2011 - 12:55 PM

It worked for me! dblthumb.gif

I also added 7 more ramps and put them in a collection to animate the raising and lowering of the ramp. If you're interested it is attached. I was too lazy to comment the code, shame on me. Great find requlem! dblthumb.gif

Attached Files


Edited by rascal, 12 June 2011 - 12:56 PM.

Posted Image


#20 Rawd

Rawd

    Pinball Wizard

  • VIP
  • 4,313 posts
  • Location:Edmonton, Canada

  • Flag: Canada

  • Favorite Pinball: Triple Strike



Posted 12 June 2011 - 02:06 PM

QUOTE (rascal @ Jun 12 2011, 06:55 AM) <{POST_SNAPBACK}>
It worked for me! dblthumb.gif

I also added 7 more ramps and put them in a collection to animate the raising and lowering of the ramp. If you're interested it is attached. I was too lazy to comment the code, shame on me. Great find requlem! dblthumb.gif


What the heck??? Rascals version works here!!!!