Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP isn't being drawn properly onto players, unless the escape menu is open? #10

Closed
HOTD opened this issue Jun 21, 2018 · 22 comments
Closed

Comments

@HOTD
Copy link

HOTD commented Jun 21, 2018

Title. ESP positions are off but when you open the pause menu, they are corrected to the right positions.

@M-Tass
Copy link
Owner

M-Tass commented Jun 22, 2018

Hello,

Can you please post a video showing this issue?
I can't seem to replicate it on my end

@HOTD
Copy link
Author

HOTD commented Jun 29, 2018

Sorry for the late reply, haven't been playing gmod a lot. The ESP seems to acting strange with or without the escape menu, seems to be rendering in the wrong positions (trying to find my screenshots of this) or not rendering at all. When you open the escape menu it fixes it (https://i.imgur.com/q3aFP4G.png).

Here's a video: https://www.youtube.com/watch?v=FnJxVdYeVRw

@HOTD
Copy link
Author

HOTD commented Jun 29, 2018

Here's the video of the boxes rendered in the wrong areas: https://www.youtube.com/watch?v=08i1xmCqg4I

@M-Tass
Copy link
Owner

M-Tass commented Jun 29, 2018

Does replacing esp::draw_bounding_box with esp::draw_3d_box fix the issue?

@HOTD
Copy link
Author

HOTD commented Jun 29, 2018

Nope, https://www.youtube.com/watch?v=eGgDOz4fWII. I do like the 3D boxes though.

@M-Tass
Copy link
Owner

M-Tass commented Jun 29, 2018

Looks like an issue with the view matrix.
Can you post the server IP?

@HOTD
Copy link
Author

HOTD commented Jun 29, 2018

92.60.12.133:27015 or 92.60.12.133:10000 . Zombie.Zone ZS Server 1 & 2

@HOTD
Copy link
Author

HOTD commented Jun 29, 2018

Edit: Still having issue on that zs server. I'm out of ideas.

@FocuzJS
Copy link
Contributor

FocuzJS commented Jul 7, 2018

I've ran into this now aswell, its a server addon type thing it seems

@FocuzJS
Copy link
Contributor

FocuzJS commented Jul 7, 2018

can confirm it's a view matrix issue, player locations are correct for my aimbot

@M-Tass
Copy link
Owner

M-Tass commented Jul 7, 2018

Can you check if cam.Start3D fixes the issues?

@FocuzJS
Copy link
Contributor

FocuzJS commented Jul 7, 2018

I was thinking of getting the view matrix another way, and seeing if https://wiki.garrysmod.com/page/Entity/GetWorldTransformMatrix is a different vmatrix than globals::engine->get_view_matrix()

how would cam.Start3D help, it's lua aswell right?

@M-Tass
Copy link
Owner

M-Tass commented Jul 7, 2018

GetWorldTransformMatrix isn't the view matrix rather the rgfl_CoordinateFrame

If I'm not mistaken cam.Start3D seems as if it calls CViewRender::SetupMain3DView (Which re-calculates the view matrix and caches it)

@FocuzJS
Copy link
Contributor

FocuzJS commented Jul 7, 2018

cam.Start3D says it expects cam.End3D to be called. Should this be called directly after since im guessing the cache will be updated or on an event hook?
and how often do you think this call should be made, once per run or as part of get_view_matrix?

@M-Tass
Copy link
Owner

M-Tass commented Jul 7, 2018

See if this works:

cam.Start3D(LocalPlayer():EyePos(), LocalPlayer():EyeAngles(), ...)
auto& matrix = globals::engine->get_view_matrix()

// ESP rendering

cam.End3D()

@M-Tass
Copy link
Owner

M-Tass commented Jul 7, 2018

Using cam.Start3D does indeed solve the issue

Source

if (auto glua = Lua::get())
{
	auto& [x, y] = ImGui::GetIO().DisplaySize;

	glua->push_special(Lua::special::glob);
	glua->get_field(-1, "LocalPlayer");
	glua->call(0, 1);

	glua->get_field(-1, "EyePos");
	glua->push(-2);
	glua->call(1, 1);

	glua->get_field(-2, "EyeAngles");
	glua->push(-3);
	glua->call(1, 1);

	glua->get_field(-4, "cam");
	glua->get_field(-1, "Start3D");
	glua->push(-4);
	glua->push(-4);
	glua->push_nil();
	glua->push_number(0.);
	glua->push_number(0.);
	glua->push_number(x);
	glua->push_number(y);
	glua->push_nil();
	glua->push_nil();
	glua->call(9, 0);

	glua->pop(5);

	// Rendering / ESP here

	glua->push_special(Lua::special::glob);
	glua->get_field(-1, "cam");
	glua->get_field(-1, "End3D");
	glua->call(0, 0);
	glua->pop(2);
}

@FocuzJS
Copy link
Contributor

FocuzJS commented Jul 7, 2018

yes it works for me aswell. Start3D has defaults defined so passing it tables is not necessary. I was able to get this working with few simple lines wrapped around get_view_matrix since i suspected it was the only issue.
my fix thanks to your tip:

    auto glua = globals::lua->create_interface(lua::type::client);

    if (glua) {
        glua->PushSpecial(lua::special::glob);
        glua->GetField(-1, "cam");
        glua->GetField(-1, "Start3D");
        glua->Call(0, 1);
        glua->Pop();
    }
    auto& matrix = globals::engine->get_view_matrix();
    if (glua) {
        glua->GetField(-1, "End3D");
        glua->Call(0, 1);
        glua->Pop(3);
    }

and then render esp normally so in my case, i don't have multiple lua contexts open at once! thanks for the quick responses.

@M-Tass M-Tass closed this as completed Jul 7, 2018
@M-Tass M-Tass reopened this Jul 7, 2018
@M-Tass
Copy link
Owner

M-Tass commented Jul 7, 2018

Sorry, I mistakenly closed this issue. Opening it again
If the issue is resolved on @HOTD's end, they may close it

@FocuzJS
Copy link
Contributor

FocuzJS commented Jul 8, 2018

hl2_2018-07-08_09-48-39
just tested on the servers he had trouble with before. everything looks good to me

@xbread
Copy link

xbread commented Jul 8, 2018

@FocuzJS you got a discord that i can message you on?

@FocuzJS
Copy link
Contributor

FocuzJS commented Jul 9, 2018

@xbread post yours i'll add you

@HOTD
Copy link
Author

HOTD commented Jul 24, 2018

Seems to work. Closing.

@HOTD HOTD closed this as completed Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants