Jump to content


Turret Help


9 replies to this topic

#1 Umbrella Secrets

    Experimenting

  • Member
  • 658 posts
  • Projects: I'm with the Mapper Guild Projects

Posted 07 January 2011 - 01:21

Hi, I just started coding my first turret and I understand most of it but the part where the muzzle flashes appear and where the bullets fly out. Also I've been trying to get my chainguns to rotate on my turret? Is there a way to do that without an animation?

Here is the code to my turret:
<?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?>
<AssetDeclaration xmlns=&#34;uri&#58;ea.com&#58;eala&#58;asset&#34; xmlns&#58;xsi=&#34;http&#58;//www.w3.org/2001/XMLSchema-instance&#34; xmlns&#58;xi=&#34;http&#58;//www.w3.org/2001/XInclude&#34;>
	<Tags></Tags>
	<Includes>
		<Include
			type=&#34;all&#34;
			source=&#34;DATA&#58;GlobalData/GlobalDefines.xml&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;AST_Turret1.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;ASTurret1_BLDS.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;ASTurret1_BLDA.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrD3_SN.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrD3_AN.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;FXspotlight.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwr_A.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrG.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrG_A.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrGD3.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;FXTracerGDI.xml&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;DATA&#58;GlobalData/GlobalDefines.xml&#34; />
		<!-- Base Object -->
		<Include
			type=&#34;instance&#34;
			source=&#34;DATA&#58;BaseObjects/BaseStructure.xml&#34; />
	</Includes>
	<GameObject
		id=&#34;AlienBuzzerHive&#34;
		inheritFrom=&#34;BaseStructure&#34;
		SelectPortrait=&#34;Portrait_GDIWatchTower&#34;
		ButtonImage=&#34;Portrait_GDIWatchTower&#34;
		Side=&#34;ALIEN&#34;
		EditorSorting=&#34;STRUCTURE&#34;
		TransportSlotCount=&#34;1&#34;
		BuildCost=&#34;600&#34;
		BuildTime=&#34;6&#34;
		EnergyProduction=&#34;-5&#34;
		CommandSet=&#34;GDIWatchTowerCommandSet&#34;
		KindOf=&#34;STRUCTURE CAN_ATTACK SELECTABLE IMMOBILE CAN_CAST_REFLECTIONS FS_BASE_DEFENSE POWERED AUTO_ACQUIRABLE_BY_AI COVER CAN_SEE_THROUGH_STRUCTURE ATTACK_NEEDS_LINE_OF_SIGHT LINE_OF_SIGHT_IGNORES_BUILDINGS&#34;
		RadarPriority=&#34;STRUCTURE&#34;
		PlacementViewAngle=&#34;225d&#34;
		CampnessValue=&#34;=$CAMPNESS_DEFENSIVE_STRUCTURE&#34;
		ProductionQueueType=&#34;OTHER_STRUCTURE&#34;
		BuildPlacementTypeFlag=&#34;OTHER_STRUCTURE&#34;
		EditorName=&#34;Turret1&#34;
		WeaponCategory=&#34;GUN&#34;
		TypeDescription=&#34;Type&#58;GDIWatchTower&#34;
		Description=&#34;Desc&#58;GDIWatchTower&#34;>
		<DisplayName
			xai&#58;joinAction=&#34;Replace&#34; xmlns&#58;xai=&#34;uri&#58;ea.com&#58;eala&#58;asset&#58;instance&#34;>Name&#58;GDIWatchTower</DisplayName>
		<GameDependency>
			<RequiredObject>AlienPowerProjector</RequiredObject>
		</GameDependency>
		<ArmorSet
			Armor=&#34;AlienBuzzerHiveArmor&#34;
			DamageFX=&#34;FactionStructureDamageFX&#34; />
		<SkirmishAIInformation
			BaseBuildingLocation=&#34;SPREAD&#34; />
		<Draws>
			<!-- DRAW GUN -->
			<scriptedModelDraw
				id=&#34;ModuleTag_Draw&#34;
				OkToChangeModelColor=&#34;true&#34;
				ExtraPublicBone=&#34;FXMuzzle FXMuzzle2 FXMuzzleFlash FXMuzzleFlash2&#34;>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_DEFAULT&#34;>
					<Model
						Name=&#34;AST_Turret1&#34; />
					<WeaponFireFXBone
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzle FXMuzzle2&#34; />
					<WeaponMuzzleFlash
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzleFlash FXMuzzleFlash2&#34; />
					<WeaponLaunchBone
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzle FXMuzzle2&#34; />
					<Turret
						TurretNameKey=&#34;Turret&#34;
						TurretPitch=&#34;Barrel1 Barrel2&#34;
						TurretID=&#34;1&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;STRUCTURE_UNPACKING&#34;>
					<Model
						Name=&#34;ASTurret1_BLDS&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;DAMAGED&#34;>
					<Model
						Name=&#34;GBWatchTwrG&#34; />
					<Texture
						Original=&#34;GBWatchTwr&#34;
						New=&#34;GBWatchTowerD&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;REALLYDAMAGED&#34;>
					<Model
						Name=&#34;GBWatchTwrG&#34; />
					<Texture
						Original=&#34;GBWatchTwr&#34;
						New=&#34;GBWatchTowerD&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;DYING&#34;>
					<Model
						Name=&#34;GBWatchTwrGD3&#34; />
				</ModelConditionState>
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;BUILD_PLACEMENT_CURSOR&#34;>
					<!-- no anim -->
					<script>
						CurDrawableHideSubObject&#40;&#34;MuzzleFlash_01&#34;&#41;
						CurDrawableHideSubObject&#40;&#34;MuzzleFlash_02&#34;&#41;
					</Script>
				</AnimationState>
				<!-- BUILDUP ANIMATION -->
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;STRUCTURE_UNPACKING&#34;>
					<Animation
						AnimationName=&#34;ASTurret1_BLDA&#34;
						AnimationMode=&#34;ONCE&#34; />
				</AnimationState>
				<!-- DYING ANIMATION -->
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;DYING&#34;>
					<Animation
						AnimationName=&#34;GBWatchTwrGD3&#34;
						AnimationMode=&#34;ONCE&#34; />
					<ParticleSysBone
						BoneName=&#34;NONE&#34;
						FXParticleSystemTemplate=&#34;Des_Small&#34;
						FollowBone=&#34;false&#34; />
				</AnimationState>
			</ScriptedModelDraw>
			<SpotlightDraw
				id=&#34;ModuleTag_Spotlight&#34;
				AttachToBoneInAnotherModule=&#34;Bone_Spotlite&#34;
				RefreshTime=&#34;2.0s&#34;
				SweepTime=&#34;1.0s&#34;>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_DEFAULT&#34;>
					<Model
						Name=&#34;FXspotlight&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;BUILD_PLACEMENT_CURSOR&#34;>
					<Model
						Name=&#34;&#34; />
				</ModelConditionState>
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;BUILD_PLACEMENT_CURSOR&#34;>
					<script>
						CurDrawableHideSubObject&#40;&#34;Plane01&#34;&#41;
					</Script>	
				</AnimationState>		
			</SpotlightDraw>
			<TracerModelDraw
				id=&#34;ModuleTag_TracerModelDraw&#34;
				MinLength=&#34;35.0&#34;
				MaxLength=&#34;35.0&#34;
				Width=&#34;5.0&#34;
				MinSpeed=&#34;30&#34;
				MaxSpeed=&#34;40&#34;
				SweepSpeed=&#34;1.0&#34;
				SpreadAngle=&#34;4.0&#34;
				MinTracersPerFrame=&#34;1&#34;
				MaxTracersPerFrame=&#34;1&#34;
				FrameLifeTime=&#34;10&#34;
				WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
				Texture=&#34;FXTracerGDI&#34;
				UseAdditiveBlending=&#34;true&#34;
				TracerHitFx=&#34;FX_BulletHitLargeGDI&#34;>
				<HeadColor
					r=&#34;1.0&#34;
					g=&#34;1.0&#34;
					b=&#34;1.0&#34;
					a=&#34;1.0&#34; />
				<TailColor
					r=&#34;0.0&#34;
					g=&#34;0.0&#34;
					b=&#34;0.0&#34; />
			</TracerModelDraw>
		</Draws>
		<Behaviors>
			<WeaponSetUpdate
				id=&#34;ModuleTag_WeaponSetUpdate&#34;>
				<WeaponSlotTurret
					ID=&#34;1&#34;>
					<Weapon
						Ordering=&#34;PRIMARY_WEAPON&#34;
						Template=&#34;GDIWatchTowerGun&#34; />
					<TurretSettings
						TurretTurnRate=&#34;100&#34;
						TurretPitchRate=&#34;100&#34;
						AllowsPitch=&#34;true&#34;
						MinimumPitch=&#34;360d&#34;
						PitchHeight=&#34;0%&#34;
						MinIdleScanTime=&#34;1.0s&#34;
						MaxIdleScanTime=&#34;5.0s&#34;
						MinIdleScanAngle=&#34;0.0&#34;
						MaxIdleScanAngle=&#34;90.0&#34;>
						<TurretAITargetChooserData 
							StartupDelay=&#34;1.0s&#34;/>
					</TurretSettings>
				</WeaponSlotTurret>
			</WeaponSetUpdate>
			<!-- slow death must be defined before the structure topple. -->
			<SlowDeath
				id=&#34;ModuleTag_Death&#34;
				SinkDelay=&#34;4.0s&#34;
				SinkRate=&#34;4.0&#34;
				DestructionDelay=&#34;10.0s&#34;>
				<Sound Type=&#34;INITIAL&#34; List=&#34;HumanFaction_SmallBuilding_DieMS&#34; />
				<DieMuxData
					DeathTypes=&#34;ALL&#34; />
			</SlowDeath>
			<FXListBehavior
				id=&#34;ModuleTag_FXList&#34;>
				<DieMuxData
					DeathTypes=&#34;ALL&#34; />
				<Event
					Index=&#34;onDeath&#34;
					FX=&#34;FX_TEMPLarge&#34; />
				<Event
					Index=&#34;onTransitionToDamaged&#34;
					FX=&#34;FX_BuildDamaged_Small&#34; />
				<Event
					Index=&#34;onTransitionToReallyDamaged&#34;
					FX=&#34;FX_BuildDamaged_Small&#34; />
				<Event
					Index=&#34;onTransitionToRubble&#34;
					FX=&#34;FX_BuildRubble_Small&#34; />
			</FXListBehavior>
			<StructureUnpackUpdate
				UnpackTime=&#34;1.5s&#34; />
			<StealthDetectorUpdate
				id=&#34;ModuleTag_StealthDetect&#34;
				DetectionRange=&#34;100&#34; />
			<xi&#58;include
				href=&#34;DATA&#58;Includes/GenericBuildingRepair.xml&#34; />
			<xi&#58;include
				href=&#34;DATA&#58;Includes/GenericGDIBuildingSuicide.xml&#34; />
			<xi&#58;include
				href=&#34;DATA&#58;Includes/RepairAlliesEngineerContain.xml&#34; />
		</Behaviors>
		<AI>
			<AIUpdate
				id=&#34;ModuleTag_AI&#34;
				AutoAcquireEnemiesWhenIdle=&#34;YES&#34;
				AILuaEventsList=&#34;GDIWatchTowerFunctions&#34;>
				<UnitAITargetChooserData
					CanPickDynamicTargets=&#34;false&#34;
					SympathyRange=&#34;25.0&#34; 
					IdleScanDelay=&#34;0.2s&#34; />
			</AIUpdate>
		</AI>
		<Body>
			<ActiveBody
				id=&#34;ModuleTag_Body&#34;
				MaxHealth=&#34;2400&#34; />
		</Body>
		<Geometry
			IsSmall=&#34;false&#34;>
			<Shape
				Type=&#34;BOX&#34;
				MajorRadius=&#34;17.0&#34;
				MinorRadius=&#34;9&#34;
				Height=&#34;48.0&#34;
				ContactPointGeneration=&#34;STRUCTURE&#34;>
				<Offset
					x=&#34;-3.0&#34;
					y=&#34;0&#34;
					z=&#34;0&#34; />
			</Shape>
		</Geometry>
		<AudioArrayVoice>
			<AudioEntry
				Sound=&#34;AudioEvent&#58;GDI_WatchTowerSelect&#34;
				AudioType=&#34;voiceSelect&#34; />
		</AudioArrayVoice>
		<AudioArraySound>
			<AudioEntry Sound=&#34;HumanFaction_SmallBuilding_LightDamageMS&#34; AudioType=&#34;soundOnDamaged&#34; />
			<AudioEntry Sound=&#34;HumanFaction_SmallBuilding_HeavyDamageMS&#34; AudioType=&#34;soundOnReallyDamaged&#34; />
		</AudioArraySound>
		<ShadowInfo
			Type=&#34;VOLUME&#34; />
		<VisionInfo
			VisionRange=&#34;350&#34;
			ShroudClearingRange=&#34;500&#34; />
	</GameObject>
</AssetDeclaration>


Also here is a pic to show what I mean. The muzzle flashes stay on all the time and the bullets fly out from the middle.
Posted Image

Any help would be greatly appericated :duh:

Edited by Umbrella Secrets, 07 January 2011 - 01:22.

Posted Image
Posted Image

#2 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 07 January 2011 - 01:34

That is because you named both bones. You don't name both bones, only one of them.

If you have WeaponA01, WeaponA02, WeaponA03, etc, you just put in "WeaponA" as bone, not all of the bones.

Tracers can only fire from one barrel of one weapon.

When exporting, set the Muzzleflash's w3d properties to Hide.

#3 Umbrella Secrets

    Experimenting

  • Member
  • 658 posts
  • Projects: I'm with the Mapper Guild Projects

Posted 07 January 2011 - 02:25

 Sgt. Rho, on 6 Jan 2011, 20:34, said:

Tracers can only fire from one barrel of one weapon.


Thanks for the help :duh:
So that means I can only have one chaingun?

Edit: I looked at the Mammoth tank code and I just need to add another weapon. |8

Edited by Umbrella Secrets, 07 January 2011 - 03:00.

Posted Image
Posted Image

#4 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 07 January 2011 - 03:26

You can only have one active tracer for each unit. In TA I faked the tracers by using projectiles with the tracer-texture.

#5 Umbrella Secrets

    Experimenting

  • Member
  • 658 posts
  • Projects: I'm with the Mapper Guild Projects

Posted 07 January 2011 - 03:51

Is it okay if you send me an example of the code to fake a second gun fire please? So I can get an idea of how it works. :duh:
Posted Image
Posted Image

#6 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 07 January 2011 - 04:05

It's just a rapid fire weapon with a projectile.


<WeaponTemplate
		id=&#34;GDIVulcanTowerWeapon&#34;
		Name=&#34;GDIVulcanTowerWeapon&#34; 
		AttackRange=&#34;350.0&#34; 
		WeaponSpeed=&#34;700.0&#34; 
		FireSoundPerClip=&#34;FX_WolverineVulcan&#34;
		FireFX=&#34;FX_GDIWatchTowerFire&#34;
		RadiusDamageAffects=&#34;ALLIES ENEMIES NEUTRALS&#34;
		ClipSize=&#34;20&#34;
		AutoReloadsClip=&#34;AUTO&#34;
		AntiMask=&#34;ANTI_GROUND&#34;
		DisableScatterForTargetsOnWall=&#34;true&#34;
		CanFireWhileMoving=&#34;true&#34;
		RotatingTurret=&#34;true&#34;
		ReAcquireDetailType=&#34;PER_CLIP&#34;
		>
		<FiringDuration
			MinSeconds=&#34;.025s&#34;
			MaxSeconds=&#34;.025s&#34; />
		<ClipReloadTime
			MinSeconds=&#34;1.0s&#34;
			MaxSeconds=&#34;1.2s&#34; />

		<Nuggets>
			<ProjectileNugget 
				ProjectileTemplate=&#34;FXMinigunTracer&#34;
				WarheadTemplate=&#34;GDIVulcanTowerWeaponWarhead&#34;>
				<VeterancyProjectiles
					VeterancyLevel=&#34;HEROIC&#34;
					ProjectileTemplate=&#34;FXMinigunTracer_Veteran&#34;/>
			</ProjectileNugget>

		</Nuggets>
	</WeaponTemplate>

<WeaponTemplate
		  id=&#34;GDIVulcanTowerWeaponWarhead&#34;
		  Name=&#34;GDIVulcanTowerWeaponWarhead&#34; 
		  ProjectileCollidesWith  = &#34;ALLIES ENEMIES NEUTRAL STRUCTURES WALLS&#34; 
		  RadiusDamageAffects=&#34;ALLIES ENEMIES NEUTRALS&#34;>
		<Nuggets>
			<DamageNugget
				Damage=&#34;7.0&#34;
				Radius=&#34;0.0&#34; 
				DelayTimeSeconds=&#34;0.0s&#34; 
				DamageType=&#34;GUN&#34; 
				DamageFXType=&#34;GDI_MACHINEGUN&#34;		
				DeathType=&#34;NORMAL&#34; />
			<SuppressionNugget
				Radius=&#34;10.0&#34;
				Suppression=&#34;25&#34;
				DurationSeconds=&#34;5s&#34; />
		</Nuggets>
	</WeaponTemplate>



<?xml version=&#34;1.0&#34; encoding=&#34;us-ascii&#34;?>
<!-- The default tank projectile -->
<AssetDeclaration xmlns=&#34;uri&#58;ea.com&#58;eala&#58;asset&#34; xmlns&#58;xsi=&#34;http&#58;//www.w3.org/2001/XMLSchema-instance&#34; xmlns&#58;xai=&#34;uri&#58;ea.com&#58;eala&#58;asset&#58;instance&#34;>
	<Tags></Tags>
	<Includes>
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;FXVulcanTracer.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;FXTracerGDI.xml&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;FXTankShellHeroic.w3x&#34; />			
	</Includes>
	<GameObject
		id=&#34;FXMinigunTracer&#34;
		Side=&#34;GDI&#34;
		EditorSorting=&#34;SYSTEM&#34;
		KindOf=&#34;PROJECTILE NO_COLLIDE HIDE_IF_FOGGED&#34;
		EditorName=&#34;FXTankShell&#34;>
		<ArmorSet
			Armor=&#34;NoArmor&#34; />
		<Draws>
			<scriptedModelDraw
				id=&#34;ModuleTag_ScriptedModelDraw&#34;>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_DEFAULT&#34;>
					<Model
						Name=&#34;FXVulcanTracer&#34; />
					<Texture
						Original=&#34;FXTracer&#34;
						New=&#34;FXTracerGDI&#34; />	
				</ModelConditionState>

			</ScriptedModelDraw>
		</Draws>
		<Behaviors>
			<FXListBehavior
				id=&#34;ModuleTag_FXLists&#34;>
				<DieMuxData
					DeathTypes=&#34;ALL&#34; />
				<Event
					Index=&#34;onDeath&#34;
					FX=&#34;FX_BulletHitGDI&#34; />
			</FXListBehavior>
			<DestroyDie
				id=&#34;ModuleTag_Die&#34;>
				<DieMuxData
					DeathTypes=&#34;ALL&#34; />
			</DestroyDie>
			<BezierProjectile
				id=&#34;ModuleTag_BezierProjectileBehavior&#34;
				FirstHeightMin=&#34;0&#34;
				FirstHeightMax=&#34;0&#34;
				SecondHeightMin=&#34;0&#34;
				SecondHeightMax=&#34;0&#34;
				FirstPercentIndent=&#34;33&#34;
				SecondPercentIndent=&#34;66&#34;
				CurveFlattenMinDist=&#34;100&#34;
				DetonateCallsKill=&#34;true&#34; 
				FlightPathAdjustDistPerSecond=&#34;300&#34;
				FlightPathAdjustStraightOnly=&#34;false&#34;
				OrientToFlightPath=&#34;true&#34;>
			</BezierProjectile>
		</Behaviors>
		<Body>
			<ActiveBody
				id=&#34;ModuleTag_ActiveBody&#34;
				MaxHealth=&#34;100.0&#34; />
		</Body>
		<Geometry
			IsSmall=&#34;true&#34;>
			<Shape
				Type=&#34;SPHERE&#34;
				MajorRadius=&#34;0.8&#34;></Shape>
		</Geometry>
		<VisionInfo
			VisionRange=&#34;0&#34; />
	</GameObject>
		<GameObject
		inheritFrom=&#34;FXMinigunTracer&#34;
		id=&#34;FXMinigunTracer_Veteran&#34;
		EditorName=&#34;FXMinigunTracer_Veteran&#34;>
		<Draws>
			<scriptedModelDraw
				id=&#34;ModuleTag_ScriptedModelDraw&#34;
				xai&#58;joinAction=&#34;Replace&#34;>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_DEFAULT&#34;>
					<Model
						Name=&#34;FXVulcanTracer&#34; />
					<Texture
						Original=&#34;FXTracer&#34;
						New=&#34;FXTracerGDI&#34; />	
				</ModelConditionState>
			</ScriptedModelDraw>
		</Draws>
		<Behaviors>
			<BezierProjectile
				id=&#34;ModuleTag_BezierProjectileBehavior&#34;
				FirstHeightMin=&#34;0&#34;
				FirstHeightMax=&#34;0&#34;
				SecondHeightMin=&#34;0&#34;
				SecondHeightMax=&#34;0&#34;
				FirstPercentIndent=&#34;33&#34;
				SecondPercentIndent=&#34;66&#34;
				CurveFlattenMinDist=&#34;100&#34;
				DetonateCallsKill=&#34;true&#34; 
				FlightPathAdjustDistPerSecond=&#34;300&#34;
				FlightPathAdjustStraightOnly=&#34;false&#34;
				OrientToFlightPath=&#34;true&#34;>
			</BezierProjectile>
		</Behaviors>		
	</GameObject>	

</AssetDeclaration>

Edited by Sgt. Rho, 07 January 2011 - 04:06.


#7 Umbrella Secrets

    Experimenting

  • Member
  • 658 posts
  • Projects: I'm with the Mapper Guild Projects

Posted 07 January 2011 - 04:17

Oh okay I've seen these before in worldbuilder, I always wondered way EA had random shells or bullets. Thanks :duh:
Posted Image
Posted Image

#8 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 07 January 2011 - 07:53

Those random shells or bullets are tank rounds :duh:

#9 Umbrella Secrets

    Experimenting

  • Member
  • 658 posts
  • Projects: I'm with the Mapper Guild Projects

Posted 08 January 2011 - 00:58

I need help on this code again :duh: The second chaingun won't fire for some reason I'm not sure if this code is right, this is the turret structure code.

<?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?>
<AssetDeclaration xmlns=&#34;uri&#58;ea.com&#58;eala&#58;asset&#34; xmlns&#58;xsi=&#34;http&#58;//www.w3.org/2001/XMLSchema-instance&#34; xmlns&#58;xi=&#34;http&#58;//www.w3.org/2001/XInclude&#34;>
	<Tags></Tags>
	<Includes>
		<Include
			type=&#34;all&#34;
			source=&#34;DATA&#58;GlobalData/GlobalDefines.xml&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;AST_Turret1.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;ASTurret1_BLDS.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;ASTurret1_BLDA.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrD3_SN.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrD3_AN.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;FXspotlight.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwr_A.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrG.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrG_A.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;GBWatchTwrGD3.w3x&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;ART&#58;FXTracerGDI.xml&#34; />
		<Include
			type=&#34;all&#34;
			source=&#34;DATA&#58;GlobalData/GlobalDefines.xml&#34; />
		<!-- Base Object -->
		<Include
			type=&#34;instance&#34;
			source=&#34;DATA&#58;BaseObjects/BaseStructure.xml&#34; />
	</Includes>
	<GameObject
		id=&#34;AlienBuzzerHive&#34;
		inheritFrom=&#34;BaseStructure&#34;
		SelectPortrait=&#34;Portrait_GDIWatchTower&#34;
		ButtonImage=&#34;Portrait_GDIWatchTower&#34;
		Side=&#34;ALIEN&#34;
		EditorSorting=&#34;STRUCTURE&#34;
		TransportSlotCount=&#34;1&#34;
		BuildCost=&#34;600&#34;
		BuildTime=&#34;6&#34;
		EnergyProduction=&#34;-5&#34;
		CommandSet=&#34;GDIWatchTowerCommandSet&#34;
		KindOf=&#34;STRUCTURE CAN_ATTACK SELECTABLE IMMOBILE CAN_CAST_REFLECTIONS FS_BASE_DEFENSE POWERED AUTO_ACQUIRABLE_BY_AI COVER CAN_SEE_THROUGH_STRUCTURE ATTACK_NEEDS_LINE_OF_SIGHT LINE_OF_SIGHT_IGNORES_BUILDINGS&#34;
		RadarPriority=&#34;STRUCTURE&#34;
		PlacementViewAngle=&#34;225d&#34;
		CampnessValue=&#34;=$CAMPNESS_DEFENSIVE_STRUCTURE&#34;
		ProductionQueueType=&#34;OTHER_STRUCTURE&#34;
		BuildPlacementTypeFlag=&#34;OTHER_STRUCTURE&#34;
		EditorName=&#34;Turret1&#34;
		WeaponCategory=&#34;GUN&#34;
		TypeDescription=&#34;Type&#58;GDIWatchTower&#34;
		Description=&#34;Desc&#58;GDIWatchTower&#34;>
		<DisplayName
			xai&#58;joinAction=&#34;Replace&#34; xmlns&#58;xai=&#34;uri&#58;ea.com&#58;eala&#58;asset&#58;instance&#34;>Name&#58;GDIWatchTower</DisplayName>
		<GameDependency>
			<RequiredObject>AlienPowerProjector</RequiredObject>
		</GameDependency>
		<ArmorSet
			Armor=&#34;AlienBuzzerHiveArmor&#34;
			DamageFX=&#34;FactionStructureDamageFX&#34; />
		<SkirmishAIInformation
			BaseBuildingLocation=&#34;SPREAD&#34; />
		<Draws>
			<!-- DRAW GUN -->
			<scriptedModelDraw
				id=&#34;ModuleTag_Draw&#34;
				OkToChangeModelColor=&#34;true&#34;
				ExtraPublicBone=&#34;FXMuzzle FXMuzzle2 FXMuzzleFlash FXMuzzleFlash2&#34;>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_DEFAULT&#34;>
					<Model
						Name=&#34;AST_Turret1&#34; />
					<WeaponFireFXBone
						WeaponSlotID=&#34;1&#34;
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzle&#34; />
					<WeaponMuzzleFlash
						WeaponSlotID=&#34;1&#34;
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzleFlash&#34; />
					<WeaponLaunchBone
						WeaponSlotID=&#34;1&#34;
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzle&#34; />
					<WeaponFireFXBone
						WeaponSlotID=&#34;2&#34;
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzle2&#34; />
					<WeaponMuzzleFlash
						WeaponSlotID=&#34;2&#34;
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzleFlash2&#34; />
					<WeaponLaunchBone
						WeaponSlotID=&#34;2&#34;
						WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
						BoneName=&#34;FXMuzzle2&#34; />
					<Turret
						TurretNameKey=&#34;Turret&#34;
						TurretPitch=&#34;Barrel&#34;
						TurretID=&#34;1&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;STRUCTURE_UNPACKING&#34;>
					<Model
						Name=&#34;ASTurret1_BLDS&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;DAMAGED&#34;>
					<Model
						Name=&#34;GBWatchTwrG&#34; />
					<Texture
						Original=&#34;GBWatchTwr&#34;
						New=&#34;GBWatchTowerD&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;REALLYDAMAGED&#34;>
					<Model
						Name=&#34;GBWatchTwrG&#34; />
					<Texture
						Original=&#34;GBWatchTwr&#34;
						New=&#34;GBWatchTowerD&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;DYING&#34;>
					<Model
						Name=&#34;GBWatchTwrGD3&#34; />
				</ModelConditionState>
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;FIRING_A&#34;>
					<Animation
						AnimationName=&#34;AST_Turret1&#34;
						AnimationMode=&#34;LOOP&#34; />
				</AnimationState>
				<AnimationState
					ParseCondStateType=&#34;PARSE_DEFAULT&#34;
					StateName=&#34;STATE_bored&#34;
					AllowRepeatInRandomPick=&#34;true&#34;>
					<Animation
						AnimationName=&#34;AST_Turret1&#34;
						AnimationMode=&#34;LOOP&#34;
						AnimationSpeedFactorMin=&#34;0.8&#34;
						AnimationSpeedFactorMax=&#34;0.8&#34; />
				</AnimationState>
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;BUILD_PLACEMENT_CURSOR&#34;>
					<!-- no anim -->
					<script>
						CurDrawableHideSubObject&#40;&#34;MuzzleFlash_01&#34;&#41;
						CurDrawableHideSubObject&#40;&#34;MuzzleFlash_02&#34;&#41;
					</Script>
				</AnimationState>
				<!-- BUILDUP ANIMATION -->
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;STRUCTURE_UNPACKING&#34;>
					<Animation
						AnimationName=&#34;ASTurret1_BLDA&#34;
						AnimationMode=&#34;ONCE&#34; />
				</AnimationState>
				<!-- DYING ANIMATION -->
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;DYING&#34;>
					<Animation
						AnimationName=&#34;GBWatchTwrGD3&#34;
						AnimationMode=&#34;ONCE&#34; />
					<ParticleSysBone
						BoneName=&#34;NONE&#34;
						FXParticleSystemTemplate=&#34;Des_Small&#34;
						FollowBone=&#34;false&#34; />
				</AnimationState>
			</ScriptedModelDraw>
			<SpotlightDraw
				id=&#34;ModuleTag_Spotlight&#34;
				AttachToBoneInAnotherModule=&#34;Bone_Spotlite&#34;
				RefreshTime=&#34;2.0s&#34;
				SweepTime=&#34;1.0s&#34;>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_DEFAULT&#34;>
					<Model
						Name=&#34;FXspotlight&#34; />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;BUILD_PLACEMENT_CURSOR&#34;>
					<Model
						Name=&#34;&#34; />
				</ModelConditionState>
				<AnimationState
					ParseCondStateType=&#34;PARSE_NORMAL&#34;
					ConditionsYes=&#34;BUILD_PLACEMENT_CURSOR&#34;>
					<script>
						CurDrawableHideSubObject&#40;&#34;Plane01&#34;&#41;
					</Script>	
				</AnimationState>		
			</SpotlightDraw>
			<TracerModelDraw
				id=&#34;ModuleTag_TracerModelDraw&#34;
				MinLength=&#34;35.0&#34;
				MaxLength=&#34;35.0&#34;
				Width=&#34;5.0&#34;
				MinSpeed=&#34;30&#34;
				MaxSpeed=&#34;40&#34;
				SweepSpeed=&#34;1.0&#34;
				SpreadAngle=&#34;4.0&#34;
				MinTracersPerFrame=&#34;1&#34;
				MaxTracersPerFrame=&#34;1&#34;
				FrameLifeTime=&#34;10&#34;
				WeaponSlotType=&#34;PRIMARY_WEAPON&#34;
				Texture=&#34;FXTracerGDI&#34;
				UseAdditiveBlending=&#34;true&#34;
				TracerHitFx=&#34;FX_BulletHitLargeGDI&#34;>
				<HeadColor
					r=&#34;1.0&#34;
					g=&#34;1.0&#34;
					b=&#34;1.0&#34;
					a=&#34;1.0&#34; />
				<TailColor
					r=&#34;0.0&#34;
					g=&#34;0.0&#34;
					b=&#34;0.0&#34; />
			</TracerModelDraw>
		</Draws>
		<Behaviors>
			<WeaponSetUpdate
				id=&#34;ModuleTag_WeaponSetUpdate&#34;>
				<WeaponSlotTurret
					ID=&#34;1&#34;
					ParentID=&#34;1&#34;>
					<Weapon
						Ordering=&#34;PRIMARY_WEAPON&#34;
						Template=&#34;GDIWatchTowerGun&#34; />
					<TurretSettings
						TurretTurnRate=&#34;100&#34;
						TurretPitchRate=&#34;100&#34;
						AllowsPitch=&#34;true&#34;
						MinimumPitch=&#34;0d&#34;
						PitchHeight=&#34;0%&#34;
						MinIdleScanTime=&#34;1.0s&#34;
						MaxIdleScanTime=&#34;5.0s&#34;
						MinIdleScanAngle=&#34;0.0&#34;
						MaxIdleScanAngle=&#34;90.0&#34;>
						<TurretAITargetChooserData 
							StartupDelay=&#34;1.0s&#34;/>
					</TurretSettings>
				</WeaponSlotTurret>
				<WeaponSlotTurret
					ID=&#34;2&#34;
					ParentID=&#34;1&#34;>
					<Weapon
						Ordering=&#34;PRIMARY_WEAPON&#34;
						Template=&#34;ASTurret1Weapon&#34; />
				</WeaponSlotTurret>
	
			</WeaponSetUpdate>
			<!-- slow death must be defined before the structure topple. -->
			<SlowDeath
				id=&#34;ModuleTag_Death&#34;
				SinkDelay=&#34;4.0s&#34;
				SinkRate=&#34;4.0&#34;
				DestructionDelay=&#34;10.0s&#34;>
				<Sound Type=&#34;INITIAL&#34; List=&#34;HumanFaction_SmallBuilding_DieMS&#34; />
				<DieMuxData
					DeathTypes=&#34;ALL&#34; />
			</SlowDeath>
			<FXListBehavior
				id=&#34;ModuleTag_FXList&#34;>
				<DieMuxData
					DeathTypes=&#34;ALL&#34; />
				<Event
					Index=&#34;onDeath&#34;
					FX=&#34;FX_TEMPLarge&#34; />
				<Event
					Index=&#34;onTransitionToDamaged&#34;
					FX=&#34;FX_BuildDamaged_Small&#34; />
				<Event
					Index=&#34;onTransitionToReallyDamaged&#34;
					FX=&#34;FX_BuildDamaged_Small&#34; />
				<Event
					Index=&#34;onTransitionToRubble&#34;
					FX=&#34;FX_BuildRubble_Small&#34; />
			</FXListBehavior>
			<StructureUnpackUpdate
				UnpackTime=&#34;1.5s&#34; />
			<StealthDetectorUpdate
				id=&#34;ModuleTag_StealthDetect&#34;
				DetectionRange=&#34;100&#34; />
			<xi&#58;include
				href=&#34;DATA&#58;Includes/GenericBuildingRepair.xml&#34; />
			<xi&#58;include
				href=&#34;DATA&#58;Includes/GenericGDIBuildingSuicide.xml&#34; />
			<xi&#58;include
				href=&#34;DATA&#58;Includes/RepairAlliesEngineerContain.xml&#34; />
		</Behaviors>
		<AI>
			<AIUpdate
				id=&#34;ModuleTag_AI&#34;
				AutoAcquireEnemiesWhenIdle=&#34;YES&#34;
				AILuaEventsList=&#34;GDIWatchTowerFunctions&#34;>
				<UnitAITargetChooserData
					CanPickDynamicTargets=&#34;false&#34;
					SympathyRange=&#34;25.0&#34; 
					IdleScanDelay=&#34;0.2s&#34; />
			</AIUpdate>
		</AI>
		<Body>
			<ActiveBody
				id=&#34;ModuleTag_Body&#34;
				MaxHealth=&#34;2400&#34; />
		</Body>
		<Geometry
			IsSmall=&#34;false&#34;>
			<Shape
				Type=&#34;BOX&#34;
				MajorRadius=&#34;17.0&#34;
				MinorRadius=&#34;9&#34;
				Height=&#34;48.0&#34;
				ContactPointGeneration=&#34;STRUCTURE&#34;>
				<Offset
					x=&#34;-3.0&#34;
					y=&#34;0&#34;
					z=&#34;0&#34; />
			</Shape>
		</Geometry>
		<AudioArrayVoice>
			<AudioEntry
				Sound=&#34;AudioEvent&#58;GDI_WatchTowerSelect&#34;
				AudioType=&#34;voiceSelect&#34; />
		</AudioArrayVoice>
		<AudioArraySound>
			<AudioEntry Sound=&#34;HumanFaction_SmallBuilding_LightDamageMS&#34; AudioType=&#34;soundOnDamaged&#34; />
			<AudioEntry Sound=&#34;HumanFaction_SmallBuilding_HeavyDamageMS&#34; AudioType=&#34;soundOnReallyDamaged&#34; />
		</AudioArraySound>
		<ShadowInfo
			Type=&#34;VOLUME&#34; />
		<VisionInfo
			VisionRange=&#34;350&#34;
			ShroudClearingRange=&#34;500&#34; />
	</GameObject>
</AssetDeclaration>

Posted Image
Posted Image

#10 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 08 January 2011 - 01:20

I'd define a 2nd turret, you have 2 turret weapons, but only one turret.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users