Jump to content

[REL] SlothBot an AI fighting Bot for MTA


Slothman

Recommended Posts

Posted
That was confusing, the call returns the bot element.
bot = call (getResourceFromName("Slothbot"), "spawnBot", 2031.7695,1008.1705,10.5474+10, 10) 
call (getResourceFromName("Slothbot"), "setBotWeapon", bot, 31)  

Well, it doesn't work. It spawns the bot, but it doesnt set the weapon

  • Replies 148
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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) 

  • 5 months later...
Posted

Hi, I have a problem.

I made waypoints, but i cannot connect them.

How to do it?

I searched the wiki, i searched google, but nothing about this.

Thanks

Posted

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

Posted

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.

Posted

I'm not sure what could be the issue then. You can try to press "k" to refresh the flag objects.

when you hover your mouse over the flag, do you see the objects description?

Posted

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)

Posted

what happened to you all? it was such an active topic, normal question, nswer time 1 or 2 days, and now nothing whole week? BTW conected pathpoints dont work either, they just stand there and do nothing

Posted

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)

  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...
Posted
what stops you from doing it?

1. its not my script

2. i cant script so well

anyway i want to get this topic back to the top so this epic resource gets some attention again. I think it should be further developed and not abandoned.

  • 1 month later...
Posted

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?

Posted

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.

Posted

Sorry, but... HAHAHAHA.

There's no part mentioning ANYTHING about driver peds. You have to modify it yourself to make it work.

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