Xierra Posted April 12, 2010 Share Posted April 12, 2010 Okay, I'll see what's next. I have a suggestion: Driveby support. Can you give me the example of scripting with this resource? Cause I'm still a noob Link to comment
karlis Posted April 12, 2010 Share Posted April 12, 2010 (edited) slothman, better return bot element if bot is spawned, then its posible for scripters to integrate own features document that spawnBot will return bot element, not bool ----------------- ped nametags from peds resurce(credits to 50p) addEventHandler( "onClientRender", getRootElement(),function() for k, myPed in pairs( myPeds ) do local x, y, z = getElementPosition( myPed ) if isElementOnScreen( myPed ) then local X, Y = getScreenFromWorldPosition( x, y, z ) if X then dxDrawRectangle( X - 30, Y - 20, 60, 10, tocolor( 0, 0, 0, 120), 10 ) local health = getElementHealth( myPed ) local lineLength = 56 * ( health / 100 ) dxDrawRectangle( X - 28, Y - 18, lineLength, 6, tocolor( 255, 0, 0, 100 ), 6 ); end end end end) Edited April 12, 2010 by Guest Link to comment
]-[ippy Posted April 12, 2010 Share Posted April 12, 2010 This looks nice, maybe you can have an EDF where you can place bot spawnpoints and in their properties, you can set their skin, team ( Which will have the default team colour ), name and so on. Justnow, I think you have to script bots into maps and since I don't have a clue on much scripting, it might be a bit hard for me to script bots into a load of maps. Anyways, it looks good so far, keep up the good work. Link to comment
Slothman Posted April 16, 2010 Author Share Posted April 16, 2010 for those interested in seeing what a bot can do, heres a gamemode that uses bots to create a squad of bots at the command of players. the gamemode was written by dragon and ts based on a game from team fortress. really shows off what the bots are capable of. https://community.multitheftauto.com/index.php?p=resources&s=details&id=682 Link to comment
Xierra Posted April 16, 2010 Share Posted April 16, 2010 Yeah that really rocked the bot system, SA-MP can't do that yet! Bot scripting Capabilities score graph (not that perfect ): 5| - 4| - 3| - - 2| - - 1| - - MTA Bots SA-MP bots Hey actually I sucessfully created a bot already. Thanks Sid the Sloth(man)! You rock! Link to comment
karlis Posted April 16, 2010 Share Posted April 16, 2010 i dont agree 5| - 4| - 3| - 2| - 1| - - MTA Bots SA-MP bots samp has ability to JUST record a bot and kick it, it dont worth 3/5 mark Link to comment
Slothman Posted April 16, 2010 Author Share Posted April 16, 2010 honestly ive never seen the samp bot in action, i hear conflicting stories about what it's capable of. I've really focused on the fighting aspect of the bot so far, but im sure other capabilities wouldnt be hard to add (ie: driving) Link to comment
karlis Posted April 17, 2010 Share Posted April 17, 2010 you didnt loose anything, they just have record possibility(good sync tough) and possibility to force bot join/quit and just play record.thats all. Link to comment
Xierra Posted April 17, 2010 Share Posted April 17, 2010 Hmm okay then. Since MTA bots are 3x better (+shooting and targeting capability), I'm sure SA-MP bots are knocked out for good. To all newbies: Here's the simple example of creating a bot which will chase and kill the creator of the bot (bots can also shoot each other too sometimes) with a command "spawnbot" bot.lua (Server-side): function Spawnbot1 (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=220 local interior=0 local dimension= 0 local team=false local weapon=26 local mode= "chasing" local modesubject=source call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) call (getResourceFromName("slothbot"), "spawnBot", x, y+7, z, rot, skin-9, interior, dimension, team, weapon+2, mode, modesubject) end addCommandHandler("spawnbot", Spawnbot1) call is a function to take functions from other resources. Slothbot uses one of these. Wiki: https://wiki.multitheftauto.com/wiki/Call And don't forget about the Meta.xml that you need to export the function! <meta> <info type="script" author="XX3" Version="1.0" name="Simple bot script" /> <script src="bot.lua" type="server" /> -- The bot script file <export function="spawnBot" type="server"/> --This is the function you want to export meta> Link to comment
Dark Dragon Posted April 17, 2010 Share Posted April 17, 2010 you don't need to export functions you use. exporting is needed if you want other resources to be able to access your functions. Link to comment
Slothman Posted April 17, 2010 Author Share Posted April 17, 2010 that's right, i already exported the functions fom my end. all scripters need to do is use the call function. Link to comment
karlis Posted April 17, 2010 Share Posted April 17, 2010 i think thats not 100% right exports.resName:functionName(args) is much more common and i think it should be showed to LUA newbies, as its easier to understand Link to comment
Dark Dragon Posted April 17, 2010 Share Posted April 17, 2010 some use exports.resName:functionName(args) others use call(resource,functionName,[...args...]), that doesn't matter much but you don't ever need to put the function you want to call in your meta.xml Link to comment
Taalasmaa Posted April 20, 2010 Share Posted April 20, 2010 Very nice job Slothman.. I'm building survive mode and this will be more than pérfect for it Link to comment
Slothman Posted April 22, 2010 Author Share Posted April 22, 2010 any gamemode creators who need help implementing the bots, or any questions on modifying the script, don't hesitate to ask me. I check the forum and irc religiously, and i really would like to see this bot used (just to prove to myself it wasnt a waste of time) Link to comment
Xierra Posted April 23, 2010 Share Posted April 23, 2010 Sure man. I wanted to edit TDM or BaseMode to implement bots, to fell like you're playing with friends, but actually only one person, like CS bots. Maybe when I have free time I could do it. , I just need to learn more, that's all! Link to comment
Taalasmaa Posted April 23, 2010 Share Posted April 23, 2010 any gamemode creators who need help implementing the bots, or any questions on modifying the script, don't hesitate to ask me. I check the forum and irc religiously, and i really would like to see this bot used (just to prove to myself it wasnt a waste of time) I tried to contact you with the pm, but you don't response. Link to comment
AeroXbird Posted May 6, 2010 Share Posted May 6, 2010 This script smells, Awesome. Very very nice, also usefull if you want to play stealth mode, but your all alone Link to comment
doobe Posted May 28, 2010 Share Posted May 28, 2010 So... Looks like I can't create bus driver npc within this.. Right? Link to comment
Slothman Posted May 28, 2010 Author Share Posted May 28, 2010 this bot is designed for war, not domestic use. would you let a T-1000 babysit your infant? Link to comment
TheDynho Posted June 23, 2010 Share Posted June 23, 2010 hello everyone, i'm having trouble to istall the slothbot, if someone can tell me step by step.. i download the slothbot.. go to mta folder,mta resources and replace sbtest, then, i create a server and use the command spawnbot? is it? can someone help me? grateful. Link to comment
ahmedkhaled Posted June 24, 2010 Share Posted June 24, 2010 guys i am having trouble setting bot as my teammate can some please help me function Spawnbot1 (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=285 local interior=0 local dimension= 0 local team="BotTeam" local weapon=21 local mode= "following" local modesubject=source call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) call (getResourceFromName("slothbot"), "spawnBot", x, y+7, z, rot, skin-9, interior, dimension, team, weapon+2, mode, modesubject) end addCommandHandler("spawnbot", Spawnbot1) as u can see it's team BotTeam i made that botteam too in my server with panel adn put mysellf in it but bots follow me adn kill me why they kill me? it said it follows a teammate if it's following on wiki slothman resource can somone plz help adn nice resource btw slothman Link to comment
Dark Dragon Posted June 24, 2010 Share Posted June 24, 2010 the function probably expects you to pass the team element, not the team name. use getTeamFromName("BotTeam") Link to comment
Slothman Posted June 24, 2010 Author Share Posted June 24, 2010 exactly, its one of the hardest things to remember is to not use the team name as the team element, even when i was scripting it i forrgot that fact and had to go back and revice it. TheDynho : the new slothbot resource isnt the same as sbtest. that was an older script i made with an early version of the slothbot. in order to use the slothbot now, you need to actually script something to spawn a bot. a cmmand to spawn a bot would be simple, the above script that ahmedkhaled posted is a good example of that. but you could also write a script that spawns bots in a gamemode automatically, or even make something like a marker ingame that when you walk into it, it'll spawn a gang member for you Link to comment
hotpotatoe Posted July 3, 2010 Share Posted July 3, 2010 Hi I would find it great, if someone could make a gui for freeroam, where you can set skin, weapon, team, mode etc. greets Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now