Magnetic field help

AnonTet

Pinball Master
Site Supporters
Joined
Jun 21, 2020
Messages
2,036
Solutions
1
Reaction score
1,195
Points
125
Favorite Pinball Machine
Indiana Jones
So, i'm trying to add xBAM magnetic field to a table and i'm surely missing something so simple that I'm overlooking it.

I tried with coordinates (as example below) and tied to a trigger / light coordinate but without results.

The flow is, I press the magnasave button, and if certain criteria is met, magnet is active and set. In debug I can see it is. But the ball is ignored nonetheless.

The timers exist on the table and the false conditions are also set in endofball and resetfornewgame

I have set:
Code:
Dim leftMagnaSave        '                                X        Y        Z    Range Strength
Set leftMagnaSave        = xBAM.CreateMagneticField(    474,     708,       0,      40,      0)

on key pressed, if conditions are met:
Code:
      If KeyCode = GetKeyCode(Special1Key) Then
            If (LightMagnetLeft.State = BulbOn) Then
                LeftMagnetSwitch = TRUE
                LeftMagnetTimer.Set TRUE, 5000
                leftMagnet()
            End If
        End If

The sub called from above
Code:
Sub LeftMagnet()
    leftMagnaSave.Strength = 10
    LightLeftInLane.FlashForMs 5000, 100, BulbOn
End Sub

The sub _expired
Code:
Sub LeftMagnetTimer_Expired()
    LeftMagnetTimer.Enabled = FALSE
    leftMagnaSave.Strength = 0
    LightMagnetLeft.State = BulbOff
    LeftMagnetSwitch = FALSE
End Sub

I have checked the example table in bam examples thread and gopinball link as well, but i'm stuck. I looked at TOTAN table and... not sure I get it and it's too complex for what I want anyway.

Hints, tips, a post I've missed with the "hidden features" :D, anything will help for sure so, thanks in advance.
 
Is the magnet on playfield at elevation of zero or on a ramp ?
And the location of magnet is X = 474 and y = 708 correct ?

you can try increasing Range to a crazy number like 500 and see if it works.

If you call it "magneticfield_0" instead of "leftMagnaSave" then it will appear in the magnetic field testing tool in BAM menu and you can adjust it on the fly .....did you read my tutorial on this ?
 
I knew it would be something universally stupid... but of of course, I could not miss the chance of embarrassing myself yet again.

I was testing the left magnet because of the mouse in right hand for manually set the conditions needed. As soon as I've read your second question, X=474 lit a very bright bulb was lit in my very small brain...

It was a C&P issue. Obviously LEFT means x=73 (in my case) and not 474 which is obviously to the right. I'm pretty sure you got it the moment you saw that so I appreciate not calling me an idiot right away even though you'd be right.

And now I remember the first reason why I quit programming... I hate debugging code after I had to do it in COBOL (you read right) and wasted 3 days looking for a _space_ ... :banghead:
 
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