Bam MiniPlayfield.MoveTo Rotation direction

madmrmax

Weeeeeee
Site Supporters
Joined
Sep 21, 2017
Messages
519
Solutions
2
Reaction score
250
Points
75
Favorite Pinball Machine
Indiana Jones (Williams)
When using the MoveTo command on a miniplayfield, I'm using it to rotate an object (trunk in Theatre of Magic).

Code:
Call mpTrunk.MoveTo(     175,   280,      63,       0,       0,       90,       1,       1.500)
Call mpTrunk.MoveTo(    175,   280,      63,       0,       0,     180,       1,       1.500)
Call mpTrunk.MoveTo(    175,   280,      63,       0,       0,      270,       1,       1.500)
Call mpTrunk.MoveTo(    175,   280,      63,       0,       0,      0,       1,       1.500)

The question is -- sometimes when rotating I need the rotation to go clockwise, and other times counterclockwise. I'm not seeing how I tell the direction of rotation.

Anyone know?

-mark

cc: @Paolo
 
Just use negative angle (I think).
 
Last edited:
Ohhhh,sorry for that.....I didn't pay much attention in which direction it turns in vpx, clockwise or anticlockwise,so it's not there in the demo.
But.... you put the - in RotZ whre you need it.

Cattura15.JPG

The "Time" if you shouldn't know it......is the speed of the rotary movement, adjusts it if you need to increase or decrease the speed.
Attention, if you adjust this "Time" in MP, you must also adjust the timers of the invisible kickers (you know what they are).
 
Last edited:
Yes just use negative values to rotate the opposite direction.

One thing about MP that is important to know. A MP will rotate to the value given by using the "quickest path". That means that you can't rotate more than 180 within the "time" given.

So...

Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 0, 1, 1.500)
Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 180, 1, 1.500)

will work fine to rotate "clockwise".

However....

Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 0, 1, 1.500)
Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 270, 1, 1.500)

will NOT rotate clockwise! It will rotate counter-clockwise -90 to get to 270, because its quicker to get to it that way since you are trying to rotate more than 180.


So whenever I want to rotate a MP more than 180 (like a full 360) in one continuous movement, I need to use a timer and do two MP rotate commands perfectly one after the other. 0 to 179.9 and 180 to 359.9, etc. If I want it to spin continuously, then have the timer perfectly repeat this.
 
Last edited:
Yes just use negative values to rotate the opposite direction.

One thing about MP that is important to know. A MP will rotate to the value given by using the "quickest path". That means that you can't rotate more than 180 within the "time" given.

So...

Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 0, 1, 1.500)
Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 180, 1, 1.500)

will work fine to rotate "clockwise".

However....

Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 0, 1, 1.500)
Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 270, 1, 1.500)

will NOT rotate clockwise! It will rotate counter-clockwise -90 to get to 270, because its quicker to get to it that way since you are trying to rotate more than 180.


So whenever I want to rotate a MP more than 180 (like a full 360) in one continuous movement, I need to use a timer and do two MP rotate commands perfectly on after that other. 0 to 179.9 and 180 to 359.9, etc. If I want it to spin continuously, then have the timer perfectly repeat this.
Thanks Terry! Perhaps that is what I'm seeing with MP RotZ rotate value

...
'turn clockwise one segment
Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 90, 1, 1.500)
...
' turn clockwise one segment
Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, 180, 1, 1.500)
...
' turn counterclockwise back one segment
Call mpTrunk.MoveTo( 175, 280, 63, 0, 0, -90, 1, 1.500)
...

the "-90" is ignored as a means to turn counterclockwise, and instead it just moves clockwise. It baffles me on why, so I'll investigate the timer perhaps.

-mark
 
For clockwise, go from 0 to 90, then 90 to 180, then 180 to 270, then 270 to 0. That should work.

Then just use the reverse for going the opposite direction. 0 to 270, then 270 to 180, then 180 to 90, then 90 to 0.

You can use a variable to keep track of your rotated position, and then use whatever MP values you need for rotating based on that variable's setting. Like BoxWall_position = "magnet", etc. Just set that value after the box have rotated completely to each position.


I had to manage this kind of thing A LOT for the BumperHead toy in MOTU CE, as it's MP both rotates for timed events, but also rotates when hit on the targets, and has full collisions, and also would transport balls meant to be destroyed, etc.
 
Last edited:
For clockwise, go from 0 to 90, then 90 to 180, then 180 to 270, then 270 to 0. That should work. (for clockwise).

Then just use the reverse for going the opposite direction. 0 to 270, then 270 to 180, then 180 to 90, then 90 to 0.
Nice that worked. I didn't understand the concept at first but once I drew out the negative and positive rotation values on paper I could visualize what's going on.

You can use a variable to keep track of your rotated position, and then use whatever MP values you need for rotating based on that variable's setting. Like BoxWall_position = "magnet", etc. Just set that value after the box have rotated completely to each position.

Yeah, I think that will be a great helper function/additional code. That away elsewhere in logic I can just state what action needs to happen and then the logic of figuring out how to get to that side (e.g. magnet) would be elsewhere.
 
Ohhhh,sorry for that.....I didn't pay much attention in which direction it turns in vpx, clockwise or anticlockwise,so it's not there in the demo.
But.... you put the - in RotZ whre you need it.

View attachment 43467

The "Time" if you shouldn't know it......is the speed of the rotary movement, adjusts it if you need to increase or decrease the speed.
Attention, if you adjust this "Time" in MP, you must also adjust the timers of the invisible kickers (you know what they are).
That was it! Thank you @Paolo !

As I mentioned in a reply to Terry - I didn't understand what was going on here until I drew out a circle and put the positive and negative numbers in there.

Everything is coming together on integrating your awesome work on the trunk!!
 
No problem,Mark @madmrmax
Running(turn) a "model/toy" with MP in every sense may seem difficult for the first time, once you understand the system and what values to put (by experimenting) everything will seem easier....
In my demo you don't see negative values, also for the reasons Terry explains, the negative values or rather the direction, are based on the start of the movement from which you want to decide it starts, then the rest comes by itself

For my part I always prefer to use the FP method which I have mastered very well, I have animated everything using FP, t-rex, dragons, weapons, space ships, trunks, coins,supermario, princess,crocodile,etc etc.... but for this type of toy(trunk of TOM) is not possible for the moment, but I am waiting for a response from Rav, if it is positive we could eliminate the wall around the trunk.
 
Last edited:
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
  • Chat Bot Mibs Chat Bot Mibs:
    DrazeScythe has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Torntabittz has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    brotherboard has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    GARRY040 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    BL2K has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Chilldog has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    rodneyfitz has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    ace19120 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Tomasaco has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Greek_Jedi has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Beermano has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    02browns has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    nitram1864 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    aeponce has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    JEAN LUC has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    lorenzom has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    maxangelo19 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Dragonslapper has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    royaljet has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Tyfox has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Goldtopboy has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    slick267 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    dabreeze has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Spike has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Tofa has left the room.
      Chat Bot Mibs Chat Bot Mibs: Tofa has left the room.
      Back
      Top