Printable Version of Topic

Click here to view this topic in its original format

RCBot Forums _ Linux _ How do you find out what the mstr_offset is?

Posted by: Cinibonswirl26 Feb 28 2017, 02:24 PM

The bot only works on CTF maps and if I load any other game time it crashes and give me an error saying
"If you get this error message on cp_* maps something might be wrong with your mstr_offset

Posted by: dgesd Mar 1 2017, 08:54 AM

QUOTE(Cinibonswirl26 @ Feb 28 2017, 02:24 PM) *

The bot only works on CTF maps and if I load any other game time it crashes and give me an error saying
"If you get this error message on cp_* maps something might be wrong with your mstr_offset

Try to put these to config.ini

CODE
rcbot_const_mstr_offset 856
rcbot_const_round_offset 856

Posted by: Cinibonswirl26 Mar 1 2017, 10:18 PM

QUOTE(dgesd @ Mar 1 2017, 12:54 AM) *

Try to put these to config.ini

CODE
rcbot_const_mstr_offset 856
rcbot_const_round_offset 856



Didn't work sad.gif

I forgot to mention that it only crashes once someone joins a team and picks a class.
It does not crash when you choose spectator.

Posted by: Cheeseh Mar 2 2017, 08:38 AM

there was a whole developer discussion about it but nothing ever came out of it. I might try introducing a method like this eventually.

http://rcbot.bots-united.com/forums/index.php?showtopic=1981&hl=mstr_offset

Posted by: Cinibonswirl26 Mar 2 2017, 02:42 PM

QUOTE(Cheeseh @ Mar 2 2017, 12:38 AM) *

there was a whole developer discussion about it but nothing ever came out of it. I might try introducing a method like this eventually.

http://rcbot.bots-united.com/forums/index.php?showtopic=1981&hl=mstr_offset


Weird that the Linux version crashes due to not having the right mstr_offsrt whereas the Windows version runs fine.


Posted by: Cheeseh Mar 3 2017, 08:27 AM

QUOTE(Cinibonswirl26 @ Mar 2 2017, 02:42 PM) *

Weird that the Linux version crashes due to not having the right mstr_offsrt whereas the Windows version runs fine.


it will be different from windows perhaps by multiples of 4. (add or remove 4 to it) try a few more times

Posted by: Cinibonswirl26 Mar 3 2017, 11:39 PM

QUOTE(Cheeseh @ Mar 3 2017, 12:27 AM) *

it will be different from windows perhaps by multiples of 4. (add or remove 4 to it) try a few more times


Looks like 876 is the new Linux offset! Thanks Chesseh smile.gif smile.gif smile.gif

Only other problem is I still can't get them to spawn with custom loadouts even with the right hook info from the .exe

If the mstr_offset was slightly off a number or two, do you think that might be the cause of it? It will print all the "Found Loadout" stuff in the console

Posted by: Cinibonswirl26 Apr 6 2017, 01:32 AM

Using the sourcemod plugin Give Bots Weapons works just fine. Strange considering it's using the exact same offset number as the latest hookinfo off of the exe.

Posted by: Cheeseh Apr 6 2017, 07:37 AM

QUOTE(Cinibonswirl26 @ Mar 4 2017, 12:39 AM) *

Looks like 876 is the new Linux offset! Thanks Chesseh smile.gif smile.gif smile.gif

Only other problem is I still can't get them to spawn with custom loadouts even with the right hook info from the .exe

If the mstr_offset was slightly off a number or two, do you think that might be the cause of it? It will print all the "Found Loadout" stuff in the console

The mstr_offset stuff is only for control point maps. Because its Linux I don't know if the offsets are correct

Posted by: Cinibonswirl26 Apr 6 2017, 03:24 PM

QUOTE(Cheeseh @ Apr 6 2017, 12:37 AM) *

The mstr_offset stuff is only for control point maps. Because its Linux I don't know if the offsets are correct


Ah. Okay. I'm just saying I find it odd due to how the sourcemod plugin Give Bots Weapons uses the exact same offsets on Linux and gives the bots weapons, whereas it wont using the normal RCbot method

Posted by: RoboCop Mar 19 2018, 10:54 PM

Well it is very annoying on finding the correct new offsets for Linux I admit. I'm not sure how to resolve that or find a better away to find the new Linux offsets in the future.

Posted by: nosoop Jul 21 2019, 04:19 PM

For manual lookups, you can use the dump_entity_sizes command on their respective platform and look for entities that don't add members to CBaseEntity.

The following entities are the ones I noted down:


Posted by: nosoop May 22 2020, 05:29 AM

Consider this problem solved!

I've pushed out https://github.com/nosoop/rcbot2/commit/66e799c01110656af3da4885a7e254f3a7128826 onto my custom fork, which pulls the offset automatically based on the size of one of the entities I mentioned above.
You may also need https://github.com/nosoop/rcbot2/commit/51ad988b5537827bd09a17981439b01beaa9a977 to use the upstream IServerTools interface; not sure if the one that was in the project works.

Confirmed working on both Linux and Windows versions of TF2. If you're an end-user, wait for it to be merged into RoboCop's upstream.

Posted by: trice Nov 1 2021, 06:25 PM

Hello,

i used this at Linux Ubuntu Gameroot

rcbot_const_mstr_offset 876
rcbot_const_round_offset 876
rcbot_tooltips 0
rcbot tooltips 0

QUOTE
hookinfo.ini
givenameditem_win=478
givenameditem_linux=479
equipwearable_win=426
equipwearable_linux=427
runplayermove_tf2_win=418
runplayermove_tf2_linux=419
runplayermove_dods_win=418
runplayermove_dods_linux=419
getweaponslot_win=268
getweaponslot_linux=269
removewearable_win=427
removewearable_linux=428
removeplayeritem_win=270
removeplayeritem_linux=271
weaponequip_win=261
weaponequip_linux=262
mstr_offset_win=844
mstr_offset_linux=864
gamerules_win=5
getdatadescmap_linux=12
create_gamerules_object_win=\x55\x8B\xEC\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x07
set_attribute_value_win=\x55\x8B\xEC\x83\xEC\x14\x33\xD2\x53\x8B\xD9\x56\x57\x8B\x73\x10\x85\xF6
set_attribute_value_linux=@_ZN14CAttributeList24SetRuntimeAttributeValueEPK28CEc
onItemAttributeDefinitionf
get_item_schema_win=\xE8\x2A\x2A\x2A\x2A\x83\xC0\x04\xC3
get_item_schema_linux=@_Z15GEconItemSchemav
get_attrib_definition_win=\x55\x8B\xEC\x83\xEC\x1C\x53\x8B\xD9\x8B\x0D\x2A\x2A\x2A\x2A\x56\x33\xF6\x89\x5D\xF8\x89\x75\xE4\x89\x75\xE8
get_attrib_definition_linux=@_ZN15CEconItemSchema22GetAttributeDefinitionEi
attributelist_get_attrib_by_id_win=\x55\x8B\xEC\x51\x8B\xC1\x53\x56\x33\xF6\x89\x45\xFC\x8B\x58\x10
attributelist_get_attrib_by_id_linux=@_ZNK14CAttributeList16GetAttributeByIDEi