Page 1 of 3
[Solved] BOTS using trigger objectives?
Posted: Sat Jun 14, 2003 11:26 pm
by Bjarne BZR
BOT's so far only handle bomb objectives, right? I want them to handle trigger objectives as well.
My case is the documents in Vemork factory, but I guess if the bots could be made to search for a trigger in the same way as a bomb: they could do a lot of cool stuff.
My thought here is: The behaviour is very similar to that of setting a bomb... so it should be possible by:
A) Treating my documents as bombs, thus using the magic of lib_bomb.scr
B) Make a lib_trigger.scr by copying lib_bomb.scr and doing a "search/replace" on the string "bomb", replacing it with "trigger", thus enabling such things as $triggercamp nodes and stuff like that (OK, a search/replace may not be all, but it will be maby 90% of the work).
C) Someone already sent jv the scripts for this.
D) Jv already did the scripts, but as he accidentally also scripted in his secret plans for world-domination: he can't release them to the public
So? What is it?
Posted: Sun Jun 15, 2003 6:24 am
by jv_map
Uh I will try it

. Not sure if I can actually make them activate a trigger.
Posted: Sun Jun 15, 2003 9:11 am
by jv_map
Yay it works
Here's a sample map and a bot plug-in.
http://home.student.utwente.nl/a.b.vrij ... rigger.pk3
The usage is pretty straightforward, but if the example map doesn't tell you all you need I will 8)
Posted: Sun Jun 15, 2003 11:58 am
by Bjarne BZR
Yep, that works great. But as I was planning to use it as an objective: is there a simple way to use the bombing version?
What I'm saying is: I need to be able to use $bombcamp ( $triggercamp? ) nodes for one team to defend the triggers...
Posted: Sun Jun 15, 2003 1:12 pm
by jv_map
Do the documents need defending?

Posted: Sun Jun 15, 2003 1:37 pm
by Bjarne BZR
Yes, the Axis will have an interest in defending them as they will loose if they don't prevent them from beeing stolen... same as with a bomb...
Posted: Sun Jun 15, 2003 2:19 pm
by jv_map
Oh yeah, Axis defenders
Yeah maybe I can copy some of the bomb code then.
Posted: Mon Jun 16, 2003 12:50 am
by Bjarne BZR
Hmmm, I set up some routes to the triggers, and MOH:AA does not get it when I compile with -onlyents

. So I'm making a full compile... tomorrow ( I hope ) I will see how the little botties handle their new trigger toys

Posted: Mon Jun 16, 2003 8:06 am
by mohaa_rox
yay! finally triggers! so they will work for my SH bots?
Posted: Mon Jun 16, 2003 10:00 am
by Bjarne BZR
Cant see why not, rox....
Posted: Tue Jun 17, 2003 9:37 pm
by Bjarne BZR
jv_map wrote:Oh yeah, Axis defenders
Yeah maybe I can copy some of the bomb code then.
As I've now got the allied running like lemmings to the triggers: I'm now starting to wonder about how the axis should react to this
...any idea on how to do that?
Code: Select all
waitthread global/jv_bots/jv_mp_ai.scr::addroute triggercamp
// And putting axis sniper nodes to protect them?
?
Nah... wont work I guess
But something tells me that if you are half as structured as a programmer as I think you are ( structured programmers scares an unstructured programmer like me

) you could change the bomb scripts ino a more general version handling any trigger by just adding 3 variables telling:
1) how long to "hold down the use button"
2) If the other team can reverse it
3) What teams can use the trigger at all
???
Posted: Wed Jun 18, 2003 8:32 am
by jv_map
It is a little bit more complicated (guess I'm not so structured after all

). Currently the bombs use 'bombattackcontrollers' and 'bombdefendcontrollers'. These threads assign subtasks to planting / defusing bots depending on the bomb state, i.e. exploded, beingdefused, beingplanted or ticking.
Moreover the plant and defuse code differs from the trigger code; currently the plant code is simply the following:
local.bomb waitthread global/jv_obj_dm.scr::bomb_set self
Thus the jv_obj_dm.scr is ordered to plant a bomb, the bots don't use a trigger.
The regular obj_dm.scr doesn't work with only a trigger either. A trigger is used to initiate the planting sequence, after that a loop checks if the player is still alive, close enough, looking at the bomb and pressing use. One major problem remains though, the obj_dm.scr gets the planter / defuser from the parm.other variable. I have not yet found a way to set this variable

.
Concludingly maybe it is possible to use the same code on some part (a very noble undertaking

), but I'm afraid the use of the current bomb code for triggers would result in an unnecessary scripting overhead.
Posted: Wed Jun 18, 2003 10:30 am
by Bjarne BZR
For some reason it always seem so simple if you dont know the details
Any ideas on how to simulate a "triggercamp" behaviour by the axis using the existing bots?
Just a quick acis "triggercamp" fix is good enough, as the the allies "attack" the triggers just fine as is.
I just need a way to get axis in the area and making them loose interest when the trigger is set....
Posted: Wed Jun 18, 2003 1:15 pm
by jv_map
Create $sniper or $camp nodes near the trigger with a huge #weight value. Then use a special trick to assign another targetname to these nodes, i.e. use $targetname.
Then when the trigger is triggered set noaxis to 1 for these nodes. Example:
$trigger_camp1.noaxis = 1
I don't think targetname arrays work very well when the thing has two targetnames, so probably each camp / sniper node has to have a unique $targetname.
Posted: Wed Jun 18, 2003 3:23 pm
by Bjarne BZR
Ahh... I knew I saw that $camp node stuff somewhere ( in the manual actually, but I guess I'm going blind lately

)
By assigning another
$targetname, will I "destroy" that node?
( My guess is that it will still work as a regular path node, it just won't be a camper/sniper node anymore... correct? )
And more importantly; will I destroy the route leading to the node, making the bots less likely to go there by assigning another $targetname to the node?