Brick Squad Gamers
U MUST LOGIN TO BECOME ACTIVE IN THIS FORUM
Brick Squad Gamers
U MUST LOGIN TO BECOME ACTIVE IN THIS FORUM
Brick Squad Gamers
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Modding All Day Every Day Because We Fucking Can
 
ActivityHomeLatest imagesRegisterLog in

 

 bot mods (funny)

Go down 
2 posters
AuthorMessage
ii UzE MoDzZ
Spammer
Spammer
ii UzE MoDzZ


Posts : 34
Join date : 2010-05-18
Age : 27
Location : england

bot mods (funny) Empty
PostSubject: bot mods (funny)   bot mods (funny) Icon_minitimeWed May 26, 2010 2:36 pm

Spawning
First off, your going to need to add some functions...

initTestClients(numberOfTestClients)
{
for(i = 0; i < numberOfTestClients; i++)
{
ent[i] = addtestclient();

if (!isdefined(ent[i]))
{
wait 1;
continue;
}

ent[i].pers["isBot"] = true;
ent[i] thread initIndividualBot();
wait 0.1;
}
}

initIndividualBot()
{
self endon( "disconnect" );
while(!isdefined(self.pers["team"]))
wait .05;
self notify("menuresponse", game["menu_team"], "autoassign");
wait 0.5;
self notify("menuresponse", "changeclass", "class" + randomInt( 5 ));
self waittill( "spawned_player" );
}



Next, your going to need to add one of this to your onPlayerConnected() function.

if( self issubstr( self.name, "YOUR GT HERE" ) ) // Put your GT here
self thread initTestClients(5); //Replace 5 with however many bots you want



You can't use the isHost() function here, because the bots are also on the host xbox with you, so when they spawn they'll spawn more bots who will spawn more bots who will spawn more etc...

Thats basically it actually. That spawns the clients just like you want, however in order to control them, it takes some skill. Here is some simple controls I did.

Controlling
Before we start, I'm going to tell you some preset dvars so you can know what we're working with here.

testClients_watchKillcam //Testclients will not press buttons during killcam
testClients_doCrouch //Testclients will use the crouch button
testClients_doReload //Testclients will use the reload button
testClients_doMove //Testclients will use the movement
testClients_doAttack //Testclients will use the attack button



First, remember that if statement we did above in the onPlayerConnected() function? Your going to want to add all your control threads to that. Here are some simple control threads I just whipped up.

watchShoot()
{
for(;Wink
{
while(self AttackButtonPressed())
{
setDvar( "testClients_doAttack", 1 );
wait 0.1;
}
setDvar( "testClients_doAttack", 0 );
wait 0.1;
}
}

watchCrouch()
{
self endon( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "bbutton", "+stance" );

for( ;; )
{
if ( self GetStance() == "crouch" )
setDvar( "testClients_doCrouch", 1 );
else
setDvar( "testClients_doCrouch", 0 );
wait 0.1;
}
}



And this is what my if statement in the onPlayerConnected() function looks like...

if( self issubstr( self.name, "CraigChrist8239" ) )
{
self thread watchShoot();
self thread watchCrouch();
self thread initTestClients(5);
}



Now, lets say you want to provide all the bots with a certain function, say god mode. You can accomplish that this way.

foreach(player isBot in level.players)
{
if( isBot.pers[ "isBot" ] )
isBot thread doGod();
}



As you can see, with complex coding and threading, you could make a fully functioning bot game with no human interaction at all. You can use these entitys like anything else, so when Lost releases that forge, we can move them around and s***.


i dont take credit.
Back to top Go down
BsGMurkiin
Administrator
Administrator
BsGMurkiin


Posts : 151
Join date : 2010-04-28
Age : 32
Location : Newport News, VA

bot mods (funny) Empty
PostSubject: Re: bot mods (funny)   bot mods (funny) Icon_minitimeWed May 26, 2010 3:30 pm

you copied it pretty bad
Back to top Go down
ii UzE MoDzZ
Spammer
Spammer
ii UzE MoDzZ


Posts : 34
Join date : 2010-05-18
Age : 27
Location : england

bot mods (funny) Empty
PostSubject: Re: bot mods (funny)   bot mods (funny) Icon_minitimeWed May 26, 2010 3:55 pm

BsGMurkiin wrote:
you copied it pretty bad
i said i dont take credit
Back to top Go down
Sponsored content





bot mods (funny) Empty
PostSubject: Re: bot mods (funny)   bot mods (funny) Icon_minitime

Back to top Go down
 
bot mods (funny)
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Brick Squad Gamers :: Xbox 360 :: Jtag Modding-
Jump to: