ai scripting question
Moderator: Moderators
-
coolmintyice
- Lance Corporal
- Posts: 11
- Joined: Sun Mar 30, 2003 2:53 pm
ai scripting question
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?
Entity Properties
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).
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).
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.
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.

