general scripting help

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #147313
    Tom
    Participant
      @armyaviation

      Need some general scripting help.  How would I script the following scenarios.

      (1)  If L65a (light) state is on, then primitive029 (bumper ring) has image ” xxxxx  ON”  and primitive 030 (bumper cap) has image “xxx ON”and when off image “xxxxOFF”.

      (2) If L31 (light) state is on, then Flasher26 (flasher) is on .

      (3) If Flasher17 (flasher) is on and Flasher 18 is off, then primitive X “image xxxx”, If Flasher 17 is off and Flasher 18 is on, then Primitive X “image”, if flasher 17 is on and flasher 18 is on, then Primitive X “image”

      Thanks!!!

      #147319
      Thalamus
      Moderator
        @thalamus

        If bumperlight1.state=1 and GI_1.state=1 then bumperL_prim.image=”cap1ON”

        – the general form.

        #147321
        Tom
        Participant
          @armyaviation

          If L49a.state=1 then Primitive024.image=”bumpercap1ON”
          If L49a.state=0 then Primitive024.image=”bumpercap1OFF”

          Is this right? I was only going to use two images, so does GI need to be in there.  Does it have to be in a sub?

          #147326
          bord
          Moderator
            @bord

            I have comparable examples in Goin’ Nuts, Black Knight… They aren’t in front of me but you should be able to find how they work in the script pretty easily.

            #147329
            Tom
            Participant
              @armyaviation

              @Bord, I was looking at your Centaur and that was more complex than I care to make it!!!or comprehend

              #147331
              Thalamus
              Moderator
                @thalamus

                No. GI doesn’t need to be there if you don’t have a GI to manipulate. Sub needed ? Depends. Maybe just put it inside a fast timer like the flippers ?

                Pseudo-code follows ( which is very UNUSEFUL for flippers I should add )

                sub flip_timer()

                if bumperlight.state = 1

                then

                prim1.image=”oh crap”

                prim2.image=”more crap”

                end if

                end sub

                I highly recommend that you download the script repo : https://github.com/sverrewl/vpxtable_scripts

                Then extract all those scripts to a folder somewhere and use a tool like https://www.nirsoft.net/utils/search_my_files.html to find what you’re looking for inside many hundred of thousand of code lines. Should be plentiful of good examples and that tool works partly like a unix grep. Of course, you kind of need to know what your looking for, but, still.

                 

                #147334
                Tom
                Participant
                  @armyaviation

                  I don’t have that downloaded but I do reference that site, thanks for that.

                  I was going to ask if I needed a timer to get it to work? Cause it aint workin.lol

                  #147337
                  Tom
                  Participant
                    @armyaviation

                    I copied the flipper timer and made a light timer because I didn’t want to interfere with anything already happening??? does this look ok, sill not working

                    ‘**********************************************
                    ‘Special Light States
                    ‘**********************************************

                    Sub LightTimer()

                    if L49a.State=1 then
                    bumperring1.image=”bumperring1GION”
                    bumpercap1.image=”bumpercap1ON”
                    end if
                    if L49a.State=0 then
                    bumperring1.image=”bumperring1GIOFF”
                    bumpercap1.image=”bumpercap1OFF”
                    end if
                    if L65a.State=1 then
                    bumperring2.image=”bumperring1GION”
                    bumpercap2.image=”bumpercap1ON”
                    end if
                    if L65a.State=0 then
                    bumperring2.image=”bumperring1GIOFF”
                    bumpercap2.image=”bumpercap1OFF”
                    end if
                    if L81a.State=1 then
                    bumperring3.image=”bumperring1GION”
                    bumpercap3.image=”bumpercap1ON”
                    end if
                    if L81a.State=0 then
                    bumperring3.image=”bumperring1GIOFF”
                    bumpercap3.image=”bumpercap1OFF”
                    end if
                    End Sub

                    #147343
                    Thalamus
                    Moderator
                      @thalamus

                      If things ain’t working – put some debug.print here and there to figure out what is going on. Might it be that something isn’t set to visible maybe ? .visible and .state both need to have non-zero values. Depends on object if I remember correctly. Flasher vs Light. You have to look at the command ref.

                      Not the best code I’ve seen, but not directly wrong either. Just more processing than needed. This is a one or the other code – so why not use

                      if xxx then

                      ….

                      else

                      end if

                      #147348
                      Tom
                      Participant
                        @armyaviation

                        I have no clue what the hell I am doing….. I just spent the last hour trying to get the light to just shine through the cap instead of swapping images.  Cant even get that to work… think its bed time for tonight!

                        #147354
                        32assassin
                        Participant
                          @32assassin

                          your code might be working

                          but you could have the primitives set to “Static Rendering” or using a material that keeps the Lights from shining through the primitive or preventing image swapping

                           

                          based on those numbers I can tell this is for Party Animal

                          is their a reason why you are not mapping this so that they are controlled by the rom and not the (rom controlled) light

                          all that code can be done in 2 lines per bumper followed by 2 NfadeL lines IF  you want the light objects under the bumper caps

                          with Jps lights

                          NFadeObjm 49, bumperring1, “bumperring1GION”, “bumperring1GIOFF”

                          NFadeObjm 49, bumpercap1, “bumpercap1ON”, “bumpercap1OFF”

                           

                          NFadeObjm 65, bumperring2, “bumperring1GION”, “bumperring1GIOFF”

                          NFadeObjm 65, bumpercap2, “bumpercap1ON”, “bumpercap1OFF”

                           

                          NFadeObjm 81, bumperring3, “bumperring1GION”, “bumperring1GIOFF”

                          NFadeObjm 81, bumpercap3, “bumpercap1ON”, “bumpercap1OFF”

                           

                          again make sure that “Static Rendering” is not set on the primitives.

                           

                          ( 2)

                          NfadeLm 31, L31

                          Flash 31,  Flasher26

                           

                          and if you  remove static rendering from the primitives and set the depth bias to 200  the bumper lights look pretty good

                          Capture

                           

                          see a table you like help me find the resources so that I can finish it
                          https://www.dropbox.com/sh/7qtake9whi5ium2/AAB4K4W78oMVlqSxTzKtGHTHa?dl=0

                          see a table you like help me find the resources so that I can finish it
                          https://www.dropbox.com/sh/7qtake9whi5ium2/AAB4K4W78oMVlqSxTzKtGHTHa?dl=0

                          1 user thanked author for this post.
                          Tom
                          #147381
                          Tom
                          Participant
                            @armyaviation

                            For the last couple days I have been struggling to understand why the light wouldn’t light up the bumpers…. thanks

                            0FA248FC-9F09-4C8C-94FE-DD779246FDBB

                             

                            #147479
                            Tom
                            Participant
                              @armyaviation

                              figured out

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

                            Forums are currently locked.

                            ©2024 VPinBall.com

                            Log in with your credentials

                            Forgot your details?