[Solved] Improving movement for 3D Tanks aka "Smooth Turn"?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Improving movement code for 3D Tanks aka "Smooth Turn"?

Post by The Zombie Killer »



Was surprisingly simple. I'm pretty sure the turret attack will keep firing even after the target is dead though, should probably fix that.

Code: Select all

actor SSTank1
{
    //$Category Monsters (Wolf3D)
    //$Title Tank 1 (3500 HP - Panther Panzer IV)
    //$Color 4
    Health 3500
    Radius 100
    Height 96
    Mass 0x7ffffff
    Speed 2.66666667
    MinMissileChance 160
    Tag "Panther Panzer IV"
    +SLIDESONWALLS //ozy81 - avoid incorrect clipping
    +NOBLOODDECALS
    +NOINFIGHTING //ozy81
    +SYNCHRONIZED
    +MISSILEMORE
    +NORADIUSDMG
    +FLOORCLIP
    +DONTMORPH
    +BOSSDEATH
    +PAINLESS
    +SOLID
    +BOSS
    Monster
    Obituary "$TANKS"
    Species Nazi
    MaxStepHeight 32
    BloodType "TankSpark"
    States
    {
    Spawn:
        CYBR A 10 A_Look
        loop
    See:
        "####" A 1
        "####" A 0 A_JumpIfTargetInLOS(1) // only move if we have a target
        loop
        "####" A 0 A_PlaySound("TKMOVE", CHAN_7, 1, true)
        "####" A 0 
        "####" A 0 A_FaceTarget(1.0)
        "####" A 0 A_ChangeVelocity(Cos(angle) * speed, Sin(angle) * speed, velz, CVF_REPLACE)
        // only attack if our target is within 5 degrees
        // if the top part of the tank model was separate,
        // this behavior could potentially be removed.
        "####" A 0 A_JumpIfTargetInLOS(1, 5)
        loop
        "####" A 0 A_Chase("Missile", "Missile", CHF_DONTTURN|CHF_NODIRECTIONTURN|CHF_DONTMOVE)
        loop
    Missile:
        "####" A 10
        "####" A 0 A_Jump(128, "Turret")
        "####" A 0 A_Jump(96, "Missile2")
        "####" BCD 8
        "####" E 8 A_CustomMissile("PanzerRocket", scalex * 76, 0, angle, CMF_ABSOLUTEANGLE)
        "####" FG 8
        "####" A 0 A_JumpIfTargetInLOS("Missile", 1) // attack again if we're perfectly aimed
        goto See
    Turret:
        CYBR A 0
        BOS2 E 0 A_PlaySound("weapons/chaingun", CHAN_WEAPON)
        "####" EEEE 1 light("SUPAFIRE") A_CustomMissile("EnemyChaingunTracer", scalex * 48, scaley * 26, random(-4, 4))
        CYBR A 2 A_JumpIfTargetInLOS("Turret", 45)
        goto See
    Missile2:
        CYBR BCD 2
        "####" E 2 A_CustomMissile("PanzerRocket", scalex * 76, 0, angle, CMF_ABSOLUTEANGLE)
        "####" FG 2
        "####" A 20
        "####" BCD 4
        "####" E 4 A_CustomMissile("PanzerRocket", scalex * 76, 0, angle, CMF_ABSOLUTEANGLE)
        "####" FG 4
        "####" A 20
        "####" A 0 A_JumpIfTargetInLOS("Missile2", 1) // attack again if we're perfectly aimed
        goto See
    Death:
        TNT1 A 0 A_StopSound(CHAN_7)
        "####" A 0 A_PlaySound("weapons/explode")
        "####" A 0 A_Scream
        "####" A 0 A_NoBlocking
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_Tank", random(64, 112), random(64, 112), random(128, 144), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_GlassShard_Large", random(64, 112), random(64, 112), random(128, 144), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" A 0 A_SpawnItemEx("Nuke", 0, 0, 5, 0, 0, 0, 0, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
        "####" A 1 A_SpawnItemEx("KaBoomer", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
        "####" A 1 A_SpawnItemEx("GeneralExplosion_Large", 56, 0, 32)
        "####" A 20 A_SpawnItemEx("DestroyedTank1")
        stop
    }
}
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Improving movement code for 3D Tanks aka "Smooth Turn"?

Post by Tormentor667 »

Thanks alot ZombieKiller once again for your support concerning these script stuff, works like a charm! Now the problem for me is to reproduce this for all 3 other tanks. I took the freedom to attach these below, if you don't have time to help me, I'd be already pleased if you could explain how to add the behaviour to them as well :)

Code: Select all

ACTOR SSTank2 : SSTank1
{
	//$Title Tank 2 (4000 HP - KFZ 251 HalfTrack)
	Height 88
	Health 4000
	Speed 2.33333333
	Tag "KFZ 251 HalfTrack"
	States
	{
	Spawn:
		CYBR A 10 A_Look
		Loop
	Missile:
		"####" A 10 A_FaceTarget
		"####" A 0 A_Jump(128,"Turret")
		"####" BCD 8
		"####" E 8 A_CustomMissile("PanzerRocket",ScaleX*88)
		"####" FG 8 A_FaceTarget
		Goto See
	Turret:
		CYBR A 0 A_FaceTarget
		BOS2 E 0 A_PlaySound("weapons/chaingun",CHAN_WEAPON)
		"####" EEEE 1 LIGHT("SUPAFIRE") A_CustomMissile("EnemyChaingunTracer",ScaleX*70,ScaleY*-16,random(-4,4))
		CYBR A 2 A_SentinelRefire
		Loop
	Death:
		TNT1 A 0 A_StopSound(7)
		"####" A 0 A_PlaySound("weapons/explode")
		"####" A 0 A_Scream
		"####" A 0 A_NoBlocking
		"####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("Debris_Tank2", random(48,96), random(48,96), random(96,128), random(1,3), random(1,3), random(1,3), random(0,360), SXF_CLIENTSIDE)
		"####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("Debris_GlassShard_Large", random(48,96), random(48,96), random(96,128), random(1,3), random(1,3), random(1,3), random(0,360), SXF_CLIENTSIDE)
		"####" A 0 A_SpawnItemEx("Nuke",0,0,5,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		"####" A 1 A_SpawnItemEx("KaBoomer",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
		"####" A 1 A_SpawnItemEx("GeneralExplosion_Large",56,0,32)
		"####" A 20 A_SpawnItemEx("DestroyedTank2")
		Stop
	}
}

Code: Select all

ACTOR SSTank3 : SSTank1
{
	//$Title Tank 3 (3000 HP - Tiger I Panzer)
	Health 3000
	Height 88
	Speed 2.55555556
	Tag "Tiger I Panzer"
	States
	{
	Spawn:
		CYBR A 10 A_Look
		Loop
	Missile:
		CYBR A 10 A_FaceTarget
		"####" A 0 A_Jump(128,"Turret")
		"####" BCD 8
		"####" E 8 A_CustomMissile("PanzerRocket",ScaleX*65,ScaleY*4)
		"####" FG 8
		Goto See
	Turret:
		CYBR A 0 A_FaceTarget
		BOS2 E 0 A_PlaySound("weapons/chaingun",CHAN_WEAPON)
		"####" EEEE 1 LIGHT("SUPAFIRE") A_CustomMissile("EnemyChaingunTracer",ScaleX*48,ScaleY*24,random(-4,4))
		CYBR A 2 A_SentinelRefire
		Loop
	Death:
		TNT1 A 0 A_StopSound(7)
		"####" A 0 A_PlaySound("weapons/explode")
		"####" A 0 A_Scream
		"####" A 0 A_NoBlocking
		"####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("Debris_Tank2", random(48,96), random(48,96), random(88,112), random(1,3), random(1,3), random(1,3), random(0,360), SXF_CLIENTSIDE)
		"####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("Debris_GlassShard_Large", random(48,96), random(48,96), random(96,128), random(1,3), random(1,3), random(1,3), random(0,360), SXF_CLIENTSIDE)
		"####" A 0 A_SpawnItemEx("Nuke",0,0,5,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		"####" A 1 A_SpawnItemEx("KaBoomer",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
		"####" A 1 A_SpawnItemEx("GeneralExplosion_Large",56,0,32)
		"####" A 20 A_SpawnItemEx("DestroyedTank3")
		Stop
	}
}

Code: Select all

ACTOR SSTank4 : SSTank1
{
	//$Title Tank 4 (1000 HP - Light Panzer KFZ 222)
	Health 1000
	Radius 80
	Height 80
	Speed 2.55555556
	Tag "Light Panzer KFZ 222"
	States
	{
	Spawn:
		CYBR A 10 A_Look
		Loop
	Missile:
		CYBR A 0 A_FaceTarget
		"####" B 0 A_PlaySound("weapons/chaingun",CHAN_WEAPON)
		"####" BBBB 1 LIGHT("SUPAFIRE") A_CustomMissile("EnemyChaingunTracer",ScaleX*80,ScaleY*0,random(-4,4))
		"####" A 2 A_SentinelRefire
		Loop
	Death:
		TNT1 A 0 A_StopSound(7)
		"####" A 0 A_PlaySound("weapons/explode")
		"####" A 0 A_Scream
		"####" A 0 A_NoBlocking
		"####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("Debris_Tank2", random(48,96), random(48,96), random(88,112), random(1,3), random(1,3), random(1,3), random(0,360), SXF_CLIENTSIDE)
		"####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("Debris_GlassShard_Large", random(48,96), random(48,96), random(96,128), random(1,3), random(1,3), random(1,3), random(0,360), SXF_CLIENTSIDE)
		"####" A 0 A_SpawnItemEx("Nuke",0,0,5,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
		"####" A 1 A_SpawnItemEx("KaBoomer",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
		"####" A 1 A_SpawnItemEx("GeneralExplosion_Large",56,0,32)
		"####" A 20 A_SpawnItemEx("DestroyedTank4")
		Stop
	}
}
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Improving movement code for 3D Tanks aka "Smooth Turn"?

Post by The Zombie Killer »

Here you go, all of the tanks (including the first one with the aforementioned issue fixed)

Code: Select all

actor SSTank1
{
    //$Category Monsters (Wolf3D)
    //$Title Tank 1 (3500 HP - Panther Panzer IV)
    //$Color 4
    Health 3500
    Radius 100
    Height 96
    Mass 0x7ffffff
    Speed 2.66666667
    MinMissileChance 160
    Tag "Panther Panzer IV"
    +SLIDESONWALLS //ozy81 - avoid incorrect clipping
    +NOBLOODDECALS
    +NOINFIGHTING //ozy81
    +SYNCHRONIZED
    +MISSILEMORE
    +NORADIUSDMG
    +FLOORCLIP
    +DONTMORPH
    +BOSSDEATH
    +PAINLESS
    +SOLID
    +BOSS
    Monster
    Obituary "$TANKS"
    Species Nazi
    MaxStepHeight 32
    BloodType "TankSpark"
    States
    {
    Spawn:
        CYBR A 10 A_Look
        loop
    See:
        "####" A 1
        "####" A 0 A_JumpIfTargetInLOS(1) // only move if we have a target
        loop
        "####" A 0 A_PlaySound("TKMOVE", CHAN_7, 1, true)
        "####" A 0 
        "####" A 0 A_FaceTarget(1.0)
        "####" A 0 A_ChangeVelocity(Cos(angle) * speed, Sin(angle) * speed, velz, CVF_REPLACE)
        // only attack if our target is within 5 degrees
        // if the top part of the tank model was separate,
        // this behavior could potentially be removed.
        "####" A 0 A_JumpIfTargetInLOS(1, 5)
        loop
        "####" A 0 A_Chase("Missile", "Missile", CHF_DONTTURN|CHF_NODIRECTIONTURN|CHF_DONTMOVE)
        loop
    Missile:
        "####" A 10
        "####" A 0 A_Jump(128, "Turret")
        "####" A 0 A_Jump(96, "Missile2")
        "####" BCD 8
        "####" E 8 A_CustomMissile("PanzerRocket", scalex * 76, 0, angle, CMF_ABSOLUTEANGLE)
        "####" FG 8
        "####" A 0 A_JumpIfHealthLower(1, "See", AAPTR_TARGET)
        "####" A 0 A_JumpIfTargetInLOS("Missile", 1) // attack again if we're perfectly aimed
        goto See
    Turret:
        CYBR A 0 A_PlaySound("weapons/chaingun", CHAN_WEAPON)
        "####" EEEE 1 light("SUPAFIRE") A_CustomMissile("EnemyChaingunTracer", scalex * 48, scaley * 26, random(-4, 4))
        "####" A 0 A_JumpIfHealthLower(1, "See", AAPTR_TARGET)
        CYBR A 2 A_JumpIfTargetInLOS("Turret", 45)
        goto See
    Missile2:
        CYBR BCD 2
        "####" E 2 A_CustomMissile("PanzerRocket", scalex * 76, 0, angle, CMF_ABSOLUTEANGLE)
        "####" FG 2
        "####" A 20
        "####" BCD 4
        "####" E 4 A_CustomMissile("PanzerRocket", scalex * 76, 0, angle, CMF_ABSOLUTEANGLE)
        "####" FG 4
        "####" A 20
        "####" A 0 A_JumpIfHealthLower(1, "See", AAPTR_TARGET)
        "####" A 0 A_JumpIfTargetInLOS("Missile2", 1) // attack again if we're perfectly aimed
        goto See
    Death:
        TNT1 A 0 A_StopSound(CHAN_7)
        "####" A 0 A_PlaySound("weapons/explode")
        "####" A 0 A_Scream
        "####" A 0 A_NoBlocking
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_Tank", random(64, 112), random(64, 112), random(128, 144), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_GlassShard_Large", random(64, 112), random(64, 112), random(128, 144), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" A 0 A_SpawnItemEx("Nuke", 0, 0, 5, 0, 0, 0, 0, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
        "####" A 1 A_SpawnItemEx("KaBoomer", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
        "####" A 1 A_SpawnItemEx("GeneralExplosion_Large", 56, 0, 32)
        "####" A 20 A_SpawnItemEx("DestroyedTank1")
        stop
    }
}


actor SSTank2 : SSTank1
{
    //$Title Tank 2 (4000 HP - KFZ 251 HalfTrack)
    Height 88
    Health 4000
    Speed 2.33333333
    Tag "KFZ 251 HalfTrack"
    States
    {
    Spawn:
        CYBR A 10 A_Look
        loop
    Missile:
        "####" A 10
        "####" A 0 A_Jump(128, "Turret")
        "####" BCD 8
        "####" E 8 A_CustomMissile("PanzerRocket", scalex * 88, 0, angle, CMF_ABSOLUTEANGLE)
        "####" FG 8
        "####" A 0 A_JumpIfHealthLower(1, "See", AAPTR_TARGET)
        "####" A 0 A_JumpIfTargetInLOS("Missile", 1) // attack again if we're perfectly aimed
        goto See
    Turret:
        CYBR A 0 A_PlaySound("weapons/chaingun", CHAN_WEAPON)
        "####" EEEE 1 light("SUPAFIRE") A_CustomMissile("EnemyChaingunTracer", scalex * 70, scaley * -16, random(-4, 4))
        "####" A 0 A_JumpIfHealthLower(1, "See", AAPTR_TARGET)
        CYBR A 2 A_JumpIfTargetInLOS("Turret", 45)
        loop
    Death:
        TNT1 A 0 A_StopSound(CHAN_7)
        "####" A 0 A_PlaySound("weapons/explode")
        "####" A 0 A_Scream
        "####" A 0 A_NoBlocking
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_Tank2", random(48, 96), random(48, 96), random(96, 128), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_GlassShard_Large", random(48, 96), random(48, 96), random(96, 128), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" A 0 A_SpawnItemEx("Nuke", 0, 0, 5, 0, 0, 0, 0, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
        "####" A 1 A_SpawnItemEx("KaBoomer", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
        "####" A 1 A_SpawnItemEx("GeneralExplosion_Large", 56, 0, 32)
        "####" A 20 A_SpawnItemEx("DestroyedTank2")
        stop
    }
}

actor SSTank3 : SSTank1
{
    //$Title Tank 3 (3000 HP - Tiger I Panzer)
    Health 3000
    Height 88
    Speed 2.55555556
    Tag "Tiger I Panzer"
    States
    {
    Spawn:
        CYBR A 10 A_Look
        loop
    Missile:
        CYBR A 10
        "####" A 0 A_Jump(128, "Turret")
        "####" BCD 8
        "####" E 8 A_CustomMissile("PanzerRocket", scalex * 65, scaley * 4, angle, CMF_ABSOLUTEANGLE)
        "####" FG 8
        "####" A 0 A_JumpIfHealthLower(1, "See", AAPTR_TARGET)
        "####" A 0 A_JumpIfTargetInLOS("Missile", 1) // attack again if we're perfectly aimed
        goto See
    Turret:
        CYBR A 0 A_PlaySound("weapons/chaingun", CHAN_WEAPON)
        "####" EEEE 1 light("SUPAFIRE") A_CustomMissile("EnemyChaingunTracer", scalex * 48, scaley * 24, random(-4, 4))
        "####" A 0 A_JumpIfHealthLower(1, "See", AAPTR_TARGET)
        CYBR A 2 A_JumpIfTargetInLOS("Turret", 45)
        loop
    Death:
        TNT1 A 0 A_StopSound(CHAN_7)
        "####" A 0 A_PlaySound("weapons/explode")
        "####" A 0 A_Scream
        "####" A 0 A_NoBlocking
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_Tank2", random(48, 96), random(48, 96), random(88, 112), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_GlassShard_Large", random(48, 96), random(48, 96), random(96, 128), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" A 0 A_SpawnItemEx("Nuke", 0, 0, 5, 0, 0, 0, 0, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
        "####" A 1 A_SpawnItemEx("KaBoomer", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
        "####" A 1 A_SpawnItemEx("GeneralExplosion_Large", 56, 0, 32)
        "####" A 20 A_SpawnItemEx("DestroyedTank3")
        stop
    }
}

actor SSTank4 : SSTank1
{
    //$Title Tank 4 (1000 HP - Light Panzer KFZ 222)
    Health 1000
    Radius 80
    Height 80
    Speed 2.55555556
    Tag "Light Panzer KFZ 222"
    States
    {
    Spawn:
        CYBR A 10 A_Look
        loop
    Missile:
        "####" B 0 A_PlaySound("weapons/chaingun", CHAN_WEAPON)
        "####" BBBB 1 LIGHT("SUPAFIRE") A_CustomMissile("EnemyChaingunTracer", scalex * 80, scaley * 0, random(-4, 4))
        "####" A 0 A_JumpIfHealthLower(1, "See", AAPTR_TARGET)
        "####" A 2 A_JumpIfTargetInLOS("Missile", 45)
        loop
    Death:
        TNT1 A 0 A_StopSound(CHAN_7)
        "####" A 0 A_PlaySound("weapons/explode")
        "####" A 0 A_Scream
        "####" A 0 A_NoBlocking
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_Tank2", random(48, 96), random(48, 96), random(88, 112), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Debris_GlassShard_Large", random(48, 96), random(48, 96), random(96, 128), random(1, 3), random(1, 3), random(1, 3), random(0, 360), SXF_CLIENTSIDE)
        "####" A 0 A_SpawnItemEx("Nuke", 0, 0, 5, 0, 0, 0, 0, SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION)
        "####" A 1 A_SpawnItemEx("KaBoomer", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
        "####" A 1 A_SpawnItemEx("GeneralExplosion_Large", 56, 0, 32)
        "####" A 20 A_SpawnItemEx("DestroyedTank4")
        stop
    }
} 
Adding it to the other tanks was fairly simple, all that was needed was to add a few checks to the code. Looking at them side-by-side with the original code should explain the gist of it
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Improving movement code for 3D Tanks aka "Smooth Turn"?

Post by Tormentor667 »

What can I say else than: Thanks alot for your help again :) This works perfect!
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Solved] Improving movement for 3D Tanks aka "Smooth Tur

Post by Nash »

Hey TZK, that's some pretty neat DECORATE-fu you got there... I have been thinking for years, how to emulate the AI of Blood's zombies - you know how they sort of smoothly turn around to chase you, will continue to walk to you in a straight line (instead of zig-zagging like in Doom... ugh) - and if it there's an obstacle in the way, it will skillfully navigate around it? This tank code seems to be a step in that direction!
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Solved] Improving movement for 3D Tanks aka "Smooth Tur

Post by The Zombie Killer »

Nash wrote:Hey TZK, that's some pretty neat DECORATE-fu you got there... I have been thinking for years, how to emulate the AI of Blood's zombies - you know how they sort of smoothly turn around to chase you, will continue to walk to you in a straight line (instead of zig-zagging like in Doom... ugh) - and if it there's an obstacle in the way, it will skillfully navigate around it? This tank code seems to be a step in that direction!
I've actually been experimenting with custom AI a lot in ZDoom lately, and that sort of behavior is something I'm hoping to eventually get working properly. Stay tuned
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: [Solved] Improving movement for 3D Tanks aka "Smooth Tur

Post by Tormentor667 »

..any interest in improving the AI for WolfenDoom BoA in general? :)
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: [Solved] Improving movement for 3D Tanks aka "Smooth Tur

Post by The Zombie Killer »

That depends on how far my experimentation manages to get :p
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: [Solved] Improving movement for 3D Tanks aka "Smooth Tur

Post by Tormentor667 »

Thats no "no" :D
Locked

Return to “Editing (Archive)”