SRL Archive - Help and Support

Draw Texture ID's on OGL?


Sjoe

2013-08-29 10:37:53

Hey,

I've searched the forum a bit, (probably not thoroughly)
So it's faster to ask

I'm using Brandon's OGL Plugins with Simba 1.000

I'm just not sure how to display the ID's/texts/etc… on screen so I can use them in my functions.

Help appreciated thx :)

Ashaman88

2013-08-29 10:56:29

gldebug

make sure you get the latest plugins and stuff off hit git

but i can't think of the parameters off the top of my head :(

Sjoe

2013-08-29 11:32:22

From: Ashaman88
gldebug

make sure you get the latest plugins and stuff off hit git

but i can't think of the parameters off the top of my head :(


glDebug(GL_MODE_Models, 0, 0, 0, 800, 600);

cool it works ;) Now what other stuff can I debug besides GL_MODE_Models? :p

Ashaman88

2013-08-29 11:44:12

From: Sjoe
glDebug(GL_MODE_Models, 0, 0, 0, 800, 600);

cool it works ;) Now what other stuff can I debug besides GL_MODE_Models? :p


Textures… um not sure what else but I think it's listed at the top of that file (core or w/e)

Sjoe

2013-08-29 12:40:09

From: Ashaman88
Textures… um not sure what else but I think it's listed at the top of that file (core or w/e)


Ok will check in a bit, thx for the help!

DemiseScythe

2013-08-29 19:05:31

From: Sjoe
Ok will check in a bit, thx for the help!


Writeln(glGetTextures(IntToBox(x1, y1, x2, y2)));

Writeln(glGetModels(IntToBox(x1, y1, x2, y2)));

These print all textures or models inside the inputted coords, then sort them out by the coords returned in the debug box. This is useful to isolate overlapping IDs since they cannot be read with the paint debug, more often happens with textures. I prefer this method when grabbing textures.

Brandon

2013-08-29 21:51:56

glDebug(GL_MODE_MODELS, ............);  //Display models within a specified area.
glDebug(GL_MODE_TEXTURES, ..........); //Display textures within a specified area.
glDebug(GL_MODE_NONE, ..............); //Display Nothing/Hide displays.
glDebug(GL_MODE_FONTS, .............); //Display text/fonts on screen.
glDebug(GL_MODE_HUD, TextureID, ....); //Display Textures on a HUD on screen. Basically shows the texture with the specified ID.


Other debugging functions you can write if you like.

Mark

2013-09-05 05:26:29

From: Brandon
glDebug(GL_MODE_MODELS, ............);  //Display models within a specified area.
glDebug(GL_MODE_TEXTURES, ..........); //Display textures within a specified area.
glDebug(GL_MODE_NONE, ..............); //Display Nothing/Hide displays.
glDebug(GL_MODE_FONTS, .............); //Display text/fonts on screen.
glDebug(GL_MODE_HUD, TextureID, ....); //Display Textures on a HUD on screen. Basically shows the texture with the specified ID.
.


Hi mate just wondering do you have any type of filter added to avoid those ugly overlapping id's quite annoying.


From: DemiseScythe
Writeln(glGetTextures(IntToBox(x1, y1, x2, y2)));

Writeln(glGetModels(IntToBox(x1, y1, x2, y2)));



Thanks for this makes things readable but still annoying to have todo it this way.

DemiseScythe

2013-09-05 08:33:23

From: CRU1Z1N
Hi mate just wondering do you have any type of filter added to avoid those ugly overlapping id's quite annoying.

Thanks for this makes things readable but still annoying to have todo it this way.


Overlapping IDs for models are kind of rare. If you are trying to get ID from an inventory item, opening the bank get's rid of the slot IDs.

Brandon

2013-09-05 09:18:26

From: CRU1Z1N
Hi mate just wondering do you have any type of filter added to avoid those ugly overlapping id's quite annoying.
Thanks for this makes things readable but still annoying to have todo it this way.


From: DemiseScythe
Overlapping IDs for models are kind of rare. If you are trying to get ID from an inventory item, opening the bank get's rid of the slot IDs.



I use this:


Procedure DebugTextures(var Textures: glTextureArray; SleepTime: Integer; var Graphics: TGraphics);
var
I: Integer;
Begin
For I := 0 To High(Textures) Do
Begin
Graphics.DrawBox(Textures[I].Bounds);
writeln(Textures[I].ID);
writeln(Textures[I].ColourID);
glDebug(GL_MODE_HUD, Textures[I].ID, 0, 0, 0, 0);
Sleep(SleepTime);
Graphics.Clear;
ClearDebug;
End;
End;


var
T: glTextureArray;
Smart: TSmart;
begin
ClearDebug;
SetupGLX(Smart, 1350, 670);
Smart.Graphics().Clear;
T := glGetTextures(IntToBox(0, 0, 100, 100)); //Area where the textures are..
DebugTextures(T, 1500, Smart.Graphics);
end.

It will loop and sleep and display the textures on screen 1 by 1 as well as their information.

Mark

2013-09-05 10:14:57

From: DemiseScythe
Overlapping IDs for models are kind of rare. If you are trying to get ID from an inventory item, opening the bank get's rid of the slot IDs.


Noticed this already but thanks :D.

From: Brandon
I use this:


Procedure DebugTextures(var Textures: glTextureArray; SleepTime: Integer; var Graphics: TGraphics);
var
I: Integer;
Begin
For I := 0 To High(Textures) Do
Begin
Graphics.DrawBox(Textures[I].Bounds);
writeln(Textures[I].ID);
writeln(Textures[I].ColourID);
glDebug(GL_MODE_HUD, Textures[I].ID, 0, 0, 0, 0);
Sleep(SleepTime);
Graphics.Clear;
ClearDebug;
End;
End;


var
T: glTextureArray;
Smart: TSmart;
begin
ClearDebug;
SetupGLX(Smart, 1350, 670);
Smart.Graphics().Clear;
T := glGetTextures(IntToBox(0, 0, 100, 100)); //Area where the textures are..
DebugTextures(T, 1500, Smart.Graphics);
end.

It will loop and sleep and display the textures on screen 1 by 1 as well as their information.


Cheers mate but not really what i wanted with your function i need to know the id's in the first place but the problem im have is i cant read a lot of id's due to many id's on screen in small crowded areas just overlap but with a little editing (After my dinner) ill make your function to suit thanks mate.

Brandon

2013-09-05 13:52:27

From: CRU1Z1N
Your function i need to know the id's in the first place but the problem im have is i cant read a lot of id's


Uhh that function doesn't need to know any ID's.. That's the point of the function..

I don't write the include by trying to figure out every single ID. What I do is I use the above function and it prints every ID within a specific area. Not only that, but it draws the image of the corresponding ID on screen.

So lets say a lobster was 1024 and in the inventory then I simply do:


T := glGetTexture(InventoryBounds); //InvBox or the box that has the lobster (small box around the lobster)..
DebugTextures(T, 1500, Smart.Graphics); //Would draw a lobster on screen and print 1024..

And then I look at the screen/smart. On the top left corner, it starts to draw the image of a lobster and whatever other items are in the inventory and it will also display the:

size, ID, ColourID, GenericID, Location of the texture, boundaries of the texture (tbox), etc..


Sample image:


See the info it displays for the Compass? It will do the same in RS3 for all textures. The parameter it takes is just an array of textures. How you find those textures is up to you.


T:= glGetTextures(ID);
T:= glGetTextures(IDs);
T:= glGetTextures(Area);
T:= glGetTextures(ID, Area);
T:= glGetTextures(ID, Colour, Tolerance, Area);
T:= glGetTextures(IDs, Colours, Tolerances, Area);

etc… There's like 7-8 of these.. Check the include.

Mark

2013-09-05 16:57:49

From: Brandon


T := glGetTexture(InventoryBounds); //InvBox or the box that has the lobster (small box around the lobster)..
DebugTextures(T, 1500, Smart.Graphics); //Would draw a lobster on screen and print 1024..

And then I look at the screen/smart. On the top left corner, it starts to draw the image of a lobster and whatever other items are in the inventory and it will also display the:

size, ID, ColourID, GenericID, Location of the texture, boundaries of the texture (tbox), etc..


Misunderstood at first till i tested it after my dinner cheers again.

edit: any reason you removed the Function keys that alternated debug displays made it alot more simple using debug.

Sjoe

2013-09-08 20:30:35

A little bit off topic, didn't wanna make a new topic.

is there OGL Walking available @Brandon?