Jump to content

[REL] SlothBot an AI fighting Bot for MTA


Slothman

Recommended Posts

  • 1 month later...
  • Replies 148
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...
great to see that it works again :)

but something is wrong with teams for me,does anyone have problems with teams too ? bots fight but they dont care its teammate or enemy they fight fight fight... u know -- mortal-kombat ;D

edit im using 1.3

i had this issue too.

btw the throwable weapons (grande, molotov, etc..) is not handled it would be great if it would be.

some tactics improment would be also good (switching between weapons depends on distance or running around the target w/ tec/etc.. while shooting)

Link to comment

currently the bots can only have 1 weapon at a time, so weapon switching isn't really possible. The team bug is something I was made aware of, and im working to solve it properly rather than just a patch job. Throwable weapons are a a problem because peds can't throw projectiles weapons( or at least last I checked, maybe that's changed) and the only way to do it would be some hacky createProjectile method.

Link to comment
currently the bots can only have 1 weapon at a time, so weapon switching isn't really possible. The team bug is something I was made aware of, and im working to solve it properly rather than just a patch job. Throwable weapons are a a problem because peds can't throw projectiles weapons( or at least last I checked, maybe that's changed) and the only way to do it would be some hacky createProjectile method.

sounds great, il be back to my project then :)

Link to comment
addEvent("SpawnPetDog", true) 
function spawnDog() 
local x,y,z = getElementPosition (source) 
local rot= 90 
local skin=10 
local interior=0 
local dimension= 0 
local team=getPlayerTeam(source) 
local weapon=0 
local mode= "waiting" 
local modesubject=source 
dog =  call (getResourceFromName("slothbot"), "spawnBot", x, y+math.random(1,3), z+math.random(1,3), rot, skin, interior, dimension, team, weapon, mode) 
call (getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false) 
--setElementData(source,"HasPetDogpackOut", true) 
end 
addEventHandler("SpawnPetDog", getRootElement(), spawnDog) 

why isent the setBotAttackEnabled working? i dont know why and it dont come any error in debugsript

Link to comment

https://community.multitheftauto.com/index.php?p= ... ils&id=672

fixed team detection, new version uploaded.

i see what the problem is for setbotattackenabled. for some reason, i wait a bit of time to set certain aspects of the bot after it spawns. so to stop the bot from being able to shoot, do this:

setTimer ( call, 400, 1,getResourceFromName("slothbot"), "setBotAttackEnabled",thebot,false )

that should work

Link to comment

function Spawnsoldier ()

local x,y,z = 16.8071,1500.2646,12.75

local rot=0

local skin=287

local interior=0

local dimension= 0

local team=Team

local weapon=29

local mode=guard

local modesubject= getElementPosition(source)

call (getResourceFromName("slothbot"), "spawnBot", 16.8071,1500.2646,12.75, rot, skin, interior, dimension, team, weapon, mode, modesubject)

the teams are set in different resource but i made sure to run the team resource before the bot. Bad thing is, that I cant set the teams in the bot resource as I need the teams to work regardless the bot resource.

Edited by Guest
Link to comment

It looks like just another way of expressing a team name to me, but ill give it a shot.

EDIT: Yep I was right, it still doesnt work. Thanks for the try though.

Just to make sure everythings right, heres the code:

function Spawnsoldier ()

local x,y,z = 16.8071,1500.2646,12.75

local rot=0

local skin=287

local interior=0

local dimension= 0

local team= getTeamFromName ( "Team" )

local weapon=29

local mode=guard

local modesubject= getElementPosition(source)

call (getResourceFromName("slothbot"), "spawnBot", 16.8071,1500.2646,12.75, rot, skin, interior, dimension, team, weapon, mode, modesubject)

Link to comment

Now i have made the teams in the same resource as my bot script, but it still doesnt work. It worked perfectly before so i dont know whats wrong with it.

Maybe it has something to do with the eror slothbot/sbclient 114 attempt to compare boolean with a number. Can somebody tell me whats wrong in the sbclient script? Im convinced this is the cause of the faulty team recognition.

Link to comment

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...