Page 1 of 1

[Since ZScript] Bouncing bugginess

PostPosted: Sat Dec 17, 2016 6:14 pm
by Major Cooke
Code: Select allExpand view
Class D : Actor
{
   Actor rr;
   Default
   {
      Monster;
      -COUNTKILL
      +NODAMAGE
      +NOPAIN
      +DONTTHRUST
      Radius 32;
      Height 56;
   }
   States
   {
   Spawn:
      PLAY A 1 NoDelay
      {
         if (A_CheckFloor("Null"))
         {
            Vector3 rocketpos = Vec3Angle(0, angle, height + 12);
            rr = Spawn("BouncyRocket",rocketpos);
            if (rr)
            {
               let br = BouncyRocket(rr);
               if (br)
               {
                  br.angle = angle;
                  br.A_ChangeVelocity(1,0,-4,CVF_REPLACE);
                  return ResolveState(1);
               }
            }
            Destroy();
         }
         return ResolveState(null);
      }
      Wait;
      PLAY A 1
      {
         if (!rr)   Destroy();
      }
      Wait;
   }
}


BouncyRocket code is different for each scenario to demonstrate relative bugs. Note, for this experiment, just summon D, not BouncyRocket.
Spoiler: Scenario 1


Spoiler: Scenario 2


Spoiler: Scenario 3

Re: [Since ZScript] Bouncing bugginess

PostPosted: Fri Dec 23, 2016 12:03 pm
by Major Cooke
Ugh. Wish I could find the commit where this changed but I will say it was during one of the refactors. I saw something about the onmobj flag, I think. Still searching for it...

Re: [Since ZScript] Bouncing bugginess

PostPosted: Mon Dec 26, 2016 3:45 pm
by Graf Zahl
Sadly these tests are perfectly useless because I cannot go back far enough in commit history to test them on pre-ZScript versions. All I can see is that they do not work, but it's impossible to find out when this broke.

Re: [Since ZScript] Bouncing bugginess

PostPosted: Mon Dec 26, 2016 4:07 pm
by Major Cooke
Ugh, damn it all to hell. Welp! Looks like I'm going to be pulling in the bounce states for use after all... This is gonna suck.

Re: [Since ZScript] Bouncing bugginess

PostPosted: Mon Dec 26, 2016 5:27 pm
by Graf Zahl
This cost me quite a bit of time to figure out:

You forgot to set a bounce type. Bouncing missiles require the CANPASS flag, but nothing in your definition sets it, it either needs to be done explicitly or by specifying a bounce type.

Re: [Since ZScript] Bouncing bugginess

PostPosted: Mon Dec 26, 2016 5:36 pm
by Major Cooke
Scenario 2 and 3 has a bounce type. But, shouldn't Projectile; do that CANPASS business?

Re: [Since ZScript] Bouncing bugginess

PostPosted: Mon Dec 26, 2016 5:44 pm
by Graf Zahl
No. The problem is in the bouncing code, it needs that flag or it won't work.

The rest of this problem is the same issue as the other one I closed a few hours ago. This is not something that's easily fixed because the logic is so screwed up.