Bots & Flak88

Please use this forum to ask all your MoHAA Bots questions / discussions

Moderator: Moderators

Post Reply
johnnymiller
Corporal
Posts: 30
Joined: Wed Jul 09, 2003 2:26 am
Location: New Zealand

Bots & Flak88

Post by johnnymiller »

Have a usable Flak88 in the crossroads bot map. My question is, is there anyway to get the bots to man the flak? Searched through the topic's and did not notice any subject along this line.

Thanks in advance :)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Hmm no, such behaviour does not as of yet exist, though, if you really want it you could extend the bots with an additional task :)
Image
johnnymiller
Corporal
Posts: 30
Joined: Wed Jul 09, 2003 2:26 am
Location: New Zealand

Post by johnnymiller »

Hi JV. How do I go about this? along the line of task priorities in your bots manual, chapter 10?

10.1 Task Priorities

The easiest way of modifying bot behaviour is by changing their priorities for certain tasks. If you for example think bots are trying a direct bomb assault too much - instead of snipering from a distance - you could try to either raise the sniper priority or drop the priority of the bomb planting behaviour. You can do so in your level script.

The following tasks are by default implemented in the bot script:

* attackbomb: Plant and protect planted bombs (default priority: 1).
* defendbomb: Defuse and defend bombs (default priority: 1).
* follow: Follow players (default priority: 1.5)
* machinegun: Use a machinegun turret (default priority: 0.5)
* sniper: Stand in place and engage long-range targets (default priority: 0.1)
* camp: Camp at a $camper node to ambush the enemy (default priority: 0.1)
* health: Quick task to pick-up a medkit (default priority: 10)

To change the priority of a certain task, you must change the priority value as stored in the ?level.jvbot_tasks_priority? array. For example, to assign a task priority of 2 for the sniper task, type:
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I think this is what he is talking about maybe
8.3 Special Actions

The route system allows special bot actions at any node of the route. These actions can make your bots look smarter and more realistic. The essence of the system is that no regular navigation info is required, since it's all stored in the routes and routelists. This allows bots to navigate outside the scope of the pathnode navigation system that's used by the game AI.

To setup a special action, you need to add an ‘$action’ key at a route node. Any bot that reaches this node when following the route it belongs to, will perform the action defined. All special actions should be in a separate script file, which is named ‘special_(action).scr’ and located within the bots folder. The value of the $action key should be the suffix of the action script. For example, to use the script ‘special_crouch.scr’ (a possible application of the route system), the $action key should be ‘crouch’. The ladder script is currently the only special action script available.

Moreover, one additional parameter is allowed which is set by using the ‘#actionset’ key. Generally, this key should just be a unique number to discern which node triggered the action. For instance, this could determine which ladder a bot should use. You may use the same #actionset values for different actions.

As the first node of a route (highest #id) is always skipped by bots, it has no use to add an $action key to such a node. If you need to do so, add another node just in front with a higher #id.
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Hmm no special actions are only for the routing system (to do special moves like climbing a ladder). You can also add complete tasks to bot behaviour, however this option is not described in the bot manual (probably because I was lazy).

For instance, you could make a file task_flak.scr in the global/jv_bots folder, containing at least 4 threads:

Code: Select all

setup:
// ...
end

Code: Select all

getpriority:
// ...
end local.score::local.parm1::local.parm2::....

Code: Select all

evaluate local.parm local.onlyeval:
local.parm1 = local.parm[1]
local.parm2 = local.parm[2]
// ...
end local.score

Code: Select all

action:
// ...
end
At any time in the game you can add your new task via the map script:

waitthread global/jv_bots/jv_mp_ai.scr::addtask flak some_priority_number

Unfortunately I don't know all the details anymore off the top of my head, and I'm somewhat short on time at the moment, but if you look at some of the 'stock' task_xxx scripts, you should be able to work out the function of the 4 threads in the task script.

Ehh.. good luck! :?
Image
johnnymiller
Corporal
Posts: 30
Joined: Wed Jul 09, 2003 2:26 am
Location: New Zealand

Post by johnnymiller »

Okay, thanks JV. I'll peruse the the task scripts and see if I can work it out from there. Not going to lose any sleep if it proves beyond my capabilities.
:!:
User avatar
LilChefDeath
Corporal
Posts: 36
Joined: Sun Nov 26, 2006 7:48 am

Post by LilChefDeath »

umm couldnt you just make it like the mg_gunner tasks? and just switch a few things? Well i think i will try that...
Image

Code: Select all

 local.player uhh_whatNow?" 
Post Reply