OrionBots - third release, rocket arena support
Moderator: InsideQC Admins
4 posts
• Page 1 of 1
OrionBots - third release, rocket arena support
Last edited by Orion on Sat May 12, 2007 6:29 pm, edited 2 times in total.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
Well, let me post a tut here, to fix the water pain and death sounds bug, and making the bot swim up when in lava, slime, or out of air.
After downloading the file above and reading readme, open 'bot.qc', scroll down to BotJump and you'll see something like this:
You have to delete that statement, that was just for testing, but going 1000 qu/s upwards is VERY unrealistic!
Now scroll down to BotThink. After CheckPowerups add this:
Well, it will now be called in BotThink instead of BotJump. He'll swim upwards when out of air, or when in lava or slime.
The second statement controls the water falling velocity. He won't sink like a rock like the previous versions.
Now scroll down until BotDie. Before DeathSound, just add:
When a non-client entity dies, its waterlevel resets to zero, that's why the bot is dying in water playing normal pain and death sounds.
Scroll up to bot_pain, and add the code in blue.
void() bot_pain =
{
if (self.weaponframe)
return;
if (self.invisible_finished > time)
return; // eyes don't have pain frames
self.waterlevel = SetWaterlevel ();
if (self.weapon == IT_AXE)
bot_axpain1 ();
else
bot_pain1 ();
};
Now compile!
After downloading the file above and reading readme, open 'bot.qc', scroll down to BotJump and you'll see something like this:
- Code: Select all
if (self.air_finished < time + 3 || self.watertype == CONTENT_SLIME || self.watertype == CONTENT_LAVA)
{
self.velocity_z = 1000; // go fuckin' fast upwards, this is life or death (trying to improve the swimming ai)
return;
}
You have to delete that statement, that was just for testing, but going 1000 qu/s upwards is VERY unrealistic!
Now scroll down to BotThink. After CheckPowerups add this:
- Code: Select all
if (self.air_finished < time + 5 || self.watertype == CONTENT_SLIME || self.watertype == CONTENT_LAVA)
{
self.angles_x = 30;
if (self.waterlevel >= 2)
{
self.flags = self.flags - FL_ONGROUND;
self.velocity_z = 320;
}
}
if (self.waterlevel && !self.velocity_x && !self.velocity_y)
{
if (self.velocity_z < -40)
self.velocity_z = self.velocity_z + 1;
}
Well, it will now be called in BotThink instead of BotJump. He'll swim upwards when out of air, or when in lava or slime.
The second statement controls the water falling velocity. He won't sink like a rock like the previous versions.
Now scroll down until BotDie. Before DeathSound, just add:
- Code: Select all
self.waterlevel = SetWaterlevel ();
When a non-client entity dies, its waterlevel resets to zero, that's why the bot is dying in water playing normal pain and death sounds.
Scroll up to bot_pain, and add the code in blue.
void() bot_pain =
{
if (self.weaponframe)
return;
if (self.invisible_finished > time)
return; // eyes don't have pain frames
self.waterlevel = SetWaterlevel ();
if (self.weapon == IT_AXE)
bot_axpain1 ();
else
bot_pain1 ();
};
Now compile!
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
4 posts
• Page 1 of 1
Return to Artificial Intelligence
Who is online
Users browsing this forum: No registered users and 1 guest
