1) Scatter weapons
I'm trying to make a weapon that fires a pile of rocks, that should scatter off in random directions around the target location. I'm not even sure where to start . Tried using a weaponset with several damagenuggets with their own projectiles, but obviously that won't work as the scatter looks like it's calculated before the projectiles spawn, so all of them hit the same place. How should I go about this?
2) Shooting over walls
I'm not sure if anyone has much experience with this area, but still, I'm having an issue with castle walls and units being able to shoot through them (from the outside, hitting buildings inside it). I have a few ideas about how to fix this, but I thought I'd see if anybody has had this problem before. Frankly I think it's because the wall is too low (around 3 metres high) and it's not triggering the collision check. I'll post the code, nothing particularly special about it though, just the Gondor Castle pretty much.
SelectPortrait = BPDwarf_CampWall
Draw = W3DScriptedModelDraw Draw_Wall
OkToChangeModelColor = Yes
WallBoundsMesh = WALLPLANE
DefaultModelConditionState
Model = DBCAMPWALL_SKN
End
ModelConditionState = WORLD_BUILDER
Model = DBCAMPWALL_SKN
End
ModelConditionState = BASE_BUILD
Model = DBCAMPWALL_BLD
End
IdleAnimationState
StateName = STATE_None
End
AnimationState = BASE_BUILD
StateName = STATE_None
Animation
AnimationName = DBCAMPWALL_BLD.DBCAMPWALL_BLD
AnimationMode = ONCE
AnimationSpeedFactorRange = 5 6.5; keep range wide to avoid lockstep anims
End
End
ModelConditionState = JUST_BUILT
Model = DBCAMPWALL_bld
End
AnimationState = JUST_BUILT
StateName = STATE_None
Animation
AnimationName = DBCAMPWALL_BLD.DBCAMPWALL_BLD
AnimationMode = MANUAL
End
Flags = START_FRAME_FIRST
End
ModelConditionState = ACTIVELY_BEING_CONSTRUCTED
Model = DBCAMPWALL_BLD
End
AnimationState = ACTIVELY_BEING_CONSTRUCTED
Animation
AnimationName = DBCAMPWALL_BLD.DBCAMPWALL_BLD
AnimationMode = MANUAL
End
StateName = STATE_None
Flags = START_FRAME_FIRST
End
; DAMAGED ----------------------------------------------------------------------------------------------------------------
ModelConditionState = DAMAGED
Model = DBCAMPWALL_D1
End
AnimationState = DAMAGED
StateName = STATE_None
; EnteringStateFX = FX_MinWallATransitionDamaged
End
; REALLYDAMAGED ----------------------------------------------------------------------------------------------------------------
TransitionState = TRANS_U_IntoReallyDamaged
EnteringStateFX = FX_BuildingReallyDamaged
Animation = D2
AnimationName = DBCAMPWALL_D2.DBCAMPWALL_D2
AnimationMode = ONCE
AnimationBlendTime = 0
End
End
ModelConditionState = REALLYDAMAGED
Model = DBCAMPWALL_D2
End
AnimationState = REALLYDAMAGED
StateName = STATE_ReallyDamaged
Animation = ReallyDamagedanimation
AnimationName = DBCAMPWALL_D2.DBCAMPWALL_D2
AnimationMode = ONCE
End
End
; RUBBLE ----------------------------------------------------------------------------------------------------------------
ModelConditionState = RUBBLE
Model = DBCAMPWALL_D3
ParticleSysBone NONE BuildingChunkBitsTrail
ParticleSysBone NONE ExplosiveMineFire02
End
AnimationState = RUBBLE
Animation = Death
AnimationName = DBCAMPWALL_D3.DBCAMPWALL_D3
AnimationMode = ONCE
End
StateName = STATE_Rubble
EnteringStateFX = FX_WallDie
End
ModelConditionState = POST_RUBBLE
Model = None
End
ModelConditionState = POST_COLLAPSE
Model = None
End
End
;----------------------- AUDIO -------------------------
VoiceSelect = Gui_PlotSelect
SoundOnDamaged = BuildingLightDamageStone
SoundOnReallyDamaged = BuildingHeavyDamageStone
ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
MaxUpdateRangeCap = 800
AnimationSound = Sound:WallDie Animation:GBCASTWALL_UD3.GBCASTWALL_UD3 Frames:0
End
; ***DESIGN parameters ***
DisplayName = OBJECT:DwarfCampWall
EditorSorting = STRUCTURE
Side = Dwarves
BuildTime = TDH_DWARVES_CAMP_WALL_REBUILD_TIME
BuildCost = TDH_DWARVES_CAMP_WALL_REBUILD_COST
ShroudClearingRange = 160
ArmorSet
Conditions = None
Armor = DwarfCampWall
DamageFX = MinasWallADamageFX
End
; *** ENGINEERING Parameters ***
KindOf = STRUCTURE IMMOBILE WALK_ON_TOP_OF_WALL CHUNK_VENDOR SELECTABLE NOT_AUTOACQUIRABLE;;;should this get autoacquired, or not? NO! or attack move will fail to enter the gate!
RadarPriority = STRUCTURE
VisionRange = TDH_DWARVES_CAMP_VISION_RANGE
KeepSelectableWhenDead = Yes
CommandSet = GenericSelfRepairCommandSet
Body = ActiveBody ModuleTag_02
MaxHealth = TDH_DWARVES_CAMP_WALL_HEALTH
GrabObject = EntThrownBuildingRock
GrabFX = FX_WallGrab
GrabDamage = 490
GrabOffset = X:16 Y:0
End
Behavior = BuildingBehavior BuildingModuleTag
NightWindowName = WINDOW_N01
; FireWindowName = WINDOW_F01
; GlowWindowName = WINDOW_G01
; FireName = FIRE01
End
Behavior = GettingBuiltBehavior ModuleTag_GettingBuilt
SelfBuildingLoop = BuildingConstructionLoop; Only played if we DON'T spawn a worker
SelfRepairFromDamageLoop = NoSound ; This doesn't cause an animation, so don't bother playing a sound
SelfRepairFromRubbleLoop = BuildingConstructionLoop
SpawnTimer = -1.0; Negative means no 'autoheal'
RebuildTimeSeconds = TDH_DWARVES_CAMP_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
;Range = 120 ; Range is overridden to affect people on us since we are a wall
;TargetEnemy = Yes; Alliances are ignored to affect people on us since we are a wall
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 = 120.0
GeometryHeight = 10
GeometryOffset = X:17 Y:0 Z:0
;AdditionalGeometry = CYLINDER
;GeometryMajorRadius = 26.0
;GeometryMinorRadius = 0
;GeometryHeight = 53.0
;GeometryOffset = X:0 Y:0 Z:0
;AdditionalGeometry = CYLINDER
;GeometryMajorRadius = 26.0
;GeometryMinorRadius = 0
;GeometryHeight = 53.0
;GeometryOffset = X:0 Y:0 Z:0
AdditionalGeometry = BOX
GeometryMajorRadius = 20.0
GeometryMinorRadius = 12.0
GeometryHeight = 10.0
GeometryOffset = X:18 Y: 100 Z:0
GeometryName = Bookend
AdditionalGeometry = BOX
GeometryMajorRadius = 18.0
GeometryMinorRadius = 12.0
GeometryHeight = 20.0
GeometryOffset = X:18 Y:-106 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:0.0 Y:0.0
Shadow = SHADOW_VOLUME
End