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

Posted

Thanks for the bug fix slothman. But debugscript is still spamming me with red error messages. About comparing bolean with numbers and such.

Posted

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

in game nick [LT]Daros

real join date 2007 ~

  • 4 weeks later...
Posted
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)

Posted

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.

Check out my recent work:

ZDay - a zombie script

Slothbot - an AI deathmatch bot

my community profile (all my resources)

Posted
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 :)

in game nick [LT]Daros

real join date 2007 ~

Posted
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

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

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

Check out my recent work:

ZDay - a zombie script

Slothbot - an AI deathmatch bot

my community profile (all my resources)

Posted (edited)

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
Posted

Where's "Team" defined?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You defined a variable in another resource ( not a script in the same resource as Spawnsoldier function ) and you expect it to work?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

That'll not work, variables aren't shared by resources.

You can use getTeamFromName.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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)

Posted

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.

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