Sign in to follow this  
Slothman

[REL] SlothBot an AI fighting Bot for MTA

Recommended Posts

Is it possible to make a system that, if the bot mode is hunting and the subject is on a car then, if the bot is near on any car, he will try to enter that car and chase the subject. And also if the bot mode is follow and if the subject is on his own team, then he will enter the subject's car as passenger. I hope you got my point.

Share this post


Link to post
step1: in editor, add the Slothbot to definitions.

step2: place the flags as waypoints.

I'm trying to do exactly that, but it fails because the button for the flags does not appear anymore. Debugscript outputs a relevant message:

WARNING: editor_gui\client\me_gui.lua:172: Bad file path @ 'guiStaticImage' [] 

Version string of the server is "MTA:SA Server v1.3-release-4400".

EDIT: Oh well, the lack of any documentation on how to do the path creation in the editor made me forget I had to scroll the mouse when I'm hovering over the default icons for objects, markers, etc.. I now at least have the generic icon that shows up when the actual Icon can't be loaded.

But the point that the actual icon (flag) meant to be used doesn't show up still remains.

Share this post


Link to post
Is it possible to make a system that, if the bot mode is hunting and the subject is on a car then, if the bot is near on any car, he will try to enter that car and chase the subject. And also if the bot mode is follow and if the subject is on his own team, then he will enter the subject's car as passenger. I hope you got my point.

no it is not, since peds cant enter or exit vehicles last I checked.

Share this post


Link to post

Can someone tell me (or make video?), step by step, how to spawn bots? I spend one hour trying to spawn this bots and searching in this topic and on wiki how to do that, but I really don't know how to do this.

Share this post


Link to post

Very nice script :).

I created a little script to add one hunting bot and I created some path in the map editor, but how to use my paths ?

I tried to simply add the map file in my meta.xml :

<map src="myWaypoints.map" dimension="0"></map> 

But the bot doesn't follow my defined paths.

It is probably a stupid question, but I didn't find any answer to my question on the forum and Google.

Thanks a lot.

Edited by Guest

Share this post


Link to post
Can someone tell me (or make video?), step by step, how to spawn bots? I spend one hour trying to spawn this bots and searching in this topic and on wiki how to do that, but I really don't know how to do this.
I also would like to know how to spawn bots.

  • Download the last version of slothbot here
  • Put the zip in "Your_MTA_directory\server\mods\deathmatch\resources\" directory.
  • In your mtaserver.conf, add the reference to slothbot resource adding the following line :
    <resource src="Slothbot" startup="1" protected="0" /> 
    


  • In your client side mod, add the following line (do'nt forget to define the x, y and z variables) :
    exports.slothbot:spawnBot(x, y, z, 0) 
    

You should have a hunting bot on your server.

+++

Share this post


Link to post
Very nice script :).

I created a little script to add one hunting bot and I created some path in the map editor, but how to use my paths ?

I tried to simply add the map file in my meta.xml :

<map src="myWaypoints.map" dimension="0"></map> 

But the bot doesn't follow my defined paths.

It is probably a stupid question, but I didn't find any answer to my question on the forum and Google.

Thanks a lot.

Hi,

I read the code and the algorithm just select a way point closer of the destination than the current way point...

I'll code my own bots and add the A* algorithm.

Thanks for this script :).

+

Share this post


Link to post

Is there any way I can make a bot/dog that follows a certain player and attacks if someone attacks the player ive tryed everything but nothing seams to work the dog always attacks the player who spawns it

Share this post


Link to post
function Spawndog (source) 
    local x,y,z = getElementPosition (source) 
    local rot= 90 
    local skin=79 
    local interior=0 
    local dimension=0 
    local team=GetPlayerTeam (source) 
    local weapon=0 
    local mode= "following" 
    local modesubject=source 
    call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) 
    end 
    addCommandHandler("spawndog", Spawndog) 

Share this post


Link to post

im trying to make dayz-like bot spawning but i know my code is gaberge

function napierdalaczbotow (source) 
  
          outputChatBox("spawn on") - 
  
function napierdalacz ( ) 
  
local x,y,z = getElementPosition (source) 
    local rot= 90 
    local skin=math.random(220) 
    local interior=0 
  
    local dimension= 0 
    local team = nil 
    local weapon=1 
    local mode= "chasing" 
    local modesubject=source 
    bot1 = call (getResourceFromName("slothbot"), "spawnBot", x+math.random(20), y+math.random(20), z, rot, skin, interior, dimension, team, weapon, mode, modesubject) 
  
 bot2 = call (getResourceFromName("slothbot"), "spawnBot", x-math.random(20), y+math.random(30), z, rot, skin, interior, dimension, team, 6, mode, modesubject) 
  
setPedHeadless(bot1, true) 
end 
  
setTimer ( napierdalacz, 30000, 0 ) 
end 
 addCommandHandler("botstart", napierdalaczbotow) 
  

is there any better way to do this?

Share this post


Link to post

does it work? can you make a computer in human for follow you with a weapon with this script?

Share this post


Link to post

"onBotFindEnemy" event is not working , it only works when a bot is killed; is it a refreshing problem?

Share this post


Link to post
On 05/08/2012 at 20:08, Slothman said:

no it is not, since peds cant enter or exit vehicles last I checked.

New Link for download please

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.