Page 1 of 3

New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 09:02
by Gonzalo
Hi everyone. I have successfully created a "bandit" animal with is heavymounted unit. But I have having troubles with a "pirate" animal which is heavyinfantry, perhaps because of complexity of musketer attack or otherwise. I adjoin code, though I think the problem could be in dbcombat.csv (I haven't changed this csv file). Any help would be vey much appreciated. The problem is when this unit shoots or is shooted the game crashes...

Code: Select all

UnitType Pirate
{
	parent = LandAnimal
	properties {
		moveType = kUnitMoveType_Mounted
		displayName = tx_utn_Pirate_name
		hitpoints = 20
		verboseTooltip = vtt_unit_Pirate
	}
	abilities = [
		Attack { damage = 14; range = 10; reloadTime = 3; applyDamageTime = 0.2; missileName = "MusketBullet"; WeaponType = LightProjectile; PackTime = 2.00; UnpackTime = 2.00 }
		LOS { range = 10 }
		Move {speed = 1.7250; angSpeed = 720}
	]
	fullMapOverlay { sprite = spr_fullmap_smallunit ignoreOrientation = 1 }

}

UnitModel PirateBase
{
	Parent 		= BaseLandAnimal
	DefaultModel 	= prussianmusketer.nif
	UIRenderingParams {
		xOffset = 3.16
		yOffset = 2.96
		zOffset = -2.32
		scale = 1.87
		angle = 52.11
		rotationSpeed = 0.00
		pitch = 20.01
		lightAngle = 30.00
		lightPitch = 90.00
		lightDiffuse = [50 50 45 255]
		lightSpecular = [0 0 0 255]
		lightAmbient = [40 40 40 255]
	}
}


UnitModel Pirate
{
	Parent		= PirateBase
	ChildNames 	= [ UnitShadow Muzzle_Musketeer ]
	States 		= [
		{	StateName = Idle	AnimName = sh_musketeer_idle01.KF
                              AnimVariants = [ sh_musketeer_idle02.KF 
						sh_musketeer_season01.kf ]
                              AnimVariantsWeights = [0.3 0.1 ]
                 }                            
        {      StateName = UnpackedIdle  AnimName = sh_musketeer_unpackidle01.KF   }
        //{ 	StateName = Walk	AnimName = sh_musketeer_walk01.KF   }     
        { 	StateName = Run	        AnimName = sh_musketeer_jog01.KF    }
		{ 	StateName = Attack1	AnimName = sh_musketeer_attack01.KF 
			TextKeys = [
					{ Name = PLAY_SOUND Data = fx_musket_fire KeyTime = 0.16 }
					] }
		{ 	StateName = Pack	AnimName = sh_musketeer_pack.KF  }
		{ 	StateName = Unpack	AnimName = sh_musketeer_unpack.KF  }
		{ 	StateName = Death	           AnimName = sh_musketeer_unpackdeath01.KF  }
                {       StateName = PackedDeath  AnimName = sh_musketeer_death01.KF  } 
		{	StateName = Flinch	AnimName = sh_musketeer_protect01.kf }
		{	StateName = BeingThrown	AnimName = sh_musketeer_flying01.kf
			AnimVariants = [ sh_musketeer_flying02.kf ] AnimVariantsWeights = [ 0.5 ]	}
		{	StateName = ThrownDeath	AnimName = sh_musketeer_ground_death01.kf }
			]
}

UnitType DeadAnimalPirate
{
	parent = DeadAnimal_LowFood
	properties {
		displayName = tx_utn_DeadPirate_name
		VerboseTooltip = vtt_unit_DeadPirate
		SizeX = 0.4
		SizeY = 0.2
	}
}

UnitModel DeadAnimalPirate
{
	Parent 		= PirateBase
	ChildNames 	= [ UnitShadow ]
	DefaultState = Death
	States 		= [
		{ 	StateName = PackedDeath      AnimName = sh_musketeer_unpackdeath01.KF }
]
		UIRenderingParams {
			xOffset = 6.58
			yOffset = 7.89
			zOffset = -5.36
			scale = 2.17
			angle = 52.11
			rotationSpeed = 0.00
			pitch = 20.01
			lightAngle = 30.00
			lightPitch = 90.00
			lightDiffuse = [50 50 45 255]
			lightSpecular = [0 0 0 255]
			lightAmbient = [40 40 40 255]
	}
}





Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 11:52
by Dr.MonaLisa
As first verify what is the reason - UnitType or UnitModel. Simply temporary rename Pirate UnitModel to something else, and copy Bandit UnitModel in that place (keep naming). If it still crashes then UnitType is the problem, otherwise something in UnitModel.

Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 12:21
by Gonzalo
Hi Leader, thank you. The problem is in attack ability, the game seems not to accept packing/unpacking attack for an animal...

Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 12:32
by Dr.MonaLisa
Could be a missing/incorrect packing/unpacking animation as well.

Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 12:37
by Gonzalo
Thank you for the hint. I'll check that!! :)

Added after 43 minutes 6 seconds:
No animations are correct I have updated from original game hm....

Added after 1 hour 39 minutes 19 seconds:
It isn't the sound of musket I have checked...just after attacking the game crashes...

Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 16:01
by Dr.MonaLisa
what if all animations are removed, only pure UnitModel is left?

Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 16:59
by Gonzalo
hm.....it seems a problem of ordnance, at third shoot (I have achieved that) game crashes....

Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 17:24
by Dr.MonaLisa
What if it's not "Pirates" unit that crashes, at all?

Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 19:15
by Gonzalo
What else could be?

Added after 31 seconds:
I have modded nothing else last days

Re: New animal pirate (EE4) Problem with this unit

Posted: 08 Sep 2018, 19:29
by Dr.MonaLisa
Tested if it crashes without this unit?