So ich habe wieder eine Frage, bei der ihr mir hoffentlich helfen könnt.
Ich möchte die GondorMauer am Anfang des Gefechtes hiden, so dass man ein Upgrade kaufen muss, um die Mauer zu bekommen.
Ich habe die Codes bereits erstellt, doch funktioniert es so nicht. Eventuell hat jemand eine Idee, Ratschlag oder einen ganz anderen Ansatz.
Hier mal mein Behavior, welche ich in jedes Festungs-element eingefügt habe.Hier mal von der Gondor Festungsmauer
;----------------------------------------------------------------------------------------------
Object GondorCastleWall
SelectPortrait = BPCastleWall
Draw = W3DScriptedModelDraw Draw_Wall
WallBoundsMesh = P1
DefaultModelConditionState
Model = GBCASTWALL
End
ModelConditionState = WORLD_BUILDER
Model = GBCASTWALLW
End
ModelConditionState = BASE_BUILD
Model = GBCASTWALL_A
End
AnimationState = BASE_BUILD
StateName = STATE_None
Animation
AnimationName = GBCASTWALL_A.GBCASTWALL_A
AnimationMode = ONCE
AnimationSpeedFactorRange = 2.0 2.5 ; keep range wide to avoid lockstep anims
End
End
ModelConditionState = JUST_BUILT
Model = GBCASTWALL_A
End
AnimationState = JUST_BUILT
StateName = STATE_None
Animation
AnimationName = GBCASTWALL_A.GBCASTWALL_A
AnimationMode = MANUAL
End
Flags = START_FRAME_FIRST
End
ModelConditionState = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
Model = GBCASTWALL_UA
End
AnimationState = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
Animation
AnimationName = GBCASTWALL_UA.GBCASTWALL_UA
AnimationMode = MANUAL
End
StateName = STATE_None
Flags = START_FRAME_FIRST
End
ModelConditionState = ACTIVELY_BEING_CONSTRUCTED
Model = GBCASTWALL_A
End
AnimationState = ACTIVELY_BEING_CONSTRUCTED
Animation
AnimationName = GBCASTWALL_A.GBCASTWALL_A
AnimationMode = MANUAL
End
StateName = STATE_None
Flags = START_FRAME_FIRST
End
ModelConditionState = DAMAGED UPGRADE_NUMENOR_STONEWORK
Model = GBCASTWALL_UD1
End
ModelConditionState = DAMAGED
Model = GBCASTWALL_D1
End
AnimationState = DAMAGED
StateName = STATE_None
End
TransitionState = TRANS_U_IntoReallyDamaged
EnteringStateFX = FX_BuildingReallyDamaged
Animation = D2
AnimationName = GBCASTWALL_UD2.GBCASTWALL_UD2
AnimationMode = ONCE
AnimationBlendTime = 0
End
End
ModelConditionState = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
Model = GBCASTWALL_UD2
End
AnimationState = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
StateName = STATE_ReallyDamaged
Flags = START_FRAME_LAST
Animation = ReallyDamagedanimation
AnimationName = GBCASTWALL_UD2.GBCASTWALL_UD2
AnimationMode = MANUAL
AnimationBlendTime = 0
End
BeginScript
Prev = CurDrawablePrevAnimationState()
if Prev == "STATE_None" or Prev == "STATE_Rubble"
then
CurDrawableSetTransitionAnimState("TRANS_U_IntoReallyDamaged")
end
EndScript
End
ModelConditionState = REALLYDAMAGED
Model = GBCASTWALL_D2
End
AnimationState = REALLYDAMAGED
StateName = STATE_ReallyDamaged
Animation = ReallyDamagedanimation
AnimationName = GBCASTWALL_D2.GBCASTWALL_D2
AnimationMode = ONCE
End
End
TransitionState = TRANS_U_IntoRubble
Animation = D3
AnimationName = GBCASTWALL_UD3.GBCASTWALL_UD3
AnimationMode = ONCE
AnimationBlendTime = 0
End
End
ModelConditionState = RUBBLE UPGRADE_NUMENOR_STONEWORK
Model = GBCASTWALL_UD3
ParticleSysBone NONE BuildingChunkBitsTrail
ParticleSysBone NONE ExplosiveMineFire02
End
AnimationState = RUBBLE UPGRADE_NUMENOR_STONEWORK
StateName = STATE_Rubble
Flags = START_FRAME_LAST
Animation = Death
AnimationName = GBCASTWALL_UD3.GBCASTWALL_UD3
AnimationMode = MANUAL
AnimationBlendTime = 0
End
BeginScript
Prev = CurDrawablePrevAnimationState()
if Prev == "STATE_ReallyDamaged" or Prev == "STATE_None" or Prev == "TRANS_U_IntoReallyDamaged"
then
CurDrawableSetTransitionAnimState("TRANS_U_IntoRubble")
end
EndScript
End
ModelConditionState = RUBBLE
Model = GBCASTWALL_D3
ParticleSysBone NONE BuildingChunkBitsTrail
ParticleSysBone NONE ExplosiveMineFire02
End
AnimationState = RUBBLE
Animation = Death
AnimationName = GBCASTWALL_D3.GBCASTWALL_D3
AnimationMode = ONCE
End
StateName = STATE_Rubble
EnteringStateFX = FX_WallDie
End
ModelConditionState = UPGRADE_NUMENOR_STONEWORK
Model = GBCASTWALL_U
End
AnimationState = UPGRADE_NUMENOR_STONEWORK
EnteringStateFX = GenericBuildingUpgrade
End
ModelConditionState = POST_RUBBLE
Model = None
End
ModelConditionState = POST_COLLAPSE
Model = None
End
End
VoiceSelect = Gui_PlotSelect
SoundOnDamaged = BuildingLightDamageStone
SoundOnReallyDamaged = BuildingHeavyDamageStone
ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
MaxUpdateRangeCap = 800
AnimationSound = Sound:WallDie Animation:GBCASTWALL_UD3.GBCASTWALL_UD3 Frames:0
End
DisplayName = OBJECT:GondorCastleWall
EditorSorting = STRUCTURE
Side = Gondor
BuildTime = CASTLE_WALL_REBUILD_TIME
BuildCost = CASTLE_WALL_REBUILD_COST
ShroudClearingRange = 160
ArmorSet
Conditions = None
Armor = GondorCastleWall
DamageFX = MinasWallADamageFX
End
KindOf = STRUCTURE IMMOBILE WALK_ON_TOP_OF_WALL CHUNK_VENDOR SELECTABLE NOT_AUTOACQUIRABLE
RadarPriority = STRUCTURE
VisionRange = GONDOR_ARCHER_VISION_RANGE
KeepSelectableWhenDead = Yes
CommandSet = GenericSelfRepairCommandSet
Body = ActiveBody ModuleTag_02
MaxHealth = GONDOR_CASTLE_WALL_HEALTH
GrabObject = EntThrownBuildingRock
GrabFX = FX_WallGrab
GrabDamage = 490
GrabOffset = X:16 Y:0
End
Behavior = BuildingBehavior BuildingModuleTag
NightWindowName = WINDOW_N01
End
Behavior = GettingBuiltBehavior ModuleTag_GettingBuilt
SelfBuildingLoop = BuildingConstructionLoop
SelfRepairFromDamageLoop = NoSound
SelfRepairFromRubbleLoop = BuildingConstructionLoop
SpawnTimer = -1.0
RebuildTimeSeconds = CASTLE_WALL_REBUILD_TIME
End
Behavior = SiegeDockingBehavior ModuleTag_SiegeDocking
End
Behavior = KeepObjectDie ModuleTag_IWantRubble
End
Behavior = CastleMemberBehavior ModuleTag_CMB
CountsForEvaCastleBreached = Yes
End
Behavior = AttributeModifierAuraUpdate ModuleTag_WallBonus
StartsActive = Yes ;If no, requires upgrade to turn on.
BonusName = WallBonus
RefreshDelay = 2000
ObjectFilter = ALL -MACHINE
End
Behavior = SubObjectsUpgrade ModuleTag_HideAll
TriggeredBy = Upgrade_GondorFaction
HideSubObjects = GondorCastleWall
End
Behavior = CastleUpgrade ModuleTag_TriggedModule
TriggeredBy = Upgrade_GoodFactionFestung
Upgrade = Upgrade_GoodFactionFestung
End
Behavior = SubObjectsUpgrade ModuleTag_ShowWalls
TriggeredBy = Upgrade_GoodFactionFestung
ShowSubObjects = GondorCastleWall
End
Behavior = AttributeModifierUpgrade ModuleTag_Reinforced
TriggeredBy = Upgrade_NumenorStonework
AttributeModifier = NumenorStonework_Bonus
CustomAnimAndDuration = AnimState:UPGRADE_NUMENOR_STONEWORK AnimTime:0
End
Behavior = FireWeaponWhenDeadBehavior FireDeadTag1
DeathTypes = ALL
StartsActive = Yes
ActiveDuringConstruction = Yes
DeathWeapon = CastleWallDeath
End
Behavior = FireWeaponWhenDeadBehavior FireDeadTag2
DeathTypes = ALL
StartsActive = Yes
ActiveDuringConstruction = Yes
DeathWeapon = StandardWallDeath
End
Geometry = BOX
GeometryMajorRadius = 22.0
GeometryMinorRadius = 90.0
GeometryHeight = 53.0
GeometryOffset = X:-3 Y:0 Z:0
AdditionalGeometry = CYLINDER
GeometryMajorRadius = 26.0
GeometryMinorRadius = 0
GeometryHeight = 53.0
GeometryOffset = X:-10 Y:-80 Z:0
AdditionalGeometry = CYLINDER
GeometryMajorRadius = 26.0
GeometryMinorRadius = 0
GeometryHeight = 53.0
GeometryOffset = X:-10 Y:80 Z:0
AdditionalGeometry = BOX
GeometryMajorRadius = 18.0
GeometryMinorRadius = 1.0
GeometryHeight = 53.0
GeometryOffset = X:-10 Y: 98 Z:0
GeometryName = Bookend
AdditionalGeometry = BOX
GeometryMajorRadius = 18.0
GeometryMinorRadius = 1.0
GeometryHeight = 53.0
GeometryOffset = X:-10 Y:-98 Z:0
GeometryName = Bookend
GeometryContactPoint = X:-29.397 Y:0.326 Z:108.421 Swoop
GeometryContactPoint = X: 40 Y:-70 Z:0 Grab
GeometryContactPoint = X:-40 Y:-60 Z:0 Grab
GeometryContactPoint = X: 23 Y:-40 Z:0 Grab
GeometryContactPoint = X:-18 Y:-40 Z:0 Grab
GeometryContactPoint = X: 23 Y: 40 Z:0 Grab
GeometryContactPoint = X:-40 Y: 40 Z:0 Grab
GeometryContactPoint = X: 40 Y: 60 Z:0 Grab
GeometryContactPoint = X:-40 Y: 70 Z:0 Grab
GeometryIsSmall = No
GeometryRotationAnchorOffset = X:375.0 Y:0.0
Shadow = SHADOW_VOLUME
End
Diesen Code habe ich genau überall eingefügt:
Behavior = SubObjectsUpgrade ModuleTag_HideAll
TriggeredBy = Upgrade_GondorFaction
HideSubObjects = GondorCastleWall
End
Behavior = CastleUpgrade ModuleTag_TriggedModule
TriggeredBy = Upgrade_GoodFactionFestung
Upgrade = Upgrade_GoodFactionFestung
End
Behavior = SubObjectsUpgrade ModuleTag_ShowWalls
TriggeredBy = Upgrade_GoodFactionFestung
ShowSubObjects = GondorCastleWall
End
Dann das Upgrade:
Upgrade Upgrade_GoodFactionFestung
DisplayName = UPGRADE:GoodFactionFestung
Type = PLAYER
BuildTime = 30
BuildCost = 2500
End
und der CommandButton:
CommandButton Command_UpgradeLGoodFactionFestung
Command = OBJECT_UPGRADE
Upgrade = Upgrade_GoodFactionFestung
Options = CANCELABLE NEED_UPGRADE
ButtonImage = BRWall
ButtonBorderType = UPGRADE
Radial = Yes
InPalantir = Yes
TextLabel = CONTROLBAR:GoodFactionFestung
DescriptLabel = CONTROLBAR:ToolTipGoodFactionFestung
End
Hoffentlich kann mir jemand von euch weiterhelfen, da ich die Idee nicht aufgeben will