Forum

> > CS2D > Maps/Editor > How to make Bots use buttons?
Forums overviewCS2D overview Maps/Editor overviewLog in to reply

English How to make Bots use buttons?

11 replies
To the start Previous 1 Next To the start

old How to make Bots use buttons?

Louie
User Off Offline

Quote
So im almost finished with a map im making but the Bots are a bit stupid,because my map has many spots where u have to press buttons for certain doors to open,but the Bots dont do that,they just wander the spawn area the only time they go out of the spawn area is if i open a door,then they will start going to the enemy spawn spot or some other place,how do i make Bots to open the doors for themselves?

old Re: How to make Bots use buttons?

TimeQuesT
User Off Offline

Quote
Well you have to add it to the script located in the "bots" folder.
This is how you could make bots use buttons "intelligent":

1
2
3
4
5
6
7
8
9
10
11
12
13
Check for buttons in range
if found:
	Already used by another player/bot?
	yes:
		ignore
	no:
		Check trigger chain for deadly events. (Like env_explosion near the bot)
		if safe:
			goto the button and use it.
		else
			ignore
else
	Repeat this step

old Re: How to make Bots use buttons?

Louie
User Off Offline

Quote
I copied and pasted the script to the Standard AI.lua file LOL but theres a problem now the bots wont even revive they just stay dead.

old Re: How to make Bots use buttons?

_Yank
User Off Offline

Quote
@user Zeik: With the CS2D current API it is. The problem is that it is painful, boring and we can't make it much advanced....
edited 1×, last 17.12.14 03:36:18 pm

old Re: How to make Bots use buttons?

eledah
User Off Offline

Quote
1
2
3
4
local players = player(0, "table")
for _,id in pairs(players) do
	if (player(id, 'bot')) then ai_use(id) end
end

Not sure if it helps tho
To the start Previous 1 Next To the start
Log in to reply Maps/Editor overviewCS2D overviewForums overview