Wall.isdropped=0 catches ball, how to avoid?

Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #165610
    makmak
    Participant
      @makmak
      Member

      Hi, I need advice for the following: I am using a wall as a time limited “drain-protector” between the flippers. If its activated while a ball is there , the ball gets stuck (no surprise). Is there a way to avoid (besides creating a primitive and let it move up/down)? Thanks!

      #165622
      Thalamus
      Moderator
        @thalamus
        ContributorMemberModerator

        drainwall.collidable = 1 / 0 ?

        1 user thanked author for this post.
        #165629
        makmak
        Participant
          @makmak
          Member

          What will happen to the ball if its set to 1 while the ball is directly over it? The same as like dropped 0/1 or will it jump?

          I will also have a look at “Harley Davidson” table which has such an up-post (thats the right term I guess), if I recall right.  I dont remember other tables with that feature…

          #165632
          rothbauerw
          Moderator
            @rothbauerw
            ModeratorContributorMembervip

            There’s really no good solution for this. Moving primitives don’t work.   Dropped walls will not cause the ball to jump.  I typically address this by checking to see if there’s a ball over the object popping up and I use a timer to make it “jump”.  You can see an example of this on the latest Skitso Medieval Madness with the trolls.  I think someone also did something recently with drop targets, but I don’t remember which table.

            Current Project: Perpetual updates of VPX physics.

            1 user thanked author for this post.
            #165633
            makmak
            Participant
              @makmak
              Member

              The champion pub has this up-post, just remembered. Never noticed strange behaviour on that table (but didnt play a lot). As far as I can see there is no special code to detect the ball location/ ball jump movement? I’ll try and replace my wall with this up-post to see if it works. Shouldnt be too much work.

              #165640
              rothbauerw
              Moderator
                @rothbauerw
                ModeratorContributorMembervip

                Sometimes the table logic is such that a ball can’t be over the post when it pops up.

                Current Project: Perpetual updates of VPX physics.

                #165721
                makmak
                Participant
                  @makmak
                  Member

                  True…havent thought about that. On my table the up-post will pop up at the end of a mode without hitting a dedicated target…so a ball might be on the up-post at that time. If I let the ball jump with the popping post, it might be pushed to the drain – thats the opposite effect of a ballsaver ;-). Therefore I need to check if there is any ball in the area and if so, delay the pop-up until its gone. As I have no clue about coding, can you help me with the part in the brackets? The rest should hopefully work…?

                  Sub endofmode()

                  Uppost

                  End sub

                   

                  Sub uppost()

                  „If there is any ball with a x/y position within a circular area between x/y (center of post) and x + (radius_uppost + radius_ball) and y+ (radius_uppost + radius_ball) then wait 100ms then check again“

                  else

                  primitive_post.transY=45:post.image=“post_lit“

                  wallpost.isdropped=false:light_uppost.state=2

                  downpost.enabled=true

                  End sub

                   

                  Sub downpost_timer()

                  primitive_post.transY=0:post.image=“post_dark“

                  wallpost.isdropped=true:light_uppost.state=0

                  downposttimer.enabled=false

                  End sub

                   

                  Or is it all nonsense and I better use/create a dedicated target? (really not preferred and still a possible conflict if multiball is active…)

                  Thanks so much for your help!

                  #165724
                  Rawd
                  Participant
                    @rawd

                    Instead of checking for ball coordinates, I think you could put a trigger around your post with a variable.  If your ball is in the trigger area, then your post won’t pop up.

                     

                     

                     

                    1 user thanked author for this post.
                    #165725
                    makmak
                    Participant
                      @makmak
                      Member

                      You’re the best! Coding makes me thinking too complicated, this proves I am not good at it…

                      #165729
                      Thalamus
                      Moderator
                        @thalamus
                        ContributorMemberModerator

                        No one is born as coders ;)

                        #165732
                        makmak
                        Participant
                          @makmak
                          Member

                          OK, lets say i am not talented (in coding ;-)

                          #165754
                          makmak
                          Participant
                            @makmak
                            Member

                            Some more anti-talented question

                            I can set a trigger around the uppost, enable it and push post up if it was “unhit” (pretending it was hit before)

                            But how to check if the trigger wasnt hit at all (then push post up immediately)? I dont know a “sub bumpersensor_nothit()”…

                            Or do I just push up the post and at the same time check if the trigger is hit and pull down the post immediately again?

                            #165862
                            Rawd
                            Participant
                              @rawd

                              I am really a terrible coder, but I would try it like this…

                              Run your post popup sub on a timer, that is looking to see if a ball is in the trigger area.

                              If there is no ball on the trigger, then the code runs as normal.  End timer.

                              If there is a ball on the trigger, then keep looping the timer until there isn’t.

                               

                              This should popup the post when the ball leaves the trigger area I think.

                               

                               

                              1 user thanked author for this post.
                              #165945
                              makmak
                              Participant
                                @makmak
                                Member

                                I had sth similar in mind, good to see someone else had the same idea, guess this will make it. I will try and report. Thanks!

                                #166267
                                makmak
                                Participant
                                  @makmak
                                  Member

                                  Heres my solution. Probably possible with less lines but I dont know better and it seems to work. Will it also work with multiball?

                                  There was still the problem that there is no function for “a trigger is not hit” at all. Therefore i had to invent a variable (“check”, with three values 0,1,2).

                                  I needed two timers (1 for the duration of the up-post being up (“walltimer”), 1 for delay purpose(“sensortimer”), a trigger on the playfield on top of the up-post(“popsensor”), with a radius half a ballsize bigger than the up-post itself, and a variable called “check”. The sensortimer does the trick. We assume there is no ball around the up-post ( and set check=2) but first wait a glimpse to check if the trigger is hit (then check=1) (in the sub popupcheck) or if it was hit then wait unntil its unhit (check=0). If the trigger was not hit at all then just proceed with check=2 . If the trigger was hit, then wait a glimpse and check again:

                                  Dim check

                                  sub sthhappensthatleadstopopup-uptheup-post()

                                  popsensor.enabled=true:sensortimer.enabled=true:check=2

                                  end Sub

                                  sub walltimer_timer()
                                  if wall.isdropped=false then wall.isdropped=true:walltimer.enabled=false
                                  end sub

                                  sub popupcheck()

                                  if check=0 then
                                  wall.isdropped=false
                                  walltimer.enabled=true
                                  popsensor.enabled=false
                                  end if

                                  if check=2 then
                                  wall.isdropped=false
                                  walltimer.enabled=true
                                  popsensor.enabled=false
                                  end if

                                  if check=1 then sensortimer.enabled=true

                                  end Sub

                                  sub popsensor_hit()
                                  check=1:popupcheck
                                  end sub

                                  sub popsensor_unhit()
                                  check=0:popsensor.enabled=false:popupcheck
                                  end sub

                                  sub sensortimer_timer()
                                  sensortimer.enabled=false:popupcheck
                                  end sub

                                  #166272
                                  Rawd
                                  Participant
                                    @rawd

                                    Good that you figured out a way to get it to work… Although I still don’t understand a couple of things with what you are doing..

                                    1. On a real machine, if the ball happens to be on top of the popup post when it goes up..  it will roll off of the back of it and down into the drain, most likely.

                                    2. How often is there actually a ball on it when the post pops up?  (It can’t be too common)

                                    3. I’ve tested a wall popping up into a ball on the playfield, and it doesn’t make the ball ‘stuck’ as you describe..   The wall pops up through the ball, and the ball continues to roll through it and down the playfield. (not realistic or correct, but not as you describe)

                                     

                                    I would just code a simple trigger on top of the popup post, and if the ball happens to be on the post when it goes up .. change the balls z velocity and pop it up.

                                    ActiveBall.VelZ=30

                                     

                                     

                                    #166279
                                    makmak
                                    Participant
                                      @makmak
                                      Member

                                      hmm, on my system the ball gets stuck “inside” the wall (maybe yours is not collidable?), then I have to stop the table manually.

                                      Well, maybe it was bad luck, but the first time I have tried the bumper it happened to get stuck ;-) and since then several more times. Most likely table specific. Yes, on a real machine it would be a drainer, but i dont like drains ;-) (I am a really bad player…) and a pinball makes no sense if its much too hard (you want to see all the modes and “levels”) no? ;-)

                                      #166281
                                      Thalamus
                                      Moderator
                                        @thalamus
                                        ContributorMemberModerator

                                        Doesn’t happen very often in real that pinball’s are too easy, but, it does in VP if you ask me. Happy to see that things are going the right way for you though.

                                        #166297
                                        makmak
                                        Participant
                                          @makmak
                                          Member

                                          We´ll see, how many beaches you`ll be able to discover :whistle:   ;-)

                                          #166952
                                          makmak
                                          Participant
                                            @makmak
                                            Member

                                            Problem solved, my solution works very fine for me. Think we can close this topic. Thanks for your Help!

                                          Viewing 20 posts - 1 through 20 (of 20 total)

                                          Forums are currently locked.

                                          ©2024 VPinBall.com

                                          Log in with your credentials

                                          Forgot your details?