.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Bot avatar in scoreboard
Old
  (#1)
Immortal_BLG
Member
 
Status: Offline
Posts: 171
Join Date: Nov 2007
Location: Russian Federation
Default Bot avatar in scoreboard - 06-08-2011

Just add this code after pfnCreateFakeClient() call (after bot entity created):
Code:
const unsigned int k_unSteamUserDesktopInstance = 1;
// Steam account types
enum EAccountType
{
	// ...
	k_EAccountTypeIndividual = 1	// single user account
	// ...
};
// Steam universes. Each universe is a self-contained Steam instance.
enum EUniverse
{
	// ...
	k_EUniversePublic = 1
	// ...
};
#pragma warning (push)
#pragma warning (disable: 4201)	// nameless union is nonstandard
// 64 bits total
union SteamID_t	// From CSteamID class....
{
	struct /* Unnamed */
	{
		unsigned int m_unAccountID       : 32;	// unique account identifier
		unsigned int m_unAccountInstance : 20;	// dynamic instance ID (used for multiseat type accounts only)
		unsigned int m_EAccountType      : 4;	// type of account - can't show as EAccountType, due to signed / unsigned difference
		EUniverse    m_EUniverse         : 8;	// universe this account belongs to
	};

	unsigned long long m_unAll64Bits;
} steamID;
#pragma warning (pop)	// no more anonymous unions until next time

const unsigned int SteamAccountIDMaximum (2039734271u);

steamID.m_unAccountID       = 32118129u;	// My ID (for example)//RANDOM_LONG (0u, SteamAccountIDMaximum); - random almost never works....
steamID.m_unAccountInstance = k_unSteamUserDesktopInstance;	// constant
steamID.m_EAccountType      = k_EAccountTypeIndividual;	// constant
steamID.m_EUniverse         = k_EUniversePublic;	// constant
// or steamID.m_unAll64Bits = 76561197992383857ull;	// My ID (full ID must have the form 7656119XXXXXXXXXX)

SET_CLIENT_KEYVALUE (botEntityIndex, GET_INFOKEYBUFFER (botEdict), "*sid", FormatBuffer ("%I64u", steamID.m_unAll64Bits));
  
Reply With Quote
Re: Bot avatar in scoreboard
Old
  (#2)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Bot avatar in scoreboard - 06-08-2011

Nice hacking.

Question: If I don't have Steam account for the Dedicated server(which is common) what avatar will appear? Perhaps some random if the RANDOM_LONG() hit valid Steam ID?
  
Reply With Quote
Re: Bot avatar in scoreboard
Old
  (#3)
Immortal_BLG
Member
 
Status: Offline
Posts: 171
Join Date: Nov 2007
Location: Russian Federation
Default Re: Bot avatar in scoreboard - 07-08-2011

Quote:
Originally Posted by The Storm
Question: If I don't have Steam account for the Dedicated server(which is common) what avatar will appear?
to be honest I do not know all the details (I only test all it on my PC - result: me and bots have white square instead of avatars - on multiple PC's(when dedicated server and client is on different computers) the result is unknown), but I think it should works....
Quote:
Originally Posted by The Storm
Perhaps some random if the RANDOM_LONG() hit valid Steam ID?
For client "*sid" value is just used for avatar and relationship icon which is located to the left of avatar - I think that is all.
About random steam ID: There is too small probability to get a valid steam ID from random value....
  
Reply With Quote
Re: Bot avatar in scoreboard
Old
  (#4)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Bot avatar in scoreboard - 07-08-2011

Ok but I can't get one thing... Is the valid steam ID requred to get avatar on a bot? If not what and from where the bot will get it's avatar?
  
Reply With Quote
Re: Bot avatar in scoreboard
Old
  (#5)
Immortal_BLG
Member
 
Status: Offline
Posts: 171
Join Date: Nov 2007
Location: Russian Federation
Default Re: Bot avatar in scoreboard - 07-08-2011

Bot has no his own steam ID and of course avatar, his uses ID or some real client and takes his avatar. Clients sees avatar, which is loaded for Steam ID of a bot or client, if bot "*sid" value undefined or invalid, his avatar is empty, in other case bot will get avatar of a real client from his Steam ID.
  
Reply With Quote
Re: Bot avatar in scoreboard
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Bot avatar in scoreboard - 11-08-2011

Got it now.
  
Reply With Quote
Re: Bot avatar in scoreboard
Old
  (#7)
Immortal_BLG
Member
 
Status: Offline
Posts: 171
Join Date: Nov 2007
Location: Russian Federation
Default Re: Bot avatar in scoreboard - 01-03-2012

SORRY!!!
I forgot that the class CSteamID has no alignment!
So you need to write before declaration "union SteamID_t":
Code:
#pragma pack (push, 1)
and after declaration:
Code:
#pragma pack (pop)
In general, the declaration of "union SteamID_t" should look like this:
Code:
#pragma pack (push, 1)	// Structures must be packed (byte-aligned)
// 64 bits total
union SteamID_t	// From CSteamID class....
{
	#pragma warning (push)
	#pragma warning (disable: 4201)	// nameless union is nonstandard
		struct /* Unnamed */
		{
			unsigned int m_unAccountID       : 32;	// unique account identifier
			unsigned int m_unAccountInstance : 20;	// dynamic instance ID (used for multiseat type accounts only)
			unsigned int m_EAccountType      : 4;	// type of account - can't show as EAccountType, due to signed / unsigned difference
			EUniverse    m_EUniverse         : 8;	// universe this account belongs to
		};
	#pragma warning (pop)	// no more anonymous unions until next time

	unsigned long long m_unAll64Bits;
} steamID;
#pragma pack (pop)	// Reset default packing.
P.S. However, in my opinion it is not important....
  
Reply With Quote
Re: Bot avatars in scoreboard
Old
  (#8)
wbyokomo
Zombie Slayer
 
Status: Offline
Posts: 17
Join Date: Apr 2012
Location: Cyberjaya MY
Default Re: Bot avatars in scoreboard - 02-11-2012

Wow nice found, should be add into podbot.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com