[Solved] BOTS using trigger objectives?

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

Moderator: Moderators

Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

[Solved] BOTS using trigger objectives?

Post 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 :wink:

So? What is it?
Last edited by Bjarne BZR on Thu Jul 03, 2003 2:56 am, edited 1 time in total.
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Uh I will try it :). Not sure if I can actually make them activate a trigger.
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yay it works :shock:

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)
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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...
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Do the documents need defending? :?
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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...
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Oh yeah, Axis defenders :oops:

Yeah maybe I can copy some of the bomb code then.
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Hmmm, I set up some routes to the triggers, and MOH:AA does not get it when I compile with -onlyents :cry:. So I'm making a full compile... tomorrow ( I hope ) I will see how the little botties handle their new trigger toys :)
Admin .MAP Forums
Image
Head above heels.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

yay! finally triggers! so they will work for my SH bots?
Live to map, not map to live.
-mohaa_rox, .map
moderator
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Cant see why not, rox....
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

jv_map wrote:Oh yeah, Axis defenders :oops:

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 :wink:

...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

???
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

It is a little bit more complicated (guess I'm not so structured after all :oops: ). 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.
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

For some reason it always seem so simple if you dont know the details :wink:

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....
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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 :cry: )
:D
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?
Admin .MAP Forums
Image
Head above heels.
Post Reply