Jump to content


Redhorn Pass

Member Since 02 Oct 2006
Offline Last Active Oct 30 2009 02:11 PM

Topics I've Started

Animation Code Problems

28 May 2009 - 07:06 PM

Hi, I have been trying to create a beorn for my mod and am currently doing the bear coding. The problem is that the bear does not use any of the attacking animations which I have created. :p I have put the following code into my object code file:

The attacking code:

// --- Attacking Anims		
AnimationState				= FIRING_OR_PREATTACK_A DISGUISED	// Melee attack.
	Animation
		AnimationName		= CUBear_SKL.CUBear_IDLF
		AnimationMode		= ONCE
		UseWeaponTiming		= NO
	End
End


The DISGUISED model condition is the one I am using to change between human and bear

The other bear animation code:

CODE


;The walking code
AnimationState = DISGUISED MOVING PANICKING
Animation = RUNA
AnimationName = CUBear_SKL.CUBear_RUNA
AnimationMode = LOOP
End
Flags = RANDOMSTART
End

AnimationState = DISGUISED MOVING
StateName = STATE_moving
Animation = Moving
AnimationName = CUBear_SKL.CUBear_WALKA
AnimationBlendTime = 10
AnimationMustCompleteBlend = yes
End
Flags = RESTART_ANIM_WHEN_COMPLETE
BeginScript
Prev = CurDrawablePrevAnimationState()
if Prev == "STATE_Alert" then CurDrawableSetTransitionAnimState("TRANS_AlertToIdle") end
EndScript

End


;The death code

AnimationState = DISGUISED DYING
Animation = CUBear_DIEA
AnimationName = CUBear_SKL.CUBear_DIEA
AnimationMode = ONCE
End
End

;The idle code
AnimationState= DISGUISED
StateName = STATE_Idle
Animation = IdleA
AnimationName = CUBear_SKL.CUBear_IDLA
AnimationPriority = 10
AnimationMode = ONCE
AnimationBlendTime = 10
End
Animation = IdleB
AnimationName = CUBear_SKL.CUBear_IDLB
AnimationPriority = 10
AnimationMode = ONCE
AnimationBlendTime = 10
End
Flags = RESTART_ANIM_WHEN_COMPLETE
BeginScript
Prev = CurDrawablePrevAnimationState()
if Prev == "STATE_Alert" then CurDrawableSetTransitionAnimState("TRANS_AlertToIdle") end
EndScript
End

I know that there is no problem with the animation model since I used the following code as a test:

   	AnimationState= DISGUISED
		StateName					=   STATE_Idle
		Animation = IdleA
			AnimationName	   = CUBear_SKL.CUBear_IDLF
			AnimationPriority	= 10
			AnimationMode	   = ONCE
			AnimationBlendTime	=	10
		End
		Animation = IdleB
			AnimationName	   = CUBear_SKL.CUBear_IDLF
			AnimationPriority	= 10
			AnimationMode	   = ONCE
			AnimationBlendTime	=	10
		End

The animation model works fine when I use it as my idle animation. It is only when I use it as my attacking animation that nothing happens. This makes me think that it is my code not the animation model which is at fault.


_________________________________________________________________________

I have also created a special attack called bear pounce. Bear pounce is based on the earth shatter ability. The bear pounce kills all the nearby enemies as it should but the bear does not stand up and slam its front paws on the ground as it is supposed to. :good: This is my animation code for bear pounce:

AnimationState		  =	SPECIAL_WEAPON_THREE DISGUISED // FIRING_OR_PREATTACK_C
			StateName		  =	Attacking
			Animation		  =	StaffLaser
				AnimationName =	CUBear_SKL.CUBear_IDLF//	isitari's light?
				AnimationMode =	ONCE
			End
			FXEvent			  =	Frame:30 Name:FX_GandalfStaffFlare
		End

Is SPECIAL_WEAPON_THREE the model condition I should use here?

My special power code for bear pounce:

Behaviour code:

CODE

;---------------------------Pounce-------------------------------------


Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroBearPounceEnabler_Level1
SpecialPowerTemplate = SpecialAbilityCreateAHeroBearPounce
TriggeredBy = Upgrade_CreateAHeroBearPounce_Level1
End
Behavior = SpecialPowerModule ModuleTag_CreateAHeroBearPounceStarter_Level1
SpecialPowerTemplate = SpecialAbilityCreateAHeroBearPounce
UpdateModuleStartsAttack = Yes
StartsPaused = Yes
End
Behavior = WeaponFireSpecialAbilityUpdate ModuleTag_CreateAHeroBearPounceUpdate_Level1
SpecialPowerTemplate = SpecialAbilityCreateAHeroBearPounce
SpecialWeapon = CreateAHeroEarthShaker_Level1
WhichSpecialWeapon = 3 ; Corresponds to SPECIAL_WEAPON_THREE
StartAbilityRange = 1.0

SkipContinue = Yes
UnpackTime = 2000 ; Trigger on frame 60 (of 100)
PackTime = 1333 ; Remaining 40 frames (of 100)
MustFinishAbility = Yes
End

Does anyone know why my attack animations won't work?

Thanks :)

Separate Human and AI Commandsets for Objects

24 October 2008 - 12:40 AM

Hi, I have been wandering if it is possible to give an object a human player a commandset which is only used by the AI. Would it be possible to do this? If so what code should I use.

I have found some code I could use if it possible to give the an upgrade to an object only when it is AI controlled? If so I can use code similar this to change the command set for the AI:

Behavior = CommandSetUpgrade ModuleTag_commandSetWellOfSouls
		TriggeredBy 			= Upgrade_AngmarWellOfSouls
		CommandSet 			= AngmarNecromancerHordeWellCommandSet
	End

Apart from this I haven't found any code that looks helpful so I don't have any actual code yet. :sad2:

Can what I want to do be achieved at all? :ohmy:

THANKS! :rolleyes:

Annoying Asset Problems

10 October 2008 - 03:20 PM

I have been useing the Adding Morthond Bowmen into a mod tutorial in an attempt to create an asset file for my new textures and models. My problem is that my textures and models still won't show in the game. :sad2:

I am trying to create assets for the following files:

Image Files (Both are tga files):

art\compiledtextures\eu\eubtlshipw_d_update
art\compiledtextures\eu\EUBtlShipW_UpdateE

Model Files:

art\w3d\pr\PRDARKGREY13

The two texture files are for a different object from the model file.



When I created the asset I got this error in the error document:

Internal hierarchy is named ICEBERG; Could not get info for art\w3d\pr\prdarkgrey13.w3d


What does this mean and could this error have stopped have caused the texture files to also not work? :mellow:

This is print screen of my asset:

Posted Image

The file locations used:

My asset file is stored in a big file which I saved in:
C:\Documents and Settings\[my user name]\Application Data\My The Lord of the Rings, The Rise of the Witch-king Files

and I run the game using a shortcut "C:\Program Files\Electronic Arts\The Lord of the Rings, The Rise of the Witch-king\lotrbfme2ep1.exe" -mod "C:\Documents and Settings\[my user name]\Application Data\My The Lord of the Rings, The Rise of the Witch-king Files\Inn"

Does anyone know what my problem might be and how to fix it?

THANKS!! :) :mellow:

3 Questions: Please Help!

16 August 2008 - 02:40 PM

Question 1: A Command Set Problem

I have been trying to modify the entmoot so that Treebeard can revive. I have managed it (almost) but for some reason the normal ent units (whose code I have not touched in any way) now refuse to build.

When I click on the command button for the unit ent a number appears to indicate how many ents I have ordered (as it should) but the shading indicating how long it is until the unit will arrive never gets any less and the unit never arrives.

Heres my code:

Command buttons:

Normal Ent command button: (This is the one used by EA and I made no changes to it)

CommandButton Command_ConstructEntGeneric
	Command				= UNIT_BUILD
	Object				= RohanGenericEnt
	Options				= CANCELABLE
	TextLabel			= CONTROLBAR:ConstructEnt
	ButtonImage			= BEEntMoot_Ents
	ButtonBorderType		= BUILD 
	DescriptLabel			= CONTROLBAR:ToolTipBuildEnt
	Radial				= Yes
	InPalantir	   		= Yes
	ShowProductionCount		= Yes
;	UnitSpecificSound   = GondorArcherVoiceBuy	  
End

I was wandering if the revive the presence of the revive buttons could be causing the problem so I have included them too.

Treebeard:

CommandButton Command_TreebeardReviveSlot
Command				= REVIVE
	Options				= CANCELABLE NEED_UPGRADE;HIDE_WHILE_DISABLED 	;Hides button while disabled.
	NeededUpgrade		= Upgrade_AllowTreeBeardtobeBuilt; This upgrade is granted when Treebeard dies to allow him to be rebuilt. When he is revived it is removed to prevent dublicate Trebeards from being made.
	TextLabel			= CONTROLBAR:GenericReviveHero
;ButtonImage		= ***Filled in automatically! No need to specify a button image. 
	ButtonBorderType	= BUILD 
	DescriptLabel		= CONTROLBAR:ToolTipGenericReviveHero
	InPalantir			= No
	Radial				= Yes
End


I found that it was necessary to have all the heroes in the ent moot command set so they do not appear in Treebeards's revive slot. Accordingly I added an upgrade condition to the command buttons of the other heroes. Since the upgrade is never granted the other heroes cannot be built from the moot.

Normal hero command buttons:

CommandButton Command_GenericReviveSlot1a
	Command				= REVIVE
	Options				= HIDE_WHILE_DISABLED CANCELABLE NEED_UPGRADE
	NeededUpgrade		= Upgrade_PreventTreebeardFromBeingBuiltatfortress	;Hides button while disabled. This time the fake upgrade is being used to hide all the normal heroes so that only Treebeard is buyable from the entmoot!
	TextLabel			= CONTROLBAR:GenericReviveHero
;ButtonImage		= ***Filled in automatically! No need to specify a button image. 
	ButtonBorderType	= BUILD 
	DescriptLabel		= CONTROLBAR:ToolTipGenericReviveHero
	InPalantir			= No
	Radial				= Yes
End

CommandButton Command_GenericReviveSlot2a
	Command				= REVIVE
	Options				= HIDE_WHILE_DISABLED CANCELABLE NEED_UPGRADE
	NeededUpgrade		= Upgrade_PreventTreebeardFromBeingBuiltatfortress	;Hides button while disabled.
	TextLabel			= CONTROLBAR:GenericReviveHero
;ButtonImage		= ***Filled in automatically! No need to specify a button image. 
	ButtonBorderType	= BUILD 
	DescriptLabel		= CONTROLBAR:ToolTipGenericReviveHero
	InPalantir			= No
	Radial				= Yes
End
The command buttons continue like this all the way to Command_GenericReviveSlot7a:

CommandButton Command_GenericReviveSlot7a
	Command				= REVIVE
	Options				= HIDE_WHILE_DISABLED CANCELABLE NEED_UPGRADE
	NeededUpgrade		= Upgrade_PreventTreebeardFromBeingBuiltatfortress	;Hides button while disabled.
	TextLabel			= CONTROLBAR:GenericReviveHero
;ButtonImage		= ***Filled in automatically! No need to specify a button image. 
	ButtonBorderType	= BUILD 
	DescriptLabel		= CONTROLBAR:ToolTipGenericReviveHero
	InPalantir			= No
	Radial				= Yes
End

Ring hero and CAH command buttons:


CommandButton Command_RingHeroReviveSlota
	Command				= REVIVE
	Options				= HIDE_WHILE_DISABLED CANCELABLE NEED_UPGRADE	;Hides button while disabled.
	NeededUpgrade		= Upgrade_PreventTreebeardFromBeingBuiltatfortress
	TextLabel			= CONTROLBAR:GenericReviveHero
;ButtonImage		= ***Filled in automatically! No need to specify a button image. 
	ButtonBorderType	= BUILD 
	DescriptLabel		= CONTROLBAR:ToolTipGenericReviveHero
	InPalantir			= No
	Radial				= Yes
End

CommandButton Command_CreateAHeroReviveSlota
	Command				= REVIVE
	Options				=  CANCELABLE NEED_UPGRADE HIDE_WHILE_DISABLED	;Hides button while disabled.
	NeededUpgrade		= Upgrade_PreventTreebeardFromBeingBuiltatfortress
	TextLabel			= CONTROLBAR:GenericReviveHero
;ButtonImage		= ***Filled in automatically! No need to specify a button image. 
	ButtonBorderType	= BUILD 
	DescriptLabel		= CONTROLBAR:ToolTipGenericReviveHero
	InPalantir			= No
Radial				= Yes
End

Commandset:

At the moment the entmoot command set is set so that there is a sub menu for the ent unit. I have tried putting the heroes in the sub menu and the ent unit in the main menu but that did not solve the problem. The problem also remains if the heroes and unit are all in the same menu.

CommandSet EntsMootCommandSet

InitialVisible = 13



	1   	= Command_SelectRevivablesElvenFortress
	2	= Command_RingHeroReviveSlota
	3	= Command_CreateAHeroReviveSlota
	4	= Command_TreebeardReviveSlot
	5	= Command_GenericReviveSlot1a		//Revives any hero. Use Slot1-Slot8 and keep them UNIQUE within the same commandset! 
	6	= Command_GenericReviveSlot2a	
	7	= Command_GenericReviveSlot3a	
	8	= Command_GenericReviveSlot4a	
	9	= Command_GenericReviveSlot5a	
	10	= Command_GenericReviveSlot6a	
	11	= Command_GenericReviveSlot7a
	13	= Command_Sell
	//Main Menu

	  14 	= Command_ConstructEntGeneric
	15	= Command_RadialBack
	  
End


Does anyone know what might be wrong?
-----------------------------------------------------------------------------------------------------------------

Question 2: A Problem with the Revive Animations


My problem is that when Treebeard is moving up-wards out of the ent moot he now walks forwards like other heroes do when they come out the fortress door. Accordingly Treebeard walks out the ent moot while he is still partly underground. I think this may be because I used Gandalf revive code for Treebeard.

The problem is I am not sure which parts of the revive code to remove to get rid of this walking forward animation while retaining the code that allow Treebeards's to keep the experience he earned before he died. (I have already successfully modified Treebeard so that he gains experience and at the moment it is retained when he dies.)

Treebeard so that Heres my code:

Body = RespawnBody ModuleTag_RespawnBody
		CheerRadius 			= EMOTION_CHEER_RADIUS
		MaxHealth		 		= GANDALF_THE_WHITE_HEALTH;BALANCE Eomer Health
		PermanentlyKilledByFilter	= NONE	;Who kills me permanently?
   		DodgePercent			  = HERO_DODGE_PERCENT
	End
	Behavior = RespawnUpdate ModuleTag_RespawnUpdate
		DeathAnim				= DYING;STUNNED		;Model condition to play when killed-to-respawn
		AutoRespawnAtObjectFilter	= NONE +CASTLE_KEEP	;Respawn at this location -- and at it's exit production point if possible.
		ButtonImage				= HITreebeard
		
	;RespawnEntries determine the ruleset for how a character can be revived. Some units may automatically respawn, others
	;may require a specific revive action performed on him. You can specify different values for each level... or use Level:Any
		RespawnRules =			AutoSpawn:No	Cost:1500		Time:90000		Health:100%	;DEFAULT VALUES

	End

Again can anyone help to fix this problem?
-----------------------------------------------------------------------------------------------------------------

Question 3: A problem changing the name label for my unit


The problem is that one of the labels for my Icemen horde is incorrect I am not sure how to change it.


This problem is best illustrated with images:


Posted Image

Image 1


Posted Image

Image 2

When I move the cursor over the plantir and I have selected my Icemen horde the label is correct. (Image 1)
But when i move the cursor over the actual horde I get the wrong text. (Image 2) This is the label I need to change.


I am not sure what I need to change in the object code so that the second label uses the correct string.

Heres the relevant code:

ChildObject Icemen IsengardWildmanAxeHorde 


; ***DESIGN parameters ***
	Side 		= Men
	EditorSorting 	= UNIT
	ThreatLevel 	= 1.0
	ThingClass 	= HORDE_UNIT
	CommandPoints 	= 4
	
DisplayName = OBJECT:Icemen
	DisplayNameStrategic 	= OBJECT:Icemen
	DescriptionStrategic 	= OBJECT:Icemen

THANK YOU for Helping! :shiftee2:

Problems getting units to float

19 July 2008 - 05:19 PM

I was wandering how I would get a non boat unit to float on water. The unit needs to be able to walk on land and float on water. So far I have code which allows the unit to walk on land and water. The problem is that I can't get the unit to be partially submerged in the water so that it looks like they are floating in the water . At the moment bears' feet walk on the surface of the water rather than move under the water. Here's my code:


Object code:

LocomotorSet // Used by this special power
	Locomotor = TransportShipLocomotorForUnitInteraction
	Condition = SET_MOUNTED 
	Speed	 = 50
End

The locomoter:

Locomotor TransportShipLocomotorForUnitInteraction
	Surfaces						= WATER DEEP_WATER GROUND
	Speed							= 100%; in dist/sec
	SpeedDamaged					= 50%; in dist/sec
	SlowTurnRadius					= 50.0;  From a standing starts, 0 foot radius.
	FastTurnRadius					= 70.0; Once the ship gets moving, still uses a 30 foot 

radius to turn.
	TurnTime						= 10000; 10 seconds to do a 360 degree turn. 
	TurnTimeDamaged					= 10500
	TurnThreshold					= 5
	Acceleration					= 6000; 6 seconds to accelerate to full speed.
	Braking							= 6000; 6 seconds to brake from full speed.
	MinTurnSpeed					= 10%; in dist/sec
	ZAxisBehavior					= SEA_LEVEL
	Appearance						= TWO_LEGS
 

	AccelerationPitchLimit		  = 10; Angle (degrees) limit how far chassis will lift or roll from 

acceleration.
	BounceAmount					= 0	; simulates hitting random rocks.  0==smooth pavement, 200 = 

bumpy.
	PitchStiffness				  = 0.8; stiffness of the "springs" in the suspension forward & back.
	RollStiffness				   = 0.2; stiffness of the "springs" in the suspension side to side.
	PitchDamping					= 1.0; How fast it damps.  0=perfect spring, bounces forever.  1=glued to 

terrain.
	RollDamping					 = 0.5; How fast it damps.  0=perfect spring, bounces forever.  1=glued to 

terrain.
	ForwardAccelerationPitchFactor  = 0.0; How much acceleration will cause the front to lift, or dip for 

stops.
	LateralAccelerationRollFactor   = 0.1; How much cornering will cause the chassis to roll.
	
	ElevatorCorrectionDegree	= 0.03	; roll adjustment magnitude for waves.
	ElevatorCorrectionRate		= 0.016	; speed of roll.  
	AeleronCorrectionDegree		= 0.025	; pitch adjustment for waves.
	AeleronCorrectionRate		= 0.021

	RiverModifier					= 50%; half speed if moving in a river.

	UseTerrainSmoothing			 = No; Smooth out the normals by multisampling (water is always smooth. 

jba.)
									  
	HasSuspension				   = No; Calculate 4 wheel independent suspension info.
	CanMoveBackwards				= No; Can move backwards.

End

I have looked through the object code for the boats in the game but there doesn't seem to be any code there which could be making EA's boats float.

Can anyone help to solve this problem Thanks!
:crazed: