|
|
|
Page 1 of 1 |
[ 6 posts ] |
|
 GetPixelColor is kinda bugged... : EverQuest 2 Premium Discussions
|
|
Posted: December 13th, 2004, 10:13 am
|
|
|
|
richyrich
richyrich's Reps:
|
Well, this is not a new issue, I actually found the same problem when I was scripting SWG, but I thought I'd throw it out there again if there is something Admin/Wyv can do?
Here is the problem, the GetPixelColor() doesn't always return the right colors when it is reading from a "window" in game.
There is a quick way to reproduce the problem and that is to run the GetPixelColorDemo.vbs that comes with XU.
Go into EQ2 and put your cursor over the health bar of your character (will have to move away from the pop-up tip). Just leave it there and watch the color value swtich between the real colors and something else (usually 0, 0, 0, but can be anything).
I found this when coding SWG and rewrote my health/power bar functions to work around this by checking a pixel multiple times if it didn't match what was expected... and think it is pretty reliable now even in EQ2.
The problem is the more we rely on the function to get colors the more it will become a problem, especially if using to bitmap checks until we have other functions that do that.
I have found the problem does not happen if you are not reading from an in-game window. So, my theory is somehow the GetPixelColor() function is not in sync with the game redraw and when reading from a window in-game, it sometimes reads what is "behind" the window instead of the actual window color (health bar, etc.)
Any ideas?
Rich
|
|
|
|
|
Posted: December 13th, 2004, 3:38 pm
|
|
|
|
Admin
Total Posts: 1168
Location: Waco
Joined: May 1st, 2004, 4:00 am
Admin's Reps: 4
|
You are right.
I have found the problem. I was using the WIN32API to call GetPIxel GetDC(0),x,y. I have modified the script to call GetPixel gameDC,x,y.
I'll post it here in a bit.
_________________
Help our site.. take a moment to click the Digg this post!!! v v v
|
|
|
|
|
Posted: December 13th, 2004, 3:53 pm
|
|
|
|
richyrich
richyrich's Reps:
|
Awesome! You have no idea how much code I have written to "work around" this bug  TY TY!
|
|
|
|
|
Posted: December 15th, 2004, 2:16 am
|
|
|
|
djvj
Total Posts: 272
Joined: May 1st, 2004, 4:00 am
djvj's Reps: 0
|
That also always happens in FFXI, but it does not always goto 0,0,0 but some other random color code. Rather annoying but scripting still is possible obviously.
|
|
|
|
|
Posted: December 15th, 2004, 3:54 am
|
|
|
|
richyrich
richyrich's Reps:
|
It's not always 0,0,0, just see that a lot, I think it truly is reading what is "behind" the window...
Still waiting to see it released, tried it last night and it was still the old code.
|
|
|
|
|
Posted: December 15th, 2004, 4:38 am
|
|
|
|
wyvernx
Total Posts: 6718
Joined: May 1st, 2004, 4:00 am
wyvernx's Reps: 21
|
I dont think he has posted a new scripthost yet
_________________
Use Search first, ask questions later!
|
|
|
|
|
Who is online |
|
Users browsing this forum: No registered users and 225 guests |
|
|
|