Forum
Maps/Editor
How to make Bots use buttons?
How to make Bots use buttons?
11 replies
1

This is how you could make bots use buttons "intelligent":
1
2
3
4
5
6
7
8
9
10
11
12
13
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
TimeQuesT is just giving a lead. In order to make bots use buttons you have to use
ai_use
eledah is right. It's just pseudocode. You have to write the 'real' code by yourself.
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
1
2
3
4
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
1

Offline