Jump to content



Photo
- - - - -

Move Primitives Smoothly?

primitive

  • Please log in to reply
4 replies to this topic

#1 CrimsonTurtle8

CrimsonTurtle8

    Enthusiast

  • Members
  • PipPipPip
  • 386 posts
  • Location:US

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

  • Favorite Pinball: Theatre of Magic

Posted 06 December 2023 - 09:16 PM

Can you automatically move primitives around smoothly the way FP could? I saw a tutorial in the forum to rotate a primitive one tick every few milliseconds and looping a Timer to keep rotating it. I got that to work fine. So I assume based on this post that you can't just say Primitive1.TransZ = 200 or whatever and get it to smoothly slide over? FP must have interpolated those frames in some way, but it seems like with VP I have to move the primitive a tiny tick at a time for every single motion I want it to make? That's fine, I guess. Just a pain. Right now, everything is instant. Which is also fine and functional, just a little tacky. Thanks!



#2 unclewilly

unclewilly

    sofa king.....

  • VIP
  • 5,170 posts
  • Location:Baltimore, Maryland

  • Flag: United States of America

  • Favorite Pinball: tz, tom, big hurt, who dunnit



Posted 07 December 2023 - 01:40 AM

It depends on what you are doing. I made a table that had a primitive afm ship that would follow an invisible ball around the playfield controled by magnet objects using a real-time timer set to -1 and updating the primitive coordinates to the balls coordinates.
So it really depends on what you are doing.

The original shake for the main afm ship jp did using a hidden ball under the apron and shaking the ship based on the ball position.
There are a lot of ways to make th8ngs move smoothly it just depends on what you are try8ng to do

"it will all be ok in the end, if it's not ok, it's not the end"
 
Monster Bash VP10 WIP https://dl.dropboxus... (vpx)WIP15.vpx

uw2.gif


#3 bigus1

bigus1

    Pinball Fan

  • Members
  • PipPipPipPip
  • 951 posts
  • Location:Brisbane, Australia

  • Flag: Australia

  • Favorite Pinball: Firepower

Posted 07 December 2023 - 03:07 AM

Add a Timer1 to the table, not enabled with interval 10.  Interval changes the speed of movement.

Add a thing for a trigger and the code below will move prim1 smoothly across the table to x of 800 when hit.

Make sure prim1 has an active material and static rendering unticked.

 

Sub thing_hit:Timer1.enabled = 1:end sub

Sub Timer1_timer()

prim1.x = prim1.x + 1

if prim1.x >= 800 then Timer1.enabled = 0

End Sub



#4 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 07 December 2023 - 11:52 AM

Yes, use a timer. Best solution, maybe the only :)



#5 CrimsonTurtle8

CrimsonTurtle8

    Enthusiast

  • Members
  • PipPipPip
  • 386 posts
  • Location:US

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

  • Favorite Pinball: Theatre of Magic

Posted 07 December 2023 - 03:19 PM

Add a Timer1 to the table, not enabled with interval 10.  Interval changes the speed of movement.

Add a thing for a trigger and the code below will move prim1 smoothly across the table to x of 800 when hit.

Make sure prim1 has an active material and static rendering unticked.

 

Sub thing_hit:Timer1.enabled = 1:end sub

Sub Timer1_timer()

prim1.x = prim1.x + 1

if prim1.x >= 800 then Timer1.enabled = 0

End Sub

 

Thanks, this makes a lot of sense -- namely the > symbol stopping it once it reaches a certain value. I have them at Z 200, so i was worried I'd have to figure out a way to carefully time it to stop them from moving once they got where I want, but I can just end the timer at 200. I appreciate the help!!!


It depends on what you are doing. I made a table that had a primitive afm ship that would follow an invisible ball around the playfield controled by magnet objects using a real-time timer set to -1 and updating the primitive coordinates to the balls coordinates.
So it really depends on what you are doing.

The original shake for the main afm ship jp did using a hidden ball under the apron and shaking the ship based on the ball position.
There are a lot of ways to make th8ngs move smoothly it just depends on what you are try8ng to do

Yeah the example I first saw was Austin Powers spinning in sync with the spinner, which blew my mind. I have no use for that, but it is cool that you can link a primitive's motion to other things.







Also tagged with one or more of these keywords: primitive