Question: WithInfantryBody

Information and discussion for custom maps and mods.
Post Reply
User avatar
KOYK_GR
Posts: 68
Joined: Fri Aug 26, 2011 12:46 pm

Question: WithInfantryBody

Post by KOYK_GR »

I added grenade throw animations to e1 but the problem is that i don't really know how to use them. any help will be more than welcome, here is the code so far

Code: Select all

E1:
	Inherits: ^Soldier
	Valued:
		Cost: 100
	Tooltip:
		Name: Minigunner
	Buildable:
		BuildPaletteOrder: 10
		Queue: Infantry.GDI, Infantry.Nod
		Description: General-purpose infantry.\n  Strong vs Infantry\n  Weak vs Vehicles
	Mobile:
		Speed: 56
	Health:
		HP: 50
	Armament@FIRST:
		Weapon: M16
	Armament@SECOND:
		Weapon: FragGrenade
		LocalOffset: 0,0,427
		FireDelay: 20
		AmmoPoolName: FragGrenade
	AttackFrontal:
	WithInfantryBody:
		IdleSequences: idle1,idle2,idle3,idle4
		DefaultAttackSequence: shoot
		AttackSequences: throw
	Armament@GARRISONED:
		Name: garrisoned
		Weapon: HighVRA
		MuzzleSequence: garrison-muzzle
	AmmoPool@FragGrenade:
		Name: FragGrenade
		Ammo: 3
		SelfReloads: True
		SelfReloadDelay: 200
		ReloadCount: 1
		PipCount: 0

Code: Select all

e1:
	stand:
		Facings: 8
	stand2:
		Start: 8
		Facings: 8
	run:
		Start: 16
		Length: 6
		Facings: 8
		Tick: 100
	shoot:
		Start: 64
		Length: 8
		Facings: 8
	prone-stand:
		Start: 144
		Stride: 4
		Facings: 8
	prone-stand2:
		Start: 144
		Stride: 4
		Facings: 8
	prone-run:
		Start: 144
		Length: 4
		Facings: 8
		Tick: 100
	liedown:
		Start: 128
		Length: 2
		Facings: 8
	standup:
		Start: 176
		Length: 2
		Facings: 8
	prone-shoot:
		Start: 192
		Length: 8
		Facings: 8
	throw:
		Start: 532
		Length: 20
		Facings: 8
	prone-throw:
		Start: 692
		Length: 12
		Facings: 8
	idle1:
		Start: 257
		Length: 15
		Tick: 120
	idle2:
		Start: 272
		Length: 16
		Tick: 120
	idle3:
		Start: 289
		Length: 22
		Tick: 120
	cheer:
		Start: 460
		Length: 3
		Facings: 8
		Tick: 120
	idle4:
		Start: 517
		Length: 9
		Tick: 120
	die1:
		Start: 381
		Length: 9
		Tick: 80
	die2:
		Start: 390
		Length: 8
		Tick: 80
	die3:
		Start: 398
		Length: 8
		Tick: 80
	die4:
		Start: 406
		Length: 12
		Tick: 80
	die5:
		Start: 418
		Length: 18
		Tick: 80
	die6:
		Start: 366
		Length: 11
		Tick: 80
	die-crushed: e1rot
		Start: 16
		Length: 4
		Tick: 8000
		ZOffset: -511
	icon: e1icnh.tem
		AddExtension: False
	garrison-muzzle: minigun
		Length: 6
		Facings: 8
this wont work ether:
WithInfantryBody:
AttackSequence: shoot,throw

i have also tried this:

Code: Select all

	WithInfantryBody:
		IdleSequences: idle1,idle2,idle3,idle4
		AttackSequences: 
			M16:
				shoot:
					Start: 64
					Length: 8
					Facings: 8
				prone-shoot:
					Start: 192
					Length: 8
					Facings: 8
			FragGrenade:
				throw:
					Start: 532
					Length: 20
					Facings: 8
				prone-throw:
					Start: 692
					Length: 12
					Facings: 8
but it dint work ether.

Frame_Limiter
Posts: 22
Joined: Tue Feb 16, 2016 4:55 pm

Post by Frame_Limiter »

I think you need to use the Armament "Name:" like "primary" or "secondary"
e.g.

Armament@FIRST:
->Name: primary
->Weapon: M16
Armament@SECOND:
->Name: secondary
->Weapon: FragGrenade

WithInfantryBody:
->DefaultAttackSequence:
->AttackSequences:
-->secondary: throw

The above worked for me, but keep in mind the M16 rate of fire is much faster than the grenade. If you conditionally disable the M16 or possibly just play around with the ROF/Ammo it should work.

*Also:
(Keep in mind the E1 has an existing instance of "Armament" that needs to be removed if you're replacing it with "Armament@FIRST")

User avatar
KOYK_GR
Posts: 68
Joined: Fri Aug 26, 2011 12:46 pm

Post by KOYK_GR »

Thank you frame now working as intended!

Here is the code for any one who came here for the same problem(it is slightly modified though) :

Code: Select all

E1:
	Inherits: ^Soldier
	Valued:
		Cost: 100
	Tooltip:
		Name: Minigunner
	Buildable:
		BuildPaletteOrder: 10
		Queue: Infantry.GDI, Infantry.Nod
		Description: General-purpose infantry.\n  Strong vs Infantry\n  Weak vs Vehicles
	Mobile:
		Speed: 56
	Health:
		HP: 50
	Armament@FIRST:
		Weapon: M16
		Name: primary
	Armament@SECOND:
		Weapon: FragGrenade
		Name: secondary 
		LocalOffset: 0,0,427
		FireDelay: 20
		AmmoPoolName: FragGrenade
	AttackFrontal:
	WithInfantryBody:
		IdleSequences: idle1,idle2,idle3,idle4
		AttackSequences: 
			primary: shoot
			secondary: throw
	Armament@GARRISONED:
		Name: garrisoned
		Weapon: HighVRA
		MuzzleSequence: garrison-muzzle
	AmmoPool@FragGrenade:
		Name: FragGrenade
		Ammo: 3
		SelfReloads: True
		SelfReloadDelay: 600
		ReloadCount: 1
		PipCount: 0
And as Frame_Limiter said:
"keep in mind the M16 rate of fire is much faster than the grenade. If you conditionally disable the M16 or possibly just play around with the ROF/Ammo it should work."

Post Reply