Вопрос How to get all entities and their types

Начинающий
Статус
Оффлайн
Регистрация
11 Фев 2023
Сообщения
39
Реакции[?]
0
Поинты[?]
0
hello iam back with my stupid questions
i wanna get the creep lanes , jungle creeps , roshan , towers , gates i wanna get their current positions and i wanna get their names
all i have access to is the entity list
 
Участник
Статус
Оффлайн
Регистрация
23 Май 2019
Сообщения
779
Реакции[?]
331
Поинты[?]
63K
hello iam back with my stupid questions
i wanna get the creep lanes , jungle creeps , roshan , towers , gates i wanna get their current positions and i wanna get their names
all i have access to is the entity list
classes:
positions:
entity->m_pGameSceneNode->m_vecAbsOrigin
 
Начинающий
Статус
Оффлайн
Регистрация
11 Фев 2023
Сообщения
39
Реакции[?]
0
Поинты[?]
0
how can i get the mouse cursor location like if i wanna do the following :
1- get the mouse cursor location
2- get the enemy entities that is close to this mouse cursor
3- print the entitiy
 
Участник
Статус
Оффлайн
Регистрация
23 Май 2019
Сообщения
779
Реакции[?]
331
Поинты[?]
63K
how can i get the mouse cursor location like if i wanna do the following :
1- get the mouse cursor location
2- get the enemy entities that is close to this mouse cursor
3- print the entitiy
cursor can be found from CInputService::GetCursorPosition(CInputService*, std::uint32_t*, std::uint32_t*) - InputService_001, 58th index in vmt
ScreenToWorldRay + RayTrace gets you a point on the ground, then you just find an entity with the least distance to that point(i.e. closest)
see CScriptBindingPR_Game::ScreenXYToWorld for reference
 
Пользователь
Статус
Оффлайн
Регистрация
8 Апр 2022
Сообщения
663
Реакции[?]
104
Поинты[?]
67K
Участник
Статус
Оффлайн
Регистрация
23 Май 2019
Сообщения
779
Реакции[?]
331
Поинты[?]
63K
почему не
Пожалуйста, авторизуйтесь для просмотра ссылки.
хз, просто так)
я GetCursorPos из винапи не тестил(ну наверно работает, хули ему не работать то) но вот из инпутсервиса тестил, вроде работает. если винапи работает(и от инпутсервиса не отличается результатами) то лучше ее юзать конеш
 
Участник
Статус
Оффлайн
Регистрация
23 Май 2019
Сообщения
779
Реакции[?]
331
Поинты[?]
63K
getting the cursor pos is not the hard part, it's calculating a ray from it(then again it's much easier than world to screen, since you get a direction rather than a point) and then checking collisions with game objects along that ray(raytracing(intersection testing))(finding the first obstacle - wall/ground/entity/etc. - that the ray intersects), both of which can be done using the game's own functions, see CScriptBindingPR_Game::ScreenXYToWorld (xref to it can be found by near string xref "ScreenXYToWorld")
C:
__int64 __fastcall CScriptBindingPR_Game::ScreenXYToWorld(CScriptBindingPR_Game *this, unsigned int a2, unsigned int a3, float a4, double a5, __m128i a6, __m128i a7)
{
  int v7; // er14
  __int64 v8; // rbx
  CDOTAInput *v9; // rax
  __int64 v10; // rax
  v8::Array *v11; // r14
  int v12; // edx
  __int64 v13; // rax
  __int64 v14; // rax
  __int64 v15; // rax
  float v17; // [rsp+0h] [rbp-50h]
  float v18; // [rsp+4h] [rbp-4Ch]
  float v19; // [rsp+8h] [rbp-48h]
  char v20; // [rsp+10h] [rbp-40h]
  __m128i v21[3]; // [rsp+20h] [rbp-30h]

  v7 = a3;
  v8 = 0LL;
  if ( DOTAInput() )
  {
    v9 = DOTAInput();
    CDOTAInput::GetWorldRayFromMousePosition(v9, a2, v7, v21, (float *)&v20, a4, a5, a6, a7);
    v10 = DOTAInput();
    CDOTAInput::FindWorld(v10, (float *)v21, (float *)&v20, &v17);
    v11 = (v8::Array *)(*(__int64 (__fastcall **)(__int64, __m128i *))(*(_QWORD *)panorama::g_pUIEngineSingleton + 952LL))(
                         panorama::g_pUIEngineSingleton,
                         v21);
    v8 = v8::Array::New(v11, (v8::Isolate *)((char *)&dso_handle + 3), v12);
    v13 = v8::Number::New(v11, (v8::Isolate *)((char *)&dso_handle + 3), v17);
    v8::Object::Set(v8, 0LL, v13);
    v14 = v8::Number::New(v11, 0LL, v18);
    v8::Object::Set(v8, 1LL, v14);
    v15 = v8::Number::New(v11, (v8::Isolate *)((char *)&dso_handle + 1), v19);
    v8::Object::Set(v8, 2LL, v15);
  }
  return v8;
}
CDOTAInput::FindWorld does the tracing
 
Начинающий
Статус
Оффлайн
Регистрация
11 Фев 2023
Сообщения
39
Реакции[?]
0
Поинты[?]
0
what is the wrong here with VecOrigin ?

C++:
 void* pGameSceneNode = (void*)((uintptr_t)EntityHero + offset_m_pGameSceneNode);

                    if (pGameSceneNode) {
                        auto vecAbsOrigin = (int)((uintptr_t)pGameSceneNode + offset_m_vecAbsOrigin);
                        std::cout << "pGameSceneNode" << pGameSceneNode << "vecAbsOrigin" << vecAbsOrigin << std::endl;
                    }
 
Участник
Статус
Оффлайн
Регистрация
23 Май 2019
Сообщения
779
Реакции[?]
331
Поинты[?]
63K
what is the wrong here with VecOrigin ?

C++:
 void* pGameSceneNode = (void*)((uintptr_t)EntityHero + offset_m_pGameSceneNode);

                    if (pGameSceneNode) {
                        auto vecAbsOrigin = (int)((uintptr_t)pGameSceneNode + offset_m_vecAbsOrigin);
                        std::cout << "pGameSceneNode" << pGameSceneNode << "vecAbsOrigin" << vecAbsOrigin << std::endl;
                    }
maybe try learning C(++) first? you're not even reading memory... also vecAbsOrigin isn't an int it's an array of 3 floats
 
Начинающий
Статус
Оффлайн
Регистрация
11 Фев 2023
Сообщения
39
Реакции[?]
0
Поинты[?]
0
maybe try learning C(++) first? you're not even reading memory... also vecAbsOrigin isn't an int it's an array of 3 floats
yeah i didn't know that it was an array of 3 floats but it works now
and i think the ray calculation thing is kinda complicated and earlier yesterday i was looking into the Hero Entity object and i found something of type m_Collision what does this m_Collision Pointer do ?
 
Последнее редактирование:
Участник
Статус
Оффлайн
Регистрация
23 Май 2019
Сообщения
779
Реакции[?]
331
Поинты[?]
63K
yeah i didn't know that it was an array of 3 floats but it works now
and i think the ray calculation thing is kinda complicated and earlier yesterday i was looking into the Hero Entity object and i found something of type m_Collision what does this m_Collision Pointer do ?
controls collision properties such as hitbox etc.
 
Сверху Снизу