IPB

Welcome Guest ( Log In | Register )

Battleplans propagated through a unit., It's about time again.
GearsGoAwryMan
post 10 Dec 2017, 4:23
Post #1



Group Icon

Group: Members
Posts: 53
Joined: 17 July 2015
Member No.: 11785



Hello again.

I've been looking over the possibility of making a officer type unit that projects weapon bonuses in a field, and instead of using frenzy, i wanted to see if i could make the strategy center obsolete by having a unit project it's bonuses. Therefore, i made a rather useless infantry unit and gave him the usual weaponbonusupdate tag for each different version of the battleplan. i then added some zeroes behind the values in gamedata to make the results more clear, and checked it.

However, the results have been weird, and i cannot explain or figure out why it acts as it does.

The buff seems to turn the models bright red (ala frenzy), but the units affected become unable to fire after firing one shot. this seems affected by the rate at which the bonus reapplies somehow, as a bit of fiddling can sometimes get them to shoot a bit, but it's overall a mess. It doesn't have anything to do with how i project the bonuses, since using a seperate object to project the bonuses does virtually the same. I have not tried having seperate objects project seperate bonuses yet, but it acts the same way with just one of them. I've tried adding the Strategy center's special battleplan update to the unit too to see if that would change anything, but it doesn't.

Logically one would assume the battleplan bonuses can just be applied and don't have any interaction between them beyond the strategycenter, but so far i've been running them up against the wall without them working.

Does anyone know anything about how the battleplans work and what could be breaking my attempts?

Below is my code for the officer unit itself:

CODE
Object AmericaInfantryOfficer
; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
OkToChangeModelColor = Yes

;NORMAL STANDING
DefaultConditionState
Model = AIOFCR_SKN
IdleAnimation = AIOFCR_SKL.AIOFCR_STA 0 21
;Regular spice animations
IdleAnimation = AIOFCR_SKL.AIOFCR_IDA
IdleAnimation = AIOFCR_SKL.AIOFCR_IDB
AnimationMode = ONCE
WeaponFireFXBone = PRIMARY Muzzle
WeaponMuzzleFlash = PRIMARY MuzzleFX
TransitionKey = TRANS_STAND
End

ConditionState = MOVING
Animation = AIOFCR_SKL.AIOFCR_RNA
AnimationMode = LOOP
ParticleSysBone = None InfantryDustTrails
End

; NORMAL ATTACK
;--------------------------------------------------------
; Drawing gun
ConditionState = PREATTACK_A
Animation = AIOFCR_SKL.AIOFCR_ATAST
AnimationMode = ONCE
End
AliasConditionState = PREATTACK_A MOVING
AliasConditionState = PREATTACK_A FIRING_A
AliasConditionState = PREATTACK_A BETWEEN_FIRING_SHOTS_A

; Firing gun
ConditionState = FIRING_A
Animation = AIOFCR_SKL.AIOFCR_ATALP
AnimationMode = LOOP
TransitionKey = TRANS_FIRING_A
End
ConditionState = BETWEEN_FIRING_SHOTS_A
Animation = AIOFCR_SKL.AIOFCR_ATALP
AnimationMode = LOOP
TransitionKey = TRANS_FIRING_A
End
AliasConditionState = RELOADING_A
AliasConditionState = MOVING FIRING_A
AliasConditionState = MOVING BETWEEN_FIRING_SHOTS_A
AliasConditionState = MOVING RELOADING_A

; This transition allows him to put his gun away when he's finished attacking.
TransitionState = TRANS_FIRING_A TRANS_STAND
Animation = AIOFCR_SKL.AIOFCR_ATAED
AnimationMode = ONCE
End
;--------------------------------------------------------

ConditionState = DYING
Animation = AIOFCR_SKL.AIOFCR_DTA
Animation = AIOFCR_SKL.AIOFCR_DTB
AnimationMode = ONCE
TransitionKey = TRANS_Dying
End

TransitionState = TRANS_Dying TRANS_Flailing
Animation = AIOFCR_SKL.AIOFCR_ADTE1
AnimationMode = ONCE
End

ConditionState = DYING EXPLODED_FLAILING
Animation = AIOFCR_SKL.AIOFCR_ADTE2
AnimationMode = LOOP
TransitionKey = TRANS_Flailing
End

ConditionState = DYING EXPLODED_BOUNCING
Animation = AIOFCR_SKL.AIOFCR_ADTE3
AnimationMode = ONCE
TransitionKey = None
End

ConditionState = SPECIAL_CHEERING
Animation = AIOFCR_SKL.AIOFCR_CHA
AnimationMode = LOOP
End

;PARACHUTING ANIMATIONS

;@TODO - MISSING ANIMATION FILE
;ConditionState = FREEFALL
; Animation = AIOFCR_SKL.AIOFCR_PFL
; AnimationMode = LOOP
; TransitionKey = TRANS_Falling
;End
;AliasConditionState = FREEFALL REALLYDAMAGED
;AliasConditionState = FREEFALL DYING
ConditionState = PARACHUTING
Animation = AIOFCR_SKL.AIOFCR_PHG
AnimationMode = LOOP
Flags = PRISTINE_BONE_POS_IN_FINAL_FRAME ; our bone positions should come from the last frame, rather than the first
TransitionKey = TRANS_Chute

End
AliasConditionState = PARACHUTING REALLYDAMAGED
AliasConditionState = PARACHUTING DYING
TransitionState = TRANS_Falling TRANS_Chute
Animation = AIOFCR_SKL.AIOFCR_POP
AnimationMode = ONCE
Flags = PRISTINE_BONE_POS_IN_FINAL_FRAME ; our bone positions should come from the last frame, rather than the first
End
TransitionState = TRANS_Chute TRANS_Stand
Animation = AIOFCR_SKL.AIOFCR_PTD
AnimationMode = ONCE
End

End

; ***DESIGN parameters ***
DisplayName = OBJECT:Officer
Side = America
EditorSorting = INFANTRY
TransportSlotCount = 1 ;how many "slots" we take in a transport (0 == not transportable)
WeaponSet
Conditions = None
Weapon = PRIMARY AmericaOfficerMachineGun
End
ArmorSet
Conditions = None
Armor = HumanArmor
DamageFX = InfantryDamageFX
End
CommandSet = SecretAgentCommandSet
VisionRange = 150
ShroudClearingRange = 150

BuildCost = 400
BuildTime = 10.0 ;in seconds

; *** AUDIO Parameters ***
VoiceSelect = RangerVoiceSelect
VoiceGroupSelect = BattleCrySound
VoiceMove = RangerVoiceMove
VoiceAttack = RangerVoiceAttack

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

Body = ActiveBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End

Behavior = AIUpdateInterface ModuleTag_03
AutoAcquireEnemiesWhenIdle = Yes
End
Behavior = AutoFindHealingUpdate ModuleTag_04 ; This update will have the unit go to a healing station if injured. jba
ScanRate = 1000 ; once a second.
ScanRange = 300 ;
NeverHeal = 0.85 ; don't heal if we are > 85% healthy.
AlwaysHeal = 0.25 ; if we get below 25%, find healing right away.
End

; Behavior = FireWeaponUpdate ModuleTag_22
; Weapon = OfficerWeaponBonusWeapon
; ExclusiveWeaponDelay = 0 ; If we fire a real weapon, we turn this module off for this long
; End




Locomotor = SET_NORMAL BasicHumanLocomotor
Behavior = PhysicsBehavior ModuleTag_05
Mass = 5.0
End

Behavior = SquishCollide ModuleTag_07
;nothing
End

Behavior = WeaponBonusUpdate ModuleTag_02
RequiredAffectKindOf = CAN_ATTACK ; Must be set
ForbiddenAffectKindOf = STRUCTURE ; Must be clear
BonusDuration = 100 ; How long effect lasts
BonusDelay = 100 ; How often to pulse (short lifetime will trump, of course)
BonusRange = 200 ; Keep in line with radius cursor size in special power template
BonusConditionType = BATTLEPLAN_BOMBARDMENT ; And which bonus to give
End

Behavior = WeaponBonusUpdate ModuleTag_22
RequiredAffectKindOf = CAN_ATTACK ; Must be set
ForbiddenAffectKindOf = STRUCTURE ; Must be clear
BonusDuration = 100 ; How long effect lasts
BonusDelay = 100 ; How often to pulse (short lifetime will trump, of course)
BonusRange = 200 ; Keep in line with radius cursor size in special power template
BonusConditionType = BATTLEPLAN_SEARCHANDDESTROY ; And which bonus to give
End

Behavior = WeaponBonusUpdate ModuleTag_12
RequiredAffectKindOf = CAN_ATTACK ; Must be set
ForbiddenAffectKindOf = STRUCTURE ; Must be clear
BonusDuration = 100 ; How long effect lasts
BonusDelay = 100 ; How often to pulse (short lifetime will trump, of course)
BonusRange = 200 ; Keep in line with radius cursor size in special power template
BonusConditionType = BATTLEPLAN_HOLDTHELINE ; And which bonus to give
End


Behavior = BattlePlanUpdate ModuleTag_14
SpecialPowerTemplate = SpecialAbilityChangeBattlePlans

;Transition Timings
BombardmentPlanAnimationTime = 0
HoldTheLinePlanAnimationTime = 0
SearchAndDestroyPlanAnimationTime = 0
TransitionIdleTime = 0

;Messages
BombardmentMessageLabel = MESSAGE:BattlePlanBombardmentInitiated
HoldTheLineMessageLabel = MESSAGE:BattlePlanHoldTheLineInitiated
SearchAndDestroyMessageLabel = MESSAGE:BattlePlanSearchAndDestroyInitiated

;Audio hooks
BombardmentPlanUnpackSoundName = StrategyCenter_BombardmentPlanUnpackSound
BombardmentPlanPackSoundName = StrategyCenter_BombardmentPlanPackSound
BombardmentAnnouncementName = StrategyCenter_BombardmentPlanAnnouncement
SearchAndDestroyPlanUnpackSoundName = StrategyCenter_SearchAndDestroyPlanUnpack
SearchAndDestroyPlanIdleLoopSoundName = StrategyCenter_SearchAndDestroyPlanIdleLoop
SearchAndDestroyPlanPackSoundName = StrategyCenter_SearchAndDestroyPlanPack
SearchAndDestroyAnnouncementName = StrategyCenter_SearchAndDestroyAnnouncement
HoldTheLinePlanUnpackSoundName = StrategyCenter_HoldTheLinePlanUnpack
HoldTheLinePlanPackSoundName = StrategyCenter_HoldTheLinePlanPack
HoldTheLineAnnouncementName = StrategyCenter_HoldTheLineAnnouncement

;Army bonuses granted by different battle plans
ValidMemberKindOf = CAN_ATTACK ;Battle plans affect any kind of these...
InvalidMemberKindOf = DOZER STRUCTURE AIRCRAFT DRONE ;...but make sure they don't have any of these
BattlePlanChangeParalyzeTime = 0 ;Subjected to paralyzation whenever a battle plan is changed.
HoldTheLinePlanArmorDamageScalar = 0.9 ;Armor damage bonus scalar -- LESS is better!
SearchAndDestroyPlanSightRangeScalar = 1.2 ;Sight range bonus -- more is better!
;***NOTE*** WEAPON bonuses for army are specified in GameData.ini file!

;Building bonuses granted based on battle plan mode.
;StrategyCenterSearchAndDestroySightRangeScalar = 2.0
; StrategyCenterSearchAndDestroyDetectsStealth = Yes
; StrategyCenterHoldTheLineMaxHealthScalar = 2.0
; StrategyCenterHoldTheLineMaxHealthChangeType = PRESERVE_RATIO

End




; Behavior = PropagandaTowerBehavior ModuleTag_06
; Radius = 200.0
; DelayBetweenUpdates = 2000 ; in milliseconds
; HealPercentEachSecond = 0% ; get this % of max health every second
; PulseFX = FX_PatriotismPulse ;plays as often as DelayBetweenUpdates
; UpgradeRequired = Upgrade_ChinaSubliminalMessaging
; UpgradedHealPercentEachSecond = 4% ; get this % of max health every second
; UpgradedPulseFX = FX_GreaterPatriotismPulse ;plays as often as DelayBetweenUpdates
; End


; --- begin Death modules ---
Behavior = SlowDeathBehavior ModuleTag_Death01
DeathTypes = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -POISONED_GAMMA
SinkDelay = 3000
SinkRate = 0.5 ; in Dist/Sec
DestructionDelay = 8000
FX = INITIAL FX_RangerDie
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_RangerDie
FlingForce = 8
FlingForceVariance = 3
FlingPitch = 60
FlingPitchVariance = 10
End
Behavior = SlowDeathBehavior ModuleTag_Death04
DeathTypes = NONE +BURNED
DestructionDelay = 0
FX = INITIAL FX_DieByFireUSA
OCL = INITIAL OCL_FlamingInfantry
End
Behavior = SlowDeathBehavior ModuleTag_Death05
DeathTypes = NONE +POISONED
DestructionDelay = 0
FX = INITIAL FX_DieByToxinGLA
OCL = INITIAL OCL_ToxicInfantry
End
Behavior = SlowDeathBehavior ModuleTag_Death06 ; don't forget to give it a new, unique module tag
DeathTypes = NONE +POISONED_BETA
DestructionDelay = 0
FX = INITIAL FX_DieByToxinGLA
OCL = INITIAL OCL_ToxicInfantryBeta ;you'll have to create this OCL and make it use the blue guys instead of green ones
End
Behavior = SlowDeathBehavior ModuleTag_Death07
DeathTypes = NONE +POISONED_GAMMA
DestructionDelay = 0
FX = INITIAL FX_DieByToxinGLA
OCL = INITIAL OCL_ToxicInfantryGamma
End
; --- end Death modules ---

Behavior = PoisonedBehavior ModuleTag_10
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 = 12.0
GeometryIsSmall = Yes
Shadow = SHADOW_DECAL
ShadowSizeX = 14;
ShadowSizeY = 14;
ShadowTexture = ShadowI;
BuildCompletion = APPEARS_AT_RALLY_POINT

End


The commented "OfficerWeaponBonusWeapon" weapon was a attempt to mimick the munitions track buff, using the same weaponbonusupdates on a seperate object. the leftover code from the propaganda tower was to check the range of the buff manually, but with the objects seemingly getting affected by a weird type of frenzy it's rather useless.

Here is a picture of two tanks being affected and stuck with a jammed weapon after firing their single shots, which clearly were effected by my 1200% rate on bombardment. The tank models are the public models made available from the (former) crazymod, if i recall correctly.
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 27 April 2024 - 5:56