Animated Tank Script
Hello Dudes,
I have an animated tank enemy (character), it is animated (the wheels and the turret rotate).
It is working good, however it has some bugs and i ask help to the more experienced folks here that understand well fpi scripting, because i am studying hard, i have read the oficial community guide, but still have a LOT of doubts and difficulties with fpi scripts
I took the idea of the old tank script from this thread:
http://forum.thegamecreators.com/?m=forum_view&t=165945&b=24
But i changed the script a bit, i removed the waypoint part. I decided to don`t make the tank follow waypoints because it does behave very strange when the tank turn at the end of the waypoint.
I added "movefore=300" after the "useweapon" at the main script, so this way the tank will chase the player and fire at him.
So the tankk works fine until player shoots it, because when the player shoots at the tank, the tank freezes and the animation stops. I don`t know how to make the tank keep chasing the player, firing at him and shooting at the player.
Here is the fpe:
;header
desc = Enemy Tank
;ai
aiinit = appearnofloorlogic.fpi
aimain = user\ww2 tank.fpi
aidestroy = destroy\flamable.fpi
aishoot = people\launch.fpi
soundset =
;spawn
spawnmax = 0
spawndelay = 0
spawnqty = 0
;orientation
model = tank.x
offx = 0
offy = 0
offz = 0
rotx = 0
roty = 0
rotz = 0
scale = 100
fixnewy = 180
;cone of sight
coneheight = 53
coneangle = 90
;visualinfo
textured =
effect =
;decals
decalmax = 3
;decal 0 is for shoot
decal0 = blackpuff
decal1 = explosion116
decal2 = smokey
;identity details
strength = 100
ischaracter = 1
hasweapon = ww2\bazooka
isobjective = 0
cantakeweapon = 0
;bodypartslimbinfo (1=head/2=body/3+4=armslr/5+6=legslr)
limbmax = 0
;animationinfo
animmax = 100
;anim0 is the spawn animation
anim0 = 0,0
;anim1 is the default idle animation (never begins at 0)
anim1 = 1,20
;anim2 is the impact animation
anim2 = 1,20
;anim3 is the final crash animation debris
anim3 = 1,20
;here finishes my animations and enter the default fpsc character animations
anim3 = 260,279
anim4 = 280,299
anim5 = 300,318
anim6 = 319,355
anim7 = 160,189
anim8 = 330,355
anim11 = 0,19
anim12 = 20,39
anim13 = 493,522
anim14 = 40,59
anim15 = 60,79
anim16 = 523,552
anim17 = 120,139
anim18 = 140,159
anim20 = 80,99
anim21 = 100,119
anim31 = 356,380
anim32 = 381,405
anim33 = 381,405
anim34 = 381,405
anim35 = 381,405
anim36 = 406,442
anim40 = 443,462
anim41 = 463,492
anim50 = 553,572
anim51 = 573,597
anim52 = 598,622
anim53 = 623,642
anim54 = 643,662
anim55 = 663,681
anim56 = 682,731
anim57 = 160,189
anim61 = 0,19
anim62 = 20,39
anim63 = 882,911
anim64 = 40,59
anim65 = 60,79
anim66 = 912,941
anim67 = 120,139
anim68 = 140,159
anim70 = 80,99
anim71 = 100,119
anim81 = 732,756
anim82 = 757,781
anim83 = 757,781
anim84 = 757,781
anim85 = 757,781
anim86 = 782,831
anim90 = 832,851
anim91 = 852,881
Here is the main fpi:
; ai
desc = WW2 Tank
;triggers
:state=0,plrcanbeseen:state=10
:state=10,plrcanbeseen:state=1
:state=1,plrcannotbeseen:state=0
:state=1:rotatetoplr,sound=audiobank\user\tank.wav
:state=1,ifweapon=0:reloadweapon
:state=1,ifweapon=1,rateoffire:state=2,useweapon,movefore=300
:state=2:
:state=2:state=1,reloadweapon
:state=3,plrcanbeseen:state=10
:state=3,plrcannotbeseen:timerstart,sound=audiobank\user\tank.wav,state=4
:state=4,timergreater=500:state=3
Please, can someone do this favour of fixing this bug to me?
I know the bazzoka is not placed correctly at the turret, i placed a firespot, but i will correct this later, i will apply a transparent texture in the bazooka so this way it won`t be visible, but at the right moment my problem is with the script.
I am attaching the tank with its scripts.
Cheers.
Goldenye 007 N64