Jump to content


Photo

Draw_line_width_color Causing "unexpected Error"


  • This topic is locked This topic is locked
11 replies to this topic

#1 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 18 December 2008 - 06:27 PM

I seem to have found a bug in the way GM handles the draw_line_width_color function. My game started throwing some "unexpected errors" around, and after some checking I've narrowed it down to a problem with draw_line_width_color. It seems whenever (x1,y1) equals (x2,y2) (i.e. a zero-width line).

Now, I'm not trying to make a 0-width line on purpose, but the endpoints of the line depend on the positions of two objects. When the objects pass each other, the unexpected error shuts down the game.

So is there anything I can do to try and stop this from happening? Or is it a bug in GM's processing? Both draw_line_color and draw_line_width seem to work fine on 0-width lines, but the combination, draw_line_width_color, kills the program.

-IMP ;) :P
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#2 flexaplex

flexaplex

    GMC Member

  • Global Moderators
  • 4814 posts
  • Version:GM8

Posted 18 December 2008 - 06:32 PM

Icuurd reported the same bug to me a few weeks ago, however I cannot replicate it.

Edited by flexaplex, 19 December 2008 - 11:39 PM.

  • 0
:]

#3 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 18 December 2008 - 06:37 PM

Well, (if I'm looking at the right things) my laptop has the following specs:

-Windows Vista 32-bit Home Edition SP1

-Mobile Intel 965 Express Chipset display adapter

-DemoForge Mirage display driver

-3.00GB RAM

-1.833GHz Intel Core 2 Duo processor

And I'm running GM7 Pro.

Does that help pinpoint the issue?

-IMP ;) :P
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#4 flexaplex

flexaplex

    GMC Member

  • Global Moderators
  • 4814 posts
  • Version:GM8

Posted 18 December 2008 - 06:49 PM

edit: better reference: http://www.gmlscript...topic.php?id=98

Edited by flexaplex, 18 December 2008 - 10:47 PM.

  • 0
:]

#5 Ecstats

Ecstats

    GMC Member

  • New Member
  • 844 posts
  • Version:GM8

Posted 19 December 2008 - 11:26 PM

I remember using either draw_line_width() or draw_line_width_color() on my old computer (with GM 6.1) about a year ago. I'm certain having the width of the line equal to zero crashed the game, however I don't think I ever tested the length of it.
I did test the length (x1,y1,x2,y2 = 0) (with GM 7) just now on my newer computer, and it crashes the game. Having a zero width doesn't do anything though. And it's only with the draw_line_width_color() function.
  • 0

#6 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 19 December 2008 - 11:33 PM

I remember using either draw_line_width() or draw_line_width_color() on my old computer (with GM 6.1) about a year ago. I'm certain having the width of the line equal to zero crashed the game, however I don't think I ever tested the length of it.
I did test the length (x1,y1,x2,y2 = 0) (with GM 7) just now on my newer computer, and it crashes the game. Having a zero width doesn't do anything though. And it's only with the draw_line_width_color() function.


Same here on my other laptop. Come to think of it, my other laptop had gm6. pen width 0 caused a crash. gmlscript.com has this reported too for line length. just make sure the resulting length of the line is not 0 before you draw.

Edited by icuurd12b42, 19 December 2008 - 11:34 PM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#7 flexaplex

flexaplex

    GMC Member

  • Global Moderators
  • 4814 posts
  • Version:GM8

Posted 19 December 2008 - 11:43 PM

I didn't read IceMetalPunk's post through properly and didn't realise the exact requirements (I was still testing from when Icuurd said that the pen_width being 0 could cause the error, presuming that was just the error IceMetal was referring to).

I do get the same 'unexpected error' message though when testing correctly.

Edited by flexaplex, 19 December 2008 - 11:53 PM.

  • 0
:]

#8 Mnementh

Mnementh

    15151

  • GMC Elder
  • 6400 posts
  • Version:GM:Studio

Posted 19 December 2008 - 11:47 PM

I've also had the above issues. In addition, I was helping a guy in this topic, and we encountered a slightly different issue.

EDIT; Slightly different in symptoms, but not disease.

Edited by Mnementh, 20 December 2008 - 12:15 AM.

  • 0

#9 link3000

link3000

    Link3000

  • GMC Member
  • 1130 posts
  • Version:GM8

Posted 20 December 2008 - 12:29 AM

so... why dont you just add .01 to the width or say
if !(x1=x2) and !(y1=y2) {
draw_line_width_color(x1,y1,x2,y2,color,width);
}
?
  • 0

Link3000


#10 Mnementh

Mnementh

    15151

  • GMC Elder
  • 6400 posts
  • Version:GM:Studio

Posted 20 December 2008 - 12:35 AM

so... why dont you just add .01 to the width or say
if !(x1=x2) and !(y1=y2) {
draw_line_width_color(x1,y1,x2,y2,color,width);
}
?

I didn't post that link here to point out that the function fails when given a 0 length line. That's already been said, several times.
  • 0

#11 Chronic

Chronic

    Administrator

  • Global Moderators
  • 2729 posts
  • Version:GM:Studio

Posted 20 December 2008 - 12:47 AM

While i have no solution to the bug, i can confirm the bug happens with a 0px line. This has been reported and also fixed in the current private beta of the C++ runner.

For now you'll just have to code in an exception to not draw the line if it would be a 0px line.
  • 0

My recent tutorials: [Auto-Tiling] [Text Based Menu] [Sprite Based Menu] [View more at my site]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
R.I.P Mom (1951-2008)


#12 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 20 December 2008 - 06:19 AM

I guess that's the best way around it, then. After all, a 0-length line (I did mean length, not width; my bad) wouldn't be seen anyway. I just wanted to make sure it wasn't just my PC. And apparently it's not.

Thanks, everyone :P .

-IMP ::lmao:: :P
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: