![]() |
![]() |
JRob |
![]()
Post
#1
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 52 Joined: 30-April 11 Member No.: 1,970 ![]() |
I tried playing around with rcbot again and it keeps crashing at
CTeamControlPointRound *CTeamControlPointMaster:: getCurrentRound () CBaseEntity *pent = m_ControlPointRounds[m_iCurrentRoundIndex]; So I took a look at what that was and apparently, CTeamControlPointRound is found through dark hackery and the magic number at rcbot_const_mstr_offset. Can you update this? Or also tell people how to find these offsets? |
![]() ![]() |
Cheeseh |
![]()
Post
#2
|
![]() Admin ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 3,066 Joined: 11-September 03 From: uk Member No.: 1 ![]() |
I tried playing around with rcbot again and it keeps crashing at CTeamControlPointRound *CTeamControlPointMaster:: getCurrentRound () CBaseEntity *pent = m_ControlPointRounds[m_iCurrentRoundIndex]; So I took a look at what that was and apparently, CTeamControlPointRound is found through dark hackery and the magic number at rcbot_const_mstr_offset. Can you update this? Or also tell people how to find these offsets? as far as I know there should be no problem with the offset right now however This is a way of finding the guts of CTeamControlPoint. The problem is that "CBaseEntity" is difficult to use in plugins - so I avoided it completely and instead just coded in the parts of CTeamControlPoint that are useful, and instead of having several offsets I just need one for the class below: It is expanded from CBaseEntity (its subclass) so it has all that CBaseEntity crap beforehand. Maybe a better way of doing this would be to declare a basic CBaseEntity through the engine code then do a sizeof() and just use that as the offset. OR create a CTeamControlPoint entity -- find the size doing sizeof then delete the size of only the CTeamControlPoint class without CBaseEntity from it. CTeamControlPoint : public CBaseEntity { ... // USEFUL STUFF HERE CUtlMap<int, CTeamControlPoint *> m_ControlPoints; bool m_bFoundPoints; CUtlVector<CTeamControlPointRound *> m_ControlPointRounds; int m_iCurrentRoundIndex; } The problem is trying to find this stuff from a CBaseEntity pointer of CTeamControlPoint (unless you know of a better way) So basically I get the start point of the CBaseEntity CBaseEntity *pMaster then add the offset between the start point and CUtlMap<int, CTeamControlPoint *> m_ControlPoints . which last time was 844 It's probably only moved by 4 bytes or in increments of 4 I usually debug this by running through a debugger -- changing the offset and vieweing the resulting CTeamControlPoint that I made to see if it makes sense, then just keep the offset like that Don't have much time to explain more -- hope it's enough for now |
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 2nd August 2025 - 08:41 AM |