Author Topic: Polybuffer is not a pointer. Polygon ignored.  (Read 2301 times)

0 Members and 1 Guest are viewing this topic.

Offline Cloudee1

Polybuffer is not a pointer. Polygon ignored.
« on: November 25, 2015, 03:57:05 PM »
I have been busy working again finally. I had most of SQ1 coded in SCI0 and am now working on converting it over to SCI1.1. I have ran into this issue that seems to occur about 85% of the time.

When entering the Oasis Bar, I get a statement that "Polybuffer is not a pointer. Polygon ignored."

Attached is the image showing the polygons I drew. The one around the skimmer is a named polygon. The others all fall under the default.

Here is the code from the shp:
Code: [Select]
// 35.shp -- Produced by SCI Companion
// This file should only be edited with the SCI Companion polygon editor

(local
    P_Default35[63] = (4 PBarredAccess 5 0 100 30 100 47 104 47 112 0 112 PBarredAccess 9 319 121 319 137 299 139 288 142 229 137 225 131 207 127 195 126 178 121 PBarredAccess 8 133 110 130 108 134 106 154 104 200 102 319 102 319 113 139 113 PBarredAccess 5 113 89 200 89 195 96 151 98 104 96 )
    P_SkimmerPoly[11] = (1 PBarredAccess 4 74 132 105 132 101 150 77 150 )

)

and then, from the room 35 script itself.

Code: [Select]
  (method (init)
        AddPolygonsToRoom(@P_Default35)
        AddPolygonsToRoom(@P_SkimmerPoly)
  (super:init())

As well as the code that changes the room, since it isn't at the edge of the screen had to be coded. The changingRoom test is simply a local variable to prevent the doit method from triggering the statement more than once, just in case.

Code: [Select]
  (method (doit)
  (super:doit())
    (if(not(changingRoom))
      (if(send gEgo:inRect(210 107 320 120))
      = changingRoom TRUE
      (send gRoom:newRoom(62))// Head Inside Bar
      )
    )
  )// end method

The error only seems to be triggered at the room change. I noticed that the polygon procedures both print out this statement when polyBuffer is less than 100... However I don't know what that means or how to address my issue knowing that.
« Last Edit: November 25, 2015, 04:24:56 PM by Cloudee1 »


Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline troflip

Re: Polybuffer is not a pointer. Polygon ignored.
« Reply #1 on: November 25, 2015, 04:31:17 PM »
Can you DEbugPrint (or FormatPrint) the value of @P_Default35 and @P_SkimmerPoly? I was under the assumption that pointers would never be that low. But I suppose it's possible your script got loaded that low.

The check was in there to ensure people don't accidentally pass P_Polygon instead of @P_Polygon. It sounds like it should just be removed.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Cloudee1

Re: Polybuffer is not a pointer. Polygon ignored.
« Reply #2 on: November 25, 2015, 04:44:49 PM »
So I tacked a FormatPrint in the room script
Code: [Select]
      FormatPrint("%d" @P_Default35)
       FormatPrint("%d" @P_SkimmerPoly)

and I got 31322 and 31448 followed by the error text.

Then I went ahead and added a print statement to the addpolygonstoroom procedure in main to pull the polyBuffer value
Code: [Select]
(if (< polyBuffer 100)
TextPrint("polyBuffer is not a pointer. Polygon ignored.")
FormatPrint("%d" polyBuffer)
)

and it gave me -32380
« Last Edit: November 25, 2015, 04:59:11 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline troflip

Re: Polybuffer is not a pointer. Polygon ignored.
« Reply #3 on: November 25, 2015, 05:04:14 PM »
Ok, I'm not sure why you're getting different numbers, but the fix is:

Code: [Select]
(if (< polyBuffer 100)

becomes:

Code: [Select]
(if (<u polyBuffer 100)

(you'll need to make that fix in two places in Main.sc)

We were treating the pointer like a signed number instead of an unsigned number.
Check out my website: http://icefallgames.com
Groundhog Day Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.083 seconds with 24 queries.