Help needed: Custom Anti-Air Tank

Post Reply
User avatar
DoomerMrT
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 18
Joined: Thu Jan 01, 2009 8:52 am
Location: Hungary

Help needed: Custom Anti-Air Tank

Post 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.
User avatar
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8332
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘ జ్ఞ‌ా
Contact:

Re: Help needed: Custom Anti-Air Tank

Post 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.
Gameproc
Though we stand alone, stand we shall.
User avatar
DoomerMrT
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 18
Joined: Thu Jan 01, 2009 8:52 am
Location: Hungary

Re: Help needed: Custom Anti-Air Tank

Post by DoomerMrT »

The tank body:

Spoiler

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:
Spoiler

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
User avatar
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8332
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘ జ్ఞ‌ా
Contact:

Re: Help needed: Custom Anti-Air Tank

Post by IskatuMesk »

Hmm. I don't see anything weird except for long00 not existing in the code.

Does your tank have the .lo file?
Gameproc
Though we stand alone, stand we shall.
User avatar
DoomerMrT
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 18
Joined: Thu Jan 01, 2009 8:52 am
Location: Hungary

Re: Help needed: Custom Anti-Air Tank

Post 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.
User avatar
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8332
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘ జ్ఞ‌ా
Contact:

Re: Help needed: Custom Anti-Air Tank

Post 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.
Gameproc
Though we stand alone, stand we shall.
User avatar
DoomerMrT
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 18
Joined: Thu Jan 01, 2009 8:52 am
Location: Hungary

Re: Help needed: Custom Anti-Air Tank

Post by DoomerMrT »

Everything is the same, considering the replaced unit is Edmund Duke (Siege Tank).  :-\
User avatar
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8332
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘ జ్ఞ‌ా
Contact:

Re: Help needed: Custom Anti-Air Tank

Post 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.
Gameproc
Though we stand alone, stand we shall.
User avatar
DoomerMrT
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 18
Joined: Thu Jan 01, 2009 8:52 am
Location: Hungary

Re: Help needed: Custom Anti-Air Tank

Post by DoomerMrT »

PM with files sent.
User avatar
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8332
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘ జ్ఞ‌ా
Contact:

Re: Help needed: Custom Anti-Air Tank

Post 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.
Last edited by IskatuMesk on Wed Jan 27, 2010 12:08 pm, edited 1 time in total.
Gameproc
Though we stand alone, stand we shall.
User avatar
DoomerMrT
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 18
Joined: Thu Jan 01, 2009 8:52 am
Location: Hungary

Re: Help needed: Custom Anti-Air Tank

Post by DoomerMrT »

Set the tank's target range to 10, but still not working. I guess it is time to leave this then.  :-\
User avatar
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8332
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘ జ్ఞ‌ా
Contact:

Re: Help needed: Custom Anti-Air Tank

Post 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.
Gameproc
Though we stand alone, stand we shall.
Post Reply