IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
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
Zeke
post 10 Dec 2017, 4:36
Post #2


The X General
Group Icon

Group: Project Leader
Posts: 2087
Joined: 7 June 2009
From: Philippines
Member No.: 73
Uniqueness is Overrated



Well the bombardment plans do disable your units when you switch been them, perhaps your problem is related to that. Maybe battleplans are designed to only be applied once, and stuns units after they are "removed".


--------------------
Go to the top of the page
 
+Quote Post
GearsGoAwryMan
post 10 Dec 2017, 4:45
Post #3



Group Icon

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



A fair assumption, but the stun is a EMP effect, if it would affect the units i would've seen a lot of lightning bolts and dark shading getting thrown around. So i don't think that is the direct issue. The disable is furthermore tied to the strategy center, which in this case isn't in the equation, and it's code didn't affect the problem at all. I dunno if the battleplans have any other effects that apply when they remove or something, but the stun effect does not seem to be the issue.
Go to the top of the page
 
+Quote Post
Zeke
post 10 Dec 2017, 5:14
Post #4


The X General
Group Icon

Group: Project Leader
Posts: 2087
Joined: 7 June 2009
From: Philippines
Member No.: 73
Uniqueness is Overrated



QUOTE (GearsGoAwryMan @ 10 Dec 2017, 11:45) *
A fair assumption, but the stun is a EMP effect, if it would affect the units i would've seen a lot of lightning bolts and dark shading getting thrown around. So i don't think that is the direct issue. The disable is furthermore tied to the strategy center, which in this case isn't in the equation, and it's code didn't affect the problem at all. I dunno if the battleplans have any other effects that apply when they remove or something, but the stun effect does not seem to be the issue.


Well units don't normally turn red when you pick a battleplan either, fact is your using something in a way it wasn't meant to be used, so conventional knowledge doesn't really apply. SAGE has a lot of stuff that are hardcoded "beyond the codes", like how an overlord contain module will always look for FIREPOINT01 even if you specifiy a different bone in the attach bone name field, and how rocket pod attack voices will only play for the VZH comanche rocket pod weapons.

Have you tried adding a non battleplan bonus and see if they work? Or giving the officer only a single burst with a long bonus duration?


--------------------
Go to the top of the page
 
+Quote Post
GearsGoAwryMan
post 10 Dec 2017, 5:34
Post #5



Group Icon

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



I tried your suggestions quickly, and it seems that other bonuses work normally, but also shade the units red. using a longer bonus duration allowed the officer to attack normally, but still blocks the tanks from shooting. I used a new delay/duration of 1000.

the officer has a weapon delay of 1538 and a inbetweenshots of 1000, the tank one of 2000. It might be that the removing and re-applying the buff resets the weapon's shot timers? I'll experiment with vaster timers tomorrow i guess.

This post has been edited by GearsGoAwryMan: 10 Dec 2017, 5:34
Go to the top of the page
 
+Quote Post
GearsGoAwryMan
post 11 Dec 2017, 20:21
Post #6



Group Icon

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



Did some more testing and it seems they don't apply at the same time, and only one battleplan can affect a unit, even if you project all of them. if a weapon reload time exceeds the battleplan's buff time it won't reload.

I haven't tested if the defense battleplan works without a strategycenter yet, but i'll try it and see what happens.

Now i need to figure out a way for all officers to (globally) switch between battleplans.

This post has been edited by GearsGoAwryMan: 11 Dec 2017, 20:23
Go to the top of the page
 
+Quote Post

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: 21 April 2018 - 8:29