logo   login
right
Home Forums Downloads Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Forum Info
Forum Members: 18,677
Total Threads: 8,798
Posts: 95,842

Administrators:
DeeZire, Redemption

There are currently 34 users online.
Partner Links

Free Credit Repair

Learn the Ticket Broker Secrets
Advertisements

DeeZire Online > Editing Community > Member Written Tutorials » [TW] Creating a halftrack

Member Written Tutorials A compilation and archive of tutorials written by members. You cant post here, but you can read the threads.

Reply
 
LinkBack Thread Tools
Old 03-30-2008, 08:32 AM   #1 (permalink)
Junior Member
 
General_Subway's Avatar
 
Join Date: Apr 2007
Location: Dresden, Germany
Posts: 15
Send a message via ICQ to General_Subway
Post [TW] Creating a halftrack

You need a half-track-unit in your mod? Unfortunately, there is no "TankTruckDrawModule" in CnC3TW, like in Generals.
But its not difficult to create a halftrack in TW.
The trick is, to combine two draw modules: TankDraw and TruckDraw.

First, make your model of a halftrack and texture it, give the treads an own texture-file.

Then, we have to separate the truck-part and the tank-part.
The truck-part is the whole model except the treads (tire animation). The treads are our tank-part (tread animation).
Save your model. After this, select the treads and delete them. Save the treadless model under yourmodelname_truck.
Now, reopen your complete model or undo the tread deletion. Select all except the treads and delete it. Save the treads under yourmodelname_treads. Export both parts to w3x-files (3dsmax-Users have to change the commas to dots inside w3x-Files after exporting). Copy the two w3x-files and the model's textures in your Modsdk/Art/.../ -folder and create the xml-files for the textures.
It's time to create the unit-xml. It can look like this: (just an example, I removed for this tutorial unnecessary code parts)

Code:
<?xml version="1.0" encoding="utf-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude">
	<Tags></Tags>
	<Includes>
		<Include
			type="all"
			source="DATA:GlobalData/GlobalDefines.xml" />
		<!--for formation preview-->
		<Include
			type="all"
			source="ART:AL_Halftrack.W3X" />
		<!--Truck part-->
		<Include
			type="all"
			source="ART:AL_Halftrack_truck.W3X" />
		<!--Tank part-->
		<Include
			type="all"
			source="ART:AL_Halftrack_treads.W3X" />
		<!-- Base Object -->
		<Include
			type="instance"
			source="DATA:BaseObjects/BaseVehicle.xml" />
	</Includes>
	<GameObject
		id="Halftrack"
		inheritFrom="BaseVehicle"
		SelectPortrait="Portrait_GDIPitbull"
		ButtonImage="Portrait_GDIPitbull"
		Side="GDI"
		EditorSorting="UNIT"
		TransportSlotCount="1"
		BuildCost="1000"
		BuildTime="7"
		CommandSet="HalftrackCommandSet"
		CommandPoints="100" 
		KindOf="PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS SCORE VEHICLE CAN_REVERSE_MOVE CAN_BE_FAVORITE_UNIT TRANSPORT"
		RadarPriority="UNIT"
		ThreatLevel="10"
		ProductionQueueType="VEHICLE"
		UnitCategory="VEHICLE"
		WeaponCategory="GUN"
		VoicePriority="164"
		EditorName="GDIPitbull"
		Description="Desc:Halftrack"
		TypeDescription="Type:Halftrack">
		<DisplayName
			xai:joinAction="Replace" xmlns:xai="uri:ea.com:eala:asset:instance">Name:Halftrack</DisplayName>
		<ArmorSet
			Armor="HalftrackArmor"
			DamageFX="VehicleDamageFX" />
		<LocomotorSet
			Locomotor="GDIPitbullLocomotor"
			Condition="NORMAL"
			Speed="70.0" />
		<SkirmishAIInformation
			UnitBuilderStandardCombatUnit="true" />
		<Draws>
			<!--Truck part-->
			<TruckDraw
				id="ModuleTag_Draw"
				OkToChangeModelColor="true"
				TrackMarksOnlyWhenCorneringQuickly="true"
				LeftFrontTireBone="Tire01"
				RightFrontTireBone="Tire02"
				TireRotationMultiplier="0.2"
				PowerslideRotationAddition="1.25"
				ExtraPublicBone="Tire01 Tire02">
				<ModelConditionState
					ParseCondStateType="PARSE_DEFAULT">
					<Model
						Name="AL_Halftrack_truck" />
				</ModelConditionState>
				<!--Fahrzeug beschädigt-->
				<ModelConditionState					
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="DAMAGED">
					<Model
						Name="AL_Halftrack_truck" />
				</ModelConditionState>
				<!--Fahrzeug stark beschädigt-->
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="REALLYDAMAGED">
					<Model
						Name="AL_Halftrack_truck" />
				</ModelConditionState>
				<!--Fahrzeug zerstört-->
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="DYING">
					<Model
						Name="AL_Halftrack_truck" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="FORMATION_PREVIEW">
					<Model
						Name="AL_Halftrack" />
				</ModelConditionState>				
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="DYING">
					<!-- no anim -->
				</AnimationState>
			</TruckDraw>
			<!--Tank part-->
			<TankDraw
				id="ModuleTag_Draw2"
				OkToChangeModelColor="true"
				TreadAnimationRate="0.15"
				TreadDriveSpeedFraction="0.25"
				TreadPivotSpeedFraction="0.9">
				<ModelConditionState
					ParseCondStateType="PARSE_DEFAULT">
					<Model
						Name="al_halftrack_treads" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="REALLYDAMAGED">
					<Model
						Name="al_halftrack_treads" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="DYING">
					<Model
						Name="al_halftrack_treads" />
				</ModelConditionState>
				<AnimationState
					ParseCondStateType="PARSE_DEFAULT">
					<!-- Circumvents blend issues when the arrow is being shown... -->
					<Script>
						CurDrawableShowSubObject("TreadsStop")
						CurDrawableHideSubObject("Treadsmove")
					</Script>
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="MOVING TURN_LEFT">
					<!-- Circumvents blend issues when the arrow is being shown... -->
					<Script>
						CurDrawableHideSubObject("TreadsStop")
						CurDrawableShowSubObject("Treadsmove")
					</Script>
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="MOVING TURN_RIGHT">
					<!-- Circumvents blend issues when the arrow is being shown... -->
					<Script>
						CurDrawableHideSubObject("TreadsStop")
						CurDrawableShowSubObject("Treadsmove")
					</Script>
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="MOVING">
					<!-- Circumvents blend issues when the arrow is being shown... -->
					<Script>
						CurDrawableHideSubObject("TreadsStop")
						CurDrawableShowSubObject("Treadsmove")
					</Script>
				</AnimationState>
				<LeftTread>"Treadsmove"</LeftTread>
				<RightTread>"Treadsmove"</RightTread>
			</TankDraw>
		</Draws>
		<Behaviors>
			<!--insert your behavior part here-->	
		</Behaviors>
		<AI>
			<AIUpdate
				id="ModuleTag_AI"
				AutoAcquireEnemiesWhenIdle="YES"
				AILuaEventsList="GDIPitbullFunctions">
				<UnitAITargetChooserData
					SympathyRange="100.0"
					RotateToTargetWhenAiming="false" />
			</AIUpdate>
		</AI>
		<Body>
			<ActiveBody
				id="ModuleTag_Body"
				MaxHealth="900" />
		</Body>
		<ClientBehaviors>
			<!--..............-->
		</ClientBehaviors>
		<Geometry
			IsSmall="true">
			<Shape
				Type="BOX"
				MajorRadius="25.0"
				MinorRadius="7.0"
				Height="14.5"
				ContactPointGeneration="VEHICLE" />
		</Geometry>
		<AudioArrayVoice>
			<!--Voice part-->
		</AudioArrayVoice>
		
		<AudioArraySound>
			<!--Unit sound part-->
		</AudioArraySound>
		<ShadowInfo
			Type="VOLUME" />
		<VisionInfo
			VisionRange="350"
			ShroudClearingRange="350" />
		<CrusherInfo
			CrusherLevel="0"
			CrushEqualLevelProps="true"
			CrushableLevel="2" />
	</GameObject>
</AssetDeclaration>
At last, create all necessary entries and xml's 4 your unit, compile and play your mod.
Its my solution for a halftrack-unit. Proposals and better solutions welcome! The NOD-Reckoner in "Kanes Wrath" is a halftrack in my opinion. The code of this unit could be include a better solution.

Note: Sorry 4 my bad English

Greetz
G.S.

Last edited by General_Subway; 03-30-2008 at 08:34 AM..
General_Subway is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:34 AM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.