Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Jeffro429 on September 23, 2007, 04:41:13 pm

Title: how to make the A.I. fire from a further distance
Post by: Jeffro429 on September 23, 2007, 04:41:13 pm
i increased the weapon range in the weapons table... my question is how do i make the A.I. take advantage of the extra range? they should start firing from a further distance now, but i notice they dont...
Title: Re: how to make the A.I. fire from a further distance
Post by: Wanderer on September 24, 2007, 12:34:26 am
Can you tell a bit more about what you did and also about the table entries you are using?
Title: Re: how to make the A.I. fire from a further distance
Post by: Nuke on September 24, 2007, 01:11:03 am
first off be sure lifetime*velocity can get the weapon to the range you want. for turrets you may also need to enable awacs for that turret, i had to do this for the dante's long range beam cannons to get them to shoot anything.
Title: Re: how to make the A.I. fire from a further distance
Post by: Wanderer on September 24, 2007, 01:35:17 am
Yeah.. Lifetime x velocity has to be equal or larger to the intended firing range. After that you can tweak the range by setting the weapon range. If lifetime x velocity is larger than set max range then AI targets and shoots only within the set range but the weapon continue until they run out of life(time)
Title: Re: how to make the A.I. fire from a further distance
Post by: aRaven on September 24, 2007, 02:55:51 pm
look into ai_profiles.tbl

there is a setting for that
Title: Re: how to make the A.I. fire from a further distance
Post by: Jeffro429 on September 24, 2007, 06:05:56 pm
Can you tell a bit more about what you did and also about the table entries you are using?

i increased the life time of the weapons times 2. i seen in the wiki that you can add "+weapon range:" to increase or decrease the distance to the A.I.s target before it starts firing. i tried to add +weapon range: under the avenger cannon... and nothin happens.

first off be sure lifetime*velocity can get the weapon to the range you want. for turrets you may also need to enable awacs for that turret, i had to do this for the dante's long range beam cannons to get them to shoot anything.

yea i know.

Yeah.. Lifetime x velocity has to be equal or larger to the intended firing range. After that you can tweak the range by setting the weapon range. If lifetime x velocity is larger than set max range then AI targets and shoots only within the set range but the weapon continue until they run out of life(time)

how do i set the weapon range?  i dont know if im doing it right... and i dont totally understand what you are saying.


look into ai_profiles.tbl

there is a setting for that

which setting would that be?
Title: Re: how to make the A.I. fire from a further distance
Post by: aRaven on September 24, 2007, 06:43:45 pm
change to

$AI In Range Time:                           -1,    -1,  -1, -1,    -1

for all difficulty settings

Title: Re: how to make the A.I. fire from a further distance
Post by: Nuke on September 24, 2007, 07:05:44 pm
+weapon range: sets the range at which ai will need to close before it fires. life*vel is more about how far the weapon will be able to go. if youre velocity is 500 and your life is 3 youl go 1500k. if youre targets at 2000k then the weapon will die 500 meters from the target and be removed from the game. im not sure if +weapon range: overrides vel*time or if the game is smart enough not to fire weapons that wont hit. the ai table on the other hand is news to me :D
Title: Re: how to make the A.I. fire from a further distance
Post by: Jeffro429 on September 24, 2007, 08:25:26 pm
change to

$AI In Range Time:                           -1,    -1,  -1, -1,    -1

for all difficulty settings



yea that doesnt help.. sorry... the enemy still doesnt fire untill hes like 1000 meters

+weapon range: sets the range at which ai will need to close before it fires. life*vel is more about how far the weapon will be able to go. if youre velocity is 500 and your life is 3 youl go 1500k. if youre targets at 2000k then the weapon will die 500 meters from the target and be removed from the game. im not sure if +weapon range: overrides vel*time or if the game is smart enough not to fire weapons that wont hit. the ai table on the other hand is news to me :D

i know how the life and velocity works... i want to know how to change when the A.I. starts shooting at a certain range so it takes advantage of the maximum range which i know is life times velocity...  where do i put the +Weapon Range: ?

Title: Re: how to make the A.I. fire from a further distance
Post by: Nuke on September 24, 2007, 09:04:00 pm
right before flags
Title: Re: how to make the A.I. fire from a further distance
Post by: Wanderer on September 24, 2007, 11:14:21 pm
Can you post the table entry?
Title: Re: how to make the A.I. fire from a further distance
Post by: Nuke on September 25, 2007, 09:43:33 am
+weapon range: 1200
$flags: ()

:D
Title: Re: how to make the A.I. fire from a further distance
Post by: Wanderer on September 25, 2007, 11:51:26 am
Argghhh... Not you!  :lol:
Title: Re: how to make the A.I. fire from a further distance
Post by: Nuke on September 25, 2007, 12:57:47 pm
heh :D

i realised who you were talking to after i posted.
Title: Re: how to make the A.I. fire from a further distance
Post by: Jeffro429 on September 25, 2007, 04:36:29 pm
what do you mean table entry? you mean the weapons table? its the fsport weapons table. also i tried putting Weapon Range: just before the flags line... nothin has happened... ill experiment more...

i am editing the avenger weapon. i increased its distance times 2. but the A.I. doesn take advantage of the extra range... it shoots at around 800 meters...
Title: Re: how to make the A.I. fire from a further distance
Post by: Nuke on September 25, 2007, 05:01:13 pm
it might have something to do with the ai class. higher classes may be able to aim at bigger distances.
Title: Re: how to make the A.I. fire from a further distance
Post by: Jeffro429 on September 25, 2007, 05:16:19 pm
no thats not it... the A.I. is very high.... not maxed out but its skills are all over 80... yet it doesnt take advantage of the long range.... it acts no different then the low skilled A.I.

Edit: has any1 even messed with this part of the A.I.? i would think since it tells how to do it in the Weapons table of the freespace wiki
Title: Re: how to make the A.I. fire from a further distance
Post by: Jeffro429 on September 25, 2007, 06:04:02 pm
Everyone i appologize... it wasnt working because i didnt restart the game after i edited the table... i just restarted the game and it works... i mean the weapon range thing.