Jump to content

[REL] SlothBot an AI fighting Bot for MTA


Slothman

Recommended Posts

  • Replies 148
  • Created
  • Last Reply

Top Posters In This Topic

Not sure what's wrong then, but if you look again at the spawnBot function, it allows to spawn with a weapon.

https://wiki.multitheftauto.com/wiki/Slo ... t#spawnBot

element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = "hunting", element theModesubject = nil ] ) 

exports.Slothbot:spawnBot ( 2031.7695,1008.1705,10.5474+10, 10, 0, 0, 0, nil, 31) 

Link to comment
  • 5 months later...

step1: in editor, add the Slothbot to definitions.

step2: place the flags as waypoints.

step3: click "connection mode" button or press g

step4: click on the first flag, then click the flag you want to connect it to.

step6: for one way connections (paths that only go one way) press h or click "one-way connection" button

Link to comment

It is still not working.

I click on the first flag, nothing.

I cannot highlight it.

I clcik on the second flag, nothing.

Tried when E was pressed, idk how it is called,

and tried when it was not.

EDIT: Downloaded latest version of editor, still nothing.

Link to comment

Hi there, bots are working fine in follow mode, but when i make them "guarding" they stay on a place, but when i come in sight, whey follow me.... i thought they were suposed to stay on that place or not? all the other options do the same, they still follow me like a bad smell. heres the code. BTW it doesnt matter if i delete modesubject completely, its still the same. Also i removed the first line about the x y z cause i dont want them to get my position and folow me and it generated warnings.

function Spawnsoldiers ()

local rot=270

local skin=287

local interior=0

local dimension= 0

local team=Team

local weapon=31

local mode="guarding"

local modesubject=

call (getResourceFromName("slothbot"), "spawnBot", 23, 1518, 12.7, rot, skin, interior, dimension, team, weapon, mode, modesubject)

call (getResourceFromName("slothbot"), "spawnBot", 27, 1518, 12.7, rot, skin, interior, dimension, team, weapon, mode, modesubject)

end

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), Spawnsoldiers)

Link to comment

oh hey, but fortunately, i figured it out myself. so for EVERYONE WHO WILL EVER have similiar problem. heres key:

i basically had to do 1 function per 1 bot and make modesubject the variable x,y,z. Also, DONT SPAWN right next to them or they will follow you and totaly disobey the guard order. (if you spawn somewhere else and come, they wont move, if they see hostile they just shoot and wotn move either). Anyway The guarding location CAN be the same as their spawn location BUT you cant make one guard location for 2 bots because they wil be runing into each other, then theyll get stuck and wont do anything untill hit. and when they are hit they will chase so it wont work.

This is one of 2 soldiers to show you what i mean.

function Spawnsoldier ()

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

local rot=0

local skin=287

local interior=0

local dimension= 0

local team=Team

local weapon=31

local mode="guarding"

local modesubject= x,y,z

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

end

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), Spawnsoldier)

Link to comment
  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...
  • 1 month later...

I cant get this working. on MTA server 1.1.1

function helpbot(thePlayer) 
    local x,y,z = getElementPosition (thePlayer) 
     call(getResourceFromName("slothbot"), "spawnBot", x-2, y, z, 0, 287, 0, 0, helpme, 31, "following", thePlayer) 
end 

Bot pops up Stands there looking around or jumps around. doesnt follow. doesnt attack anything.... cant figure it out. and if i add setPlayerTeam(thePlayer, helpme) then for some reason it sets no team for player.... any help?

Link to comment

Hi all,

I just saw this resource today and had some questions about it:

How do you put bots in vehicles and make them go in a path you want them to go in? (ex. They drive/fly around the "Eight racing Track Stadium")

plus I need help with the map editor slothbot, I don't know how to make connections.

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