ai scripting question

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
coolmintyice
Lance Corporal
Posts: 11
Joined: Sun Mar 30, 2003 2:53 pm

ai scripting question

Post by coolmintyice »

I have noticed numberous times that when i reveal myself to the AI, he waits a few seconds before shooting. this gives the player plenty of time to aim and pack the ai with bullets. i want the ai to shoot as soon as he spots the player. how can this be done. do i go into the ai.scr file and modify the script or do i change the ai parameters?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Entity Properties

Post by tltrude »

I think the vision and hearing properties can be changed in each ai entity (key N).

This is from the AI tips text file in the docs folder of MOHTools:
- noticescale: This scales how long it takes AI to see an enemy. At 100, it takes 100% as long as normal to see something; at 50, it takes half as long; at 200, it takes twice as long.

Have a look at the properties of one of the ai in m4l0 (a map file that came with the editor).
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

As far as I know noticescale doesn't make any difference at all.

I tried noticescale 1 and noticescale 100000 and couldn't say there was any significant difference in reaction speed.
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

you could always edit the ai.scr,

for $player *sees* $target
$target shootat $target

//not sure on the sees command but that's generally what you need

or create a new ai and enable that instead of the default ai
hope this helps, prob not cos it's all foreign 2 me :-/
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post by Angex »

I think scripting a decent AI would involve more than:

if($AI isAlive && $AI cansee $player){
$AI aimAndShootAt $player
}

It's probably best to check the AI characters settings.

I also had a though about the noticescale, maybe it ranges from 0 - 1 say, therefore 1 and 1000000 wouldn't make a difference. I haven't tested it yet as it was just an idea.
Post Reply