Raised This Month: $51 Target: $400
 12% 

[Scripting]Fake client with BotMimic


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kasea
Member
Join Date: Feb 2015
Old 07-04-2015 , 23:21   [Scripting]Fake client with BotMimic
Reply With Quote #1

So I'm trying to have BotMimic create fake clients, instead of actual bots. Now I've got this to work fine and all, however it won't actually start moving the bots. I've had no errors with this. After a while of the fake client not running, i get the running noise bug which happens at times. I was wondering if anyone has encounter'd this, and if anyone knew how i would go about resolving it.


This is how i created the bot:

Code:
//globally
new g_bot;
//...
public Action:timer_makeBots(Handle:timer)
{
        //Also curious about why the number doesn't get added.
	new number = 10;
	
	g_bot = CreateFakeClient("Normal WR");
	ChangeClientTeam(g_bot, 3);
	CS_SetClientContributionScore(g_bot, number);
	CS_SetClientAssists(g_bot, number);	
	return Plugin_Continue;
}

//How i try and start it
public startBot()
{
if(BotMimic_IsPlayerMimicing(g_bot)
BotMimic_StopPlayerMimic(g_bot);

//thePath being data/botmimic/test/%mapname%.rec
//This isn't the default path, I've changed the plugin around to make it save here.
//Theres no errors there, and the file saves correctly, and reads correctly
//I've tested it with testPath()
BotMimic_PlayRecordFromFile(g_bot, thePath);
}

stock testPath()
{
	decl String:sMapName[64];
	GetCurrentMap(sMapName, sizeof(sMapName));	
	decl String:sPath[PLATFORM_MAX_PATH];
	BuildPath(Path_SM, sPath, sizeof(sPath), "data/botmimic/test/%s.rec", sMapName);
	return FileExists(sPath);
}
Kasea is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-05-2015 , 17:38   Re: [Scripting]Fake client with BotMimic
Reply With Quote #2

Bots added with CreateFakeClient are unmanaged. VoiDeD has a little extension which simulates empty usercmds which you can change in sourcemod's OnPlayerRunCmd. Create the bot using that extension's BotController_CreateBot native.
__________________
Peace-Maker is offline
Reply



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


All times are GMT -4. The time now is 12:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode