Page 1 of 1
Help needed: Custom Anti-Air Tank
Posted: Tue Jan 26, 2010 7:30 am
by DoomerMrT
Hi there!
I was messing around with starcraft modding and decided to make an anti-air tank. I have the button sets for producing it, the graphics, the iscripting, but the tank turret behaves weird when shooting. It shoots several times then the turret suddenly rotates to a completely different position and stops shooting. Eventually the turret gets back to its place but until then it won't shoot. I've copied/pasted the siege tank's icode except altered it for air attack. Also used DatEdit to replicate the siege tank's properties so NOTHING is different apart from the air/ground attack. And btw, used searching but nothing useful came up so please if anyone can, help me.
Re: Help needed: Custom Anti-Air Tank
Posted: Tue Jan 26, 2010 7:46 am
by IskatuMesk
I don't recall ever having this kind of problem with tank turrets and air attacks (with the exception if the tank is an air unit - air units HATE turrets, especially when used by the AI). I'd have you post your iscript code (using spoilers and the code brackets) to have a quick look. From what it sounds like the code might have some issue jumping into incorrect blocks or being threaded into them on its own? Else, check the subunit AI if you changed anything along those lines. Otherwise I can't think of why it'd do that... that's very weird.
Re: Help needed: Custom Anti-Air Tank
Posted: Tue Jan 26, 2010 7:56 am
by DoomerMrT
The tank body:
Code: Select all
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 999 AntiAirTankBase (terran\tank.grp)
.headerstart
IsId 412
Type 23
Init AntiAir_Tank_BaseInit
Death AntiAir_Tank_BaseDeath
GndAttkInit [NONE]
AirAttkInit [NONE]
Unused1 [NONE]
GndAttkRpt [NONE]
AirAttkRpt [NONE]
CastSpell [NONE]
GndAttkToIdle [NONE]
AirAttkToIdle [NONE]
Unused2 [NONE]
Walking AntiAir_Tank_BaseWalking
WalkingToIdle AntiAir_Tank_BaseWalkingToIdle
SpecialState1 [NONE]
SpecialState2 [NONE]
AlmostBuilt [NONE]
Built [NONE]
Landing [NONE]
LiftOff [NONE]
IsWorking [NONE]
WorkingToIdle [NONE]
WarpIn [NONE]
Unused3 [NONE]
StarEditInit AntiAir_Tank_BaseStarEditInit
.headerend
# ----------------------------------------------------------------------------- #
AntiAir_Tank_BaseStarEditInit:
setfldirect 12
imgol 505 2 0 # AntiAirTankTurret (advanced\unit\terran\aatt.grp)
AntiAir_Tank_BaseInit:
wait 1
imgul 252 0 0 # SiegeTankTankShad (terran\ttaShad.grp)
setfldirect 12
AntiAir_Tank_BaseWalkingToIdle:
playfram 0x00 # frame set 0
goto long00
AntiAir_Tank_BaseDeath:
playsnd 317 # Terran\TANK\TTaDth00.WAV
imgol 333 0 0 # TerranBuildingExplosionmedium (thingy\tBangL.grp)
wait 3
end
AntiAir_Tank_BaseWalking:
move 4
wait 1
playfram 0x00 # frame set 0
move 4
wait 1
playfram 0x11 # frame set 1
move 4
wait 1
playfram 0x22 # frame set 2
goto AntiAir_Tank_BaseWalking
The Tank turret:
Code: Select all
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 547 AntiAirTankTurret (advanced\unit\terran\aatt.grp)
.headerstart
IsId 316
Type 13
Init AntiAir_Tank_TurretInit
Death long01
GndAttkInit [NONE]
AirAttkInit AntiAir_Tank_TurretAirAttkInit
Unused1 [NONE]
GndAttkRpt [NONE]
AirAttkRpt AntiAir_Tank_TurretAirAttkInit
CastSpell [NONE]
GndAttkToIdle [NONE]
AirAttkToIdle long00
Unused2 [NONE]
Walking long00
WalkingToIdle long00
SpecialState1 long00
.headerend
# ----------------------------------------------------------------------------- #
AntiAir_Tank_TurretInit:
wait 1
setfldirect 12
goto long00
AntiAir_Tank_TurretAirAttkInit:
wait 1
nobrkcodestart
playsnd 1127 # advanced\sounds\antiairf.wav
imgol 507 0 0 # Venom (advanced\flash\aatf.grp)
wait 2
attackwith 2
nobrkcodeend
gotorepeatattk
goto long00
Re: Help needed: Custom Anti-Air Tank
Posted: Tue Jan 26, 2010 9:39 am
by IskatuMesk
Hmm. I don't see anything weird except for long00 not existing in the code.
Does your tank have the .lo file?
Re: Help needed: Custom Anti-Air Tank
Posted: Tue Jan 26, 2010 11:53 am
by DoomerMrT
It uses the standard siege tank's one, and the new graphics doesn't exceed the original turret's frames, nor less than it. If must, I can send the exe.
Re: Help needed: Custom Anti-Air Tank
Posted: Tue Jan 26, 2010 12:18 pm
by IskatuMesk
I don't have the tools handy nor the desire to really get into the thick of Starcraft again. Anyways, this sounds like something that I've never encountered before, probably on part with me never using subunits in any of my mods because the AI doesn't play nice with them. Baja might be a better person to ask about that.
All I can think of is checking the unit AI in units.dat and making sure it's the same as as the original tanks, as well as flags and such.
Re: Help needed: Custom Anti-Air Tank
Posted: Wed Jan 27, 2010 6:10 am
by DoomerMrT
Everything is the same, considering the replaced unit is Edmund Duke (Siege Tank).

Re: Help needed: Custom Anti-Air Tank
Posted: Wed Jan 27, 2010 8:35 am
by IskatuMesk
That is exceptionally odd, then. Send me the files and I'll see if I can find the time to have a look at it and try to find anything that sticks out.
Re: Help needed: Custom Anti-Air Tank
Posted: Wed Jan 27, 2010 10:49 am
by DoomerMrT
PM with files sent.
Re: Help needed: Custom Anti-Air Tank
Posted: Wed Jan 27, 2010 11:47 am
by IskatuMesk
Oh god you're decompiling the entire iscript. This makes things more complex and difficult for you than they need to be; just decompile by entry to keep things organized and simple for yourself.
Datedit is just throwing me access violation after access violation in your data files, even if I set the external data source to your mpq. It says "unable to find grp file 'un'". I see you're using two custom labelled grps in the mpq but don't have a images.tbl to point to the names? I'm surprised that even works. Images.dat tells me the grp is pointing to nothing at all.
Sound id is 1127, Duranys02 and not Artanis. You've changed the comments in the iscript, hopefully knowing that the comments don't actually do anything at all and aren't even compiled into the script.
Try setting your turret's grp to something that exists in the game (to my knowledge you cannot point to a grp that isn't in the game without using a custom tbl file, that's how it was back when we did that in IG anyways). You're using the plasmadrip entry, try using that grp? It's totally blank in these dat files for me.
/edit
*shrug* the grp works fine ingame. Oh well. It's not that.
It turns around even when it's not firing. This is weird.
The only difference I see is that the turret is not set to clickable in images.dat. Not sure if this makes a difference or not. Otherwise I have no idea.
Oh, the acquisition range for the turret is 10 and the tank is 8. Try setting them both to 10. Again, I dunno if that's it, but try to remove all potential factors.
Re: Help needed: Custom Anti-Air Tank
Posted: Wed Jan 27, 2010 12:58 pm
by DoomerMrT
Set the tank's target range to 10, but still not working. I guess it is time to leave this then.

Re: Help needed: Custom Anti-Air Tank
Posted: Wed Jan 27, 2010 1:07 pm
by IskatuMesk
Try asking on the broodwarai.com forums or their shoutbox. My experience with subunits is very limited and I don't imagine there is anyone else here who would have much idea, unless Baja comes across this thread. Hercanic might know, but I think he was also asking me about subunits at one point.
I've given sub units air attacks before without any issue, so this is just really weird.