ben
  • ben
  • 64.25% (Friendly)
  • Private Topic Starter
15 years ago
I have been trying to add the united nations soldier to the american barracks with no luck these are the code i have added

FactionUnit:

Object AmericaInfantryUNSoldier

; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01

OkToChangeModelColor = Yes

DefaultConditionState
Model = CIUNSL_SKN
IdleAnimation = CIUNSL_SKL.CIUNSL_STA 0 21
IdleAnimation = CIUNSL_SKL.CIUNSL_ID1
IdleAnimation = CIUNSL_SKL.CIUNSL_ID2
AnimationMode = ONCE
WeaponFireFXBone = PRIMARY Muzzle
WeaponMuzzleFlash = PRIMARY MuzzleFX
TransitionKey = TRANS_Stand
End

ConditionState = FIRING_A
Animation = CIUNSL_SKL.CIUNSL_ATA1_LP
AnimationMode = LOOP
TransitionKey = TRANS_FiringA
End
AliasConditionState = BETWEEN_FIRING_SHOTS_A
AliasConditionState = RELOADING_A

TransitionState = TRANS_Stand TRANS_FiringA
Animation = CIUNSL_SKL.CIUNSL_ATA1_ST
AnimationMode = ONCE
AnimationSpeedFactorRange = 4 4
End

TransitionState = TRANS_FiringA TRANS_Stand
Animation = CIUNSL_SKL.CIUNSL_ATA1_ED
AnimationMode = ONCE
AnimationSpeedFactorRange = 4 4
End

; these aliases handle the attack-move case.
AliasConditionState = MOVING FIRING_A
AliasConditionState = MOVING BETWEEN_FIRING_SHOTS_A
AliasConditionState = MOVING RELOADING_A

ConditionState = FREEFALL
Animation = CIUNSL_SKL.CIUNSL_PFL
AnimationMode = LOOP
TransitionKey = TRANS_Falling
End

ConditionState = PARACHUTING
Animation = CIUNSL_SKL.CIUNSL_PHG
AnimationMode = LOOP
TransitionKey = TRANS_Chute
End
AliasConditionState = PARACHUTING DYING

ConditionState = MOVING
Animation = CIUNSL_SKL.CIUNSL_RNA
AnimationMode = LOOP
Flags = RANDOMSTART
TransitionKey = None
End

ConditionState = DYING
Animation = CIUNSL_SKL.CIUNSL_DTA
Animation = CIUNSL_SKL.CIUNSL_DTB
AnimationMode = ONCE
TransitionKey = TRANS_Dying
End

TransitionState = TRANS_Dying TRANS_Flailing
Animation = CIUNSL_SKL.CIUNSL_ADTA1
AnimationMode = ONCE
End

ConditionState = DYING EXPLODED_FLAILING
Animation = CIUNSL_SKL.CIUNSL_ADTA2
AnimationMode = LOOP
TransitionKey = TRANS_Flailing
End

ConditionState = DYING EXPLODED_BOUNCING
Animation = CIUNSL_SKL.CIUNSL_ADTA3
AnimationMode = ONCE
TransitionKey = None
End
AliasConditionState = DYING SPLATTED

TransitionState = TRANS_Falling TRANS_Chute
Animation = CIUNSL_SKL.CIUNSL_POP
AnimationMode = ONCE
End

TransitionState = TRANS_Chute TRANS_Stand
Animation = CIUNSL_SKL.CIUNSL_PTD
AnimationMode = ONCE
End

End

; ***DESIGN parameters ***
Side = America
EditorSorting = INFANTRY
TransportSlotCount = 1

DisplayName = OBJECT:UNSoldier
EditorSorting = INFANTRY
TransportSlotCount = 1 ;how many "slots" we take in a transport (0 == not transportable)

WeaponSet
Conditions = None
Weapon = PRIMARY RangerAdvancedCombatRifle
End
ArmorSet
Conditions = None
Armor = HumanArmor
DamageFX = InfantryDamageFX
End

VisionRange = 100
ShroudClearingRange = 300
Prerequisites
Object = AmericaBarracks
End
BuildCost = 500
BuildTime = 10.0 ;in seconds

ExperienceValue = 20 20 40 60 ;Experience point value at each level
ExperienceRequired = 0 40 60 120 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experience
CrushableLevel = 0 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = AmericaInfantryUNSoldierCommandSet

; *** AUDIO Parameters ***
VoiceSelect = RangerVoiceSelect
voiceGuard = RangerVoiceSelect
VoiceMove = RangerVoiceMove
VoiceAttack = RangerVoiceAttack
VoiceFear = RangerVoiceFear
VoiceTaskComplete = RangerVoiceCaptureComplete
SoundDie = RangerVoiceDie
SoundDieFire = DieByFireUSA
SoundDieToxin = DieByToxinUSA

UnitSpecificSounds
VoiceEnter = RangerVoiceMove
VoiceEnterHostile = RangerVoiceMove
VoiceGarrison = RangerVoiceGarrison
VoiceCreate = RangerVoiceCreate
VoiceSubdue = RangerVoiceSubdue
VoiceClearBuilding = RangerVoiceClearBuilding
VoiceGetHealed = RangerVoiceMove
End

; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD SELECTABLE CAN_ATTACK CAN_CAST_REFLECTIONS INFANTRY

Body = ActiveBody ModuleTag_02
MaxHealth = 125.0
InitialHealth = 125.0
End

Behavior = AIUpdateInterface ModuleTag_03
AutoAcquireEnemiesWhenIdle = Yes
End
Locomotor = SET_NORMAL BasicHumanLocomotor

Behavior = PhysicsBehavior ModuleTag_04
Mass = 5.0
End
Behavior = ProductionUpdate ModuleTag_05
; nothing
End

Behavior = SquishCollide ModuleTag_07
;nothing
End


; --- begin Death modules ---
Behavior = SlowDeathBehavior ModuleTag_Death01
DeathTypes = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA
SinkDelay = 3000
SinkRate = 0.5 ; in Dist/Sec
DestructionDelay = 8000
FX = INITIAL FX_GIDie
End
Behavior = SlowDeathBehavior ModuleTag_Death02
DeathTypes = NONE +CRUSHED +SPLATTED
SinkDelay = 3000
SinkRate = 0.5 ; in Dist/Sec
DestructionDelay = 8000
FX = INITIAL FX_GIDieCrushed
End
Behavior = SlowDeathBehavior ModuleTag_Death03
DeathTypes = NONE +EXPLODED
SinkDelay = 3000
SinkRate = 0.5 ; in Dist/Sec
DestructionDelay = 8000
FX = INITIAL FX_GIDie
FlingForce = 8
FlingForceVariance = 3
FlingPitch = 60
FlingPitchVariance = 10
End
Behavior = SlowDeathBehavior ModuleTag_Death04
DeathTypes = NONE +BURNED
DestructionDelay = 0
FX = INITIAL FX_GIDie
OCL = INITIAL OCL_FlamingInfantry
End
Behavior = SlowDeathBehavior ModuleTag_Death05
DeathTypes = NONE +POISONED
DestructionDelay = 0
FX = INITIAL FX_GIDie
OCL = INITIAL OCL_ToxicInfantry
End
Behavior = SlowDeathBehavior ModuleTag_Death06
DeathTypes = NONE +POISONED_BETA
DestructionDelay = 0
FX = INITIAL FX_GIDie
OCL = INITIAL OCL_ToxicInfantryBeta
End

; --- end Death modules ---

Behavior = PoisonedBehavior ModuleTag_12
PoisonDamageInterval = 100 ; Every this many msec I will retake the poison damage dealt me...
PoisonDuration = 3000 ; ... for this long after last hit by poison damage
End

Geometry = CYLINDER
GeometryMajorRadius = 10.0
GeometryMinorRadius = 10.0
GeometryHeight = 13.0
GeometryIsSmall = Yes
Shadow = SHADOW_DECAL
ShadowSizeX = 14;
ShadowSizeY = 14;
ShadowTexture = ShadowI;
BuildCompletion = APPEARS_AT_RALLY_POINT

End

CommandSet:

5 = Command_ConstructAmericaInfantryUNsoldier

CommandSet AmericaInfantryUNSoldier
1 = Command_AttackMove
2 = Command_Guard
3 = Command_Stop
End
Sponsor
Annihilationzh
15 years ago
Where's the commandbutton entry?

I'm not going to look it over thoroughly until I get a better idea of what you've done.

BTW, your commandsets don't match.

You have:
CommandSet = AmericaInfantryUNSoldierCommandSet

and

CommandSet AmericaInfantryUNSoldier
1 = Command_AttackMove
2 = Command_Guard
3 = Command_Stop
End

AmericaInfantryUNSoldierCommandSet =/= AmericaInfantryUNSoldier

They need to be the same.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
ben
  • ben
  • 64.25% (Friendly)
  • Private Topic Starter
15 years ago
Thanks for pointing that out fixed the command set error
added a command button to him also what i have done is i have created a command set for him copied the ranger's file in faction unit edited it to the UN soldier

Command button

CommandButton Command_ConstructAmericaInfantryUNsoldier
Command = UNIT_BUILD
Object = AmericaInfantryUNsoldier
TextLabel = CONTROLBAR:ConstructAmericaInfantryRanger
ButtonImage = SARanger
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipUSABuildRanger

BTW i'm going to test if it works


Update*

Reason Error parsing INI file 'Data\INI\CommandButton.ini' (Line: 'CommandButton Command_ConstructAmericaInfantryUNSoldier ')
it's almost like it does not exist but it states in my command set Command_ConstructAmericaInfantryUNSoldier
Annihilationzh
15 years ago
Either use a capital S on soldier, or don't. You switch between the two, and the game is case sensitive, so it'll crash.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
ben
  • ben
  • 64.25% (Friendly)
  • Private Topic Starter
15 years ago
Thanks for advice i change ALL of the s's in soldier to S but it still crashed with the same reason well i give up this is big step in modding and first attempt in adding a new unit for me i guess i'll have to just play without him 😞 if i got it working i was gotting to add the defector ability to him i have an idea on how to add him maybe i have made a multiplayer map and i try placing unsoldiers and make a script saying if player enters area team converts to thisplayer
Annihilationzh
15 years ago
Giving up?

I failed to notice earlier, but you missed the end on the commandbutton, which is most likely the cause of your crash.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
ben
  • ben
  • 64.25% (Friendly)
  • Private Topic Starter
15 years ago
Bingo! thats why it crashed but it didnt let me buy him it just had a grey colour over it
Annihilationzh
15 years ago
Odd.

These are the usual causes of that bug:
1) Wrong prerequisites.
2) Non-existent prerequisites (usually causes the game to crash when you highlight it).
3) Lack of a production module in the building.

I have a weird feeling that there is another common cause that I'm forgetting.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
ben
  • ben
  • 64.25% (Friendly)
  • Private Topic Starter
15 years ago
1.i'm postive my Prerequisites are correct
2.they exist i went to the ranger's file and copied the AmericaBarracks line.
3.i'm not sure about this one Where do i have to add this?