Halftrack AI

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Bromi
Lance Corporal
Posts: 24
Joined: Sun Dec 23, 2007 2:09 pm

Halftrack AI

Post 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 
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Best have a look at the global/halftrack.scr script, there might be some clues in there to help you further...
Image
Bromi
Lance Corporal
Posts: 24
Joined: Sun Dec 23, 2007 2:09 pm

Post 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
Post Reply