Page 1 of 1

Halftrack AI

Posted: Sat Mar 29, 2008 4:40 pm
by Bromi
hi

i have added a halftrack in Spearhead using the below script i need to know how to increase the gunners range i have tried increasing sight and hearing but that didnt work the gunner currently has a really short range and its a fairly big map.

this is for SP btw

thanks in advance
Bromi

Code: Select all

main: 
level.script = "maps/test_halftrack.scr" 

exec global/auto.scr 
level waittill prespawn 

level waittill spawn 
$player item weapons/colt45.tik
$player item weapons/springfield.tik 
$player item weapons/bar.tik 

$player ammo pistol 32
$player ammo mg 200
$player ammo rifle 32

local.HalftrackHealth = 500
local.halftrackmodelsd = models/vehicles/halftrack_winter_d.tik

waitthread global/halftrack.scr::halftrackinit $halftrack1 $halftrack1local.HalftrackHealth $halftrack1local.halftrackmodelsd

waitthread global/halftrack.scr::halftrack_loadpassengers $halftrack1 2 1 "human/german_winter_type1" "human/german_winter_type2" 

$halftrack1 thread global/halftrack.scr::halftrack_drive $halftrack1 $halftrack1_path 1 300 520 40 128 

$halftrack1 waittill drive

$halftrack1 waittill death 
thread global/halftrack.scr::halftrack_killed $halftrack1 


end 

Posted: Sun Mar 30, 2008 8:07 am
by jv_map
Best have a look at the global/halftrack.scr script, there might be some clues in there to help you further...

Posted: Sun Mar 30, 2008 10:15 am
by Bromi
I had a look in the halftrack.scr and found this line

Code: Select all

if (self.gunner cansee local.besttarget 80 1525)
so i figured the number at the end was range so i changed this to 4000 as a test i then saved this as another script.

the gunner can now shoot me from further away but i have to get up close first before he notices me any ideas. i cant find anything where it modifies the gunners sight in the script.

thanks for the help above jv