Bots!!!

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Sputnik
Colour Sergeant
Posts: 85
Joined: Thu Jul 04, 2002 12:36 am
Location: V.A.

Bots!!!

Post by Sputnik »

Hey, Jv_map: I followed the tut. on creating your own AI, and it works great!! Now I Just need to figure out how to make them say stuff. I also was thinking-would it be possible to add SH AI to AA maps??

Also: Is there a way to make a friendly AI run to a certain pathnode, once a trigger is set off??
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

You can't add SH AI to AA, as MoHRad crashes with SH. To make AI run to a certain pathnode, try this:

your trigger, with setthread "AI"

your script:

AI: //this will be called out when triggered
$ainame runto $pathname

If all fails, try:

$ainame thread global/runto.scr::pathname

haven't tried that, but give it a go. Thought I saw this in some script though.
Live to map, not map to live.
-mohaa_rox, .map
moderator
Innkeeper
Colonel
Posts: 475
Joined: Mon Nov 25, 2002 10:13 pm
Location: NC, USA (about 7.5 klicks from the capital dome)
Contact:

Post by Innkeeper »

I must be one of the lucky ones. Spearhead does not crash mohradiant for me and I can add anything from Spearhead including AI. :D
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

That's so good. I envy you. EA promised to release the LDK for SH, but there's no sign of it. :cry:
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

mohaa_rox wrote:You can't add SH AI to AA, as MoHRad crashes with SH. To make AI run to a certain pathnode, try this:

your trigger, with setthread "AI"

your script:

AI: //this will be called out when triggered
$ainame runto $pathname

If all fails, try:

$ainame thread global/runto.scr::pathname

haven't tried that, but give it a go. Thought I saw this in some script though.
Both will work (and do the same ;) ), but there's one thing you need to bear in mind. If you just use this plain code, the AI will still try to attack enemies. That causes erratic movements, since the AI is both seeking for cover and running to your pathnode. You can avoid this by either disallowing the AI to attack enemies (type $ainame.enableEnemy = 0) or by eliminating their cover search routines ($ainame.leash = 0).

An easier way is to use AIs with their types set to 'runner'. If you also add key 'waittrigger' value 1, they will wait for a trigger event. You can just target your trigger to the AI.
Image
Sputnik
Colour Sergeant
Posts: 85
Joined: Thu Jul 04, 2002 12:36 am
Location: V.A.

Post by Sputnik »

Well, I tried this:

I set up a trigger_multiple with

setthread runto_elevator

and the thread says

runto_elevator:
level.friendly1 runto elevator_node.

The only problem is, that when I walk through the trigger the AI suddenly spawns (it doesn't spawn at the beginning of the map) and runs to the node. Any ideas??
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Try to set this, easier to understand:

level.ai_runner = level.friendly1

level.ai_runner runto $elevator_node
Live to map, not map to live.
-mohaa_rox, .map
moderator
Sputnik
Colour Sergeant
Posts: 85
Joined: Thu Jul 04, 2002 12:36 am
Location: V.A.

Post by Sputnik »

Isn't that the same as my script??

Anyway, now most of the time he gets into the elevator successfully.
Image
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

any spear user can use ai with mohrad

just rename mainta to something without main in it

change it back to mainta to play spearhead
Post Reply