NextBot Coding and Discussion Thread

I just looked, couldn’t find any documentation on NextBot.

I can’t find anything public with the headers etc… so if you want to just request stuff I will see if there’s methods for it.

Garry, is there/will be there any way to use custom walking animations? For example TF2 models don’t play walking animation unless you SetSequence it and then use SetCycle in a timer to make it loop.

Ways to detect if the bot wants to jump up or across a gap, climb, open a door, if a movable/breakable prop is in the way.
Functions to get the place name of a navarea, get all the navareas with a certain place name and get all the available place names in the map.

Just off the top of my head.

[editline]10th April 2013[/editline]

Also, how do you properly use BotPath:Chase?

You can animate how you want - it’s all Lua.

Cant wait to see what NPCs are to come.

I always wanted zombies that could actually give some challenge.

Working on TTT bots. Will post pics when I can

Is it possible to set an start point and an endpoint to the NextBot system for getting a path as a vector table?

It could find a use in Wiremod or other addons that enables you to build self-operating robots for example.

is scripted sequence works with Next Bot?

An NPC that is practically the example works on some maps (such as gm_construct), yet not others (which are older maps). Do these really not use nodes, or is there something else that could prevent it from moving? I spawned them at the player spawnpoints on a certain map, which had about 20% of the NPCs standing still where they spawned, but the rest moved.

navmeshes

To use on any other maps, you have to generate a mesh and tweak it.
Use nav_generate to generate a mesh from the spawnpoints. But this will not be 100% accurate due to how dynamic maps can be.

This may come off as a dumb question, but can you give the NPCs weapons and force them to attack entities?

I don’t think ENT:OnStuck() it working properly, In a map, there are some props which block the npc, the npc gets stuck in them, and it takes around 10 seconds before ENT:OnStuck() is called (maybe I did something wrong?)


local opts = { 
	lookahead = 300,
	tolerance = 45,
	draw = true,
	maxage = 0.1,
	repath = 0.1
}
				
self:MoveToPos( pos, opts )

Can someone point me to where opts is explained? I found if I set maxage to 0.1, the NPC will follow me well, if I set it to 1, it will walk to the end of it’s path, before trying to find my position again…

This is just the way it works internally. A lot of Valve’s scripts test the position to see if it’s moved in x seconds. If it hasn’t then it calls onstuck manually. Maybe the MoveTo function should do that - or maybe I should change the engine code to do it?

What’s the point of an stuck function if it only gets called after 10 seconds of being stuck? It should call it as soon as it thinks it’s stuck, and more ideally (if possible) it could return what it thinks is causing it to be stuck, so, if it’s stuck in a prop, I could tell the npc to attack said prop :stuck_out_tongue:

Sometimes it does. The logic behind it is a bit fucky. The stuck time is based on its max speed and stuff.

[lua]self:PlaySequenceAndWait( “sequence_name” )[/lua]

What map was it? Only CSS, TF2 and L4D maps use navmeshes as far as I know, and to use the CSS ones I had to extract them from the .gcf

It would be nice if the Nav files gets mounted too.

One of the problems with the nav files is that loading some of them for cs:s or tf2 will cause crashes - because they use kind of a special format especially for those games.

Would you accept user made nav meshes for official maps if they were good enough?