Jump to content

[REL] SlothBot an AI fighting Bot for MTA


Slothman

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.

Link to comment
  • Replies 148
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 months later...
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.

Link to comment
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.

Link to comment
  • 5 months later...
  • 2 months later...
  • 11 months later...
  • 2 months later...

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
Link to comment
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.

+++

Link to comment
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 :).

+

Link to comment
  • 1 month later...
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) 

Link to comment
  • 3 months later...

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?

Link to comment
  • 1 year later...
  • 1 year later...
  • 6 months later...
  • 5 months later...
  • 2 weeks later...
  • 11 months later...
Hello, how are you, could you help me?
In the server logs it gives me the following error in the server.Lua line 33 file:

TrabajoHacker/server.Lua:33: exports: Call to non-running server resource (slothbot) [string "?"]  [DUP x12008]
The line in the server.Lua file is as follows: 
setTimer(function() exports ["slothbot"]:setBotAttackEnabled(source, true) end, 50, 0)    setTimer(function() exports ["slothbot"]:setBotAttackEnabled(source, true) end, 50, 0)
Sorry if the English is not good use the translator
Link to comment
  • 3 years later...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...