IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Add Machine gun to a unit, how to make MG shoor more accuracy while moving
Harpie
post 1 Jul 2017, 4:51
Post #1



Group Icon

Group: Members
Posts: 22
Joined: 1 July 2017
From: VietNam
Member No.: 15531




I was try to put a Machine gun to a unit as SECONDARY WEAPON, but seem it's cant fire good while moving
- I was put a code "passenger" allow to fire, but i want it fire with main turret, not passenger



;------------------------------------------------------------------------------
Object GermanTankPanzerIII

; *** ART Parameters ***
SelectPortrait = PzrIIIF
ButtonImage = PzrIIIF_L

UpgradeCameo1 = Upgrade_ChinaBlackNapalm
UpgradeCameo2 = Upgrade_PanzerIIIArmored
;UpgradeCameo3 = NONE
;UpgradeCameo4 = NONE
;UpgradeCameo5 = NONE

Draw = W3DTankDraw ModuleTag_01
OkToChangeModelColor = Yes


;-------------------Normal
DefaultConditionState
Model = PanzerIII
Turret = Turret
WeaponFireFXBone = PRIMARY Muzzle
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponLaunchBone = PRIMARY Muzzle
HideSubObject = ARMOR
End

ConditionState = REALLYDAMAGED
Model = PanzerIIID
Turret = Turret
WeaponFireFXBone = PRIMARY Muzzle
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponLaunchBone = PRIMARY Muzzle
HideSubObject = ARMOR
End

ConditionState = RUBBLE
Model = PanzerIIID
Turret = Turret
HideSubObject = ARMOR
End


; --------Tank Tracks & Tread Movement -----------------------

TrackMarks = EXTnkTrack.tga

TreadAnimationRate = 1.9 ; texture to move per second
TreadDriveSpeedFraction = 0.25 ; treads stop moving.
TreadPivotSpeedFraction = 0.55 ; allow pivoting.
; ------------------------------------------------------------

End


; ***DESIGN parameters ***
DisplayName = object:germanvehiclepanzer3
Side = Germany
EditorSorting = VEHICLE
TransportSlotCount = 3 ;how many "slots" we take in a transport (0 == not transportable)
WeaponSet
Conditions = None
Weapon = PRIMARY KWK36L/45
Weapon = SECONDARY MG34
End
WeaponSet
Conditions = PLAYER_UPGRADE
Weapon = PRIMARY KWK36L/45;PRIMARY KWK38Flame
Weapon = SECONDARY KWK38FireWall
AutoChooseSources = PRIMARY FROM_SCRIPT FROM_AI DEFAULT_SWITCH_WEAPON
AutoChooseSources = SECONDARY FROM_SCRIPT FROM_AI
PreferredAgainst = PRIMARY INFANTRY
PreferredAgainst = SECONDARY STRUCTURE
End
ArmorSet
Conditions = None
Armor = TankNormalArmor
DamageFX = TankDamageFX
End

; ArmorSet
; Conditions = PLAYER_UPGRADE
; Armor = TankHardArmor
; DamageFX = TankDamageFX
; End
BuildCost = 550
BuildTime = 15.0 ;in seconds
VisionRange = 150
ShroudClearingRange = 300
Prerequisites
Object = GermanStructureWarFactory
End

ExperienceValue = 500 700 900 1000 ;Experience point value at each level
ExperienceRequired = 500 800 1800 2500;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experience
CrusherLevel = 2 ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
CrushableLevel = 3 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = PanzerIIICommandSet

; *** AUDIO Parameters ***
VoiceSelect = PIVTankVoiceSelect
VoiceMove = PIVTankVoiceMove
VoiceGuard = PIVTankVoiceMove
VoiceAttack = PIVTankVoiceAttack
;SoundMoveStart = PanzerIIIMoveStart;TomahawkMoveStart
;SoundMoveStartDamaged = PanzerIIIMoveStart;TomahawkMoveStart
SoundMoveLoop = PanzerIIILoop
SoundMoveLoopDamaged = PanzerIIILoop
SoundAmbient = LightTankAmbientLoop

UnitSpecificSounds
; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
VoiceCreate = EvaVoiceCreate
;TurretMoveStart = NoSound
TurretMoveLoop = TurretMoveLoop
VoiceSalvage = PIVTankVoiceSalvage
VoiceCrush = PIVTankVoiceCrush
VoiceEnter = PIVTankVoiceMove
End

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

Body = ActiveBody ModuleTag_03
MaxHealth = 240.0
InitialHealth = 240.0

; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
SubdualDamageCap = 860
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
End

Behavior = AIUpdateInterface ModuleTag_04
Turret
TurretTurnRate = 70
NaturalTurretAngle = 0
MinIdleScanAngle = 30 ; in degrees off the natural turret angle
MaxIdleScanAngle = 50 ; in degrees off the natural turret angle
MinIdleScanInterval = 5000 ; in milliseconds
MaxIdleScanInterval = 10000 ; in milliseconds
TurretPitchRate = 120
AllowsPitch = Yes
MinPhysicalPitch = -15

ControlledWeaponSlots = PRIMARY SECONDARY TERTIARY

TurretFireAngleSweep = PRIMARY 10
TurretFireAngleSweep = SECONDARY 60
TurretSweepSpeedModifier = PRIMARY 0.5 ; Sweep slower than you turn (aim for 30 for art)
TurretSweepSpeedModifier = SECONDARY 2.0 ; Sweep faster than you turn
End
AutoAcquireEnemiesWhenIdle = Yes
End
Locomotor = SET_NORMAL MediumTankLocomotor
Behavior = PhysicsBehavior ModuleTag_05
Mass = 20.0
End

Behavior = FireWeaponWhenDeadBehavior ModuleTag_06
DeathWeapon = TankerTruckWeapon
StartsActive = Yes
End



Behavior = ProductionUpdate ModuleTag_06
MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
End


; Catch fire, and explode death
Behavior = SlowDeathBehavior ModuleTag_08
DeathTypes = ALL -CRUSHED -SPLATTED
ProbabilityModifier = 50
DestructionDelay = 1200000;10
DestructionDelayVariance = 20
OCL = FINAL OCL_PanzerIIITank
FX = FINAL FX_BlitzGenericVehicleDieLarge ;FX_BlitzGenericVehicleDie
FX = INITIAL FX_BlitzIITankInitialDeath
End

Behavior = TransportContain ModuleTag_11
PassengersAllowedToFire = yes;no
Slots = 5
;InitialPayload = GermanTankPanzerI
EnterSound = GarrisonEnter
ExitSound = GarrisonExit
ScatterNearbyOnExit = No
DamagePercentToUnits = 150% ;10%
AllowInsideKindOf = INFANTRY
ExitDelay = 250
NumberOfExitPaths = 3 ; Defaults to 1. Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
PassengersInTurret = Yes
GoAggressiveOnExit = Yes ; AI Will tell people to set their mood to Aggressive on exiting
End

Behavior = TransitionDamageFX ModuleTag_10
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
End

; A crushing defeat
Behavior = FXListDie ModuleTag_11
DeathTypes = NONE +CRUSHED +SPLATTED
DeathFX = FX_CarCrush
End

;Behavior = MaxHealthUpgrade ModuleTag_18;ArmorUpgrade ;ModuleTag_Armor01
;TriggeredBy = Upgrade_PanzerIIIArmored
; AddMaxHealth = 100
; ChangeType = ADD_CURRENT_HEALTH_TOO
;End

Behavior = WeaponSetUpgrade ModuleTag_Weap1
TriggeredBy = Upgrade_ChinaBlackNapalm
End
Behavior = CommandSetUpgrade ModuleTag_Weap2
CommandSet = PanzerIIICommandSetUP
TriggeredBy = Upgrade_ChinaBlackNapalm
End

Behavior = FlammableUpdate ModuleTag_16
AflameDuration = 500 ; If I catch fire, I'll burn for this long...
AflameDamageAmount = 3 ; taking this much damage...
AflameDamageDelay = 500 ; this often.
End

Behavior = SubObjectsUpgrade ModuleTag_17
;*** Bio bomb load ***
TriggeredBy = Upgrade_PanzerIIIArmored
ConflictsWith = Upgrade_GLABombTruckHighExplosiveBomb
ShowSubObjects = ARMOR
HideSubObjects = CamoN02
End



;Behavior = LocomotorSetUpgrade ModuleTag_18
; TriggeredBy = Upgrade_PanzerIIIArmored
;End

Behavior = MaxHealthUpgrade ModuleTag_09
TriggeredBy = Upgrade_PanzerIIIArmored
AddMaxHealth = 50.0
ChangeType = ADD_CURRENT_HEALTH_TOO ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
End

Behavior = WeaponSetUpgrade ModuleTag_12
TriggeredBy = Upgrade_PanzerIIIArmored
End


Behavior = VeterancyGainCreate ModuleTag_20
StartingLevel = VETERAN
ScienceRequired = SCIENCE_TigerTankVeteran
End

Geometry = BOX
GeometryMajorRadius = 17.0
GeometryMinorRadius = 11.5
GeometryHeight = 12
GeometryIsSmall = Yes
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End


;--------------------------------------------------------
Go to the top of the page
 
+Quote Post
Harpie
post 1 Jul 2017, 4:53
Post #2



Group Icon

Group: Members
Posts: 22
Joined: 1 July 2017
From: VietNam
Member No.: 15531



Here is my Commandset for it
4,5 is the icon to change the weapon. Main Weapon to Secondary Weapon


CommandSet PanzerIIICommandSet
1 = Command_TransportExit
2 = Command_TransportExit
3 = Command_TransportExit
;6 = Command_MachineGun
4 = Command_BB
5 = Command_Fugas
8 = Command_UpgradePanzerIIIArmored
11 = Command_AttackMove
13 = Command_Guard
14 = Command_Stop
End
Go to the top of the page
 
+Quote Post
Zeke
post 1 Jul 2017, 5:00
Post #3


The X General
Group Icon

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



Add the line "MoodAttackCheckRate =", under "AutoAcquireEnemiesWhenIdle = Yes", and make it 0 or the same as "DelayBetweenShots" of the secondary weapon, whichever works better for you.

EDIT: Also if you're not planning to make the weapons switcchable like the USA Ranger, I suggest you remove the "DEFAULT_SWITCH_WEAPON" from the primary weapon's "AutoChooseSources" field

This post has been edited by Zeke: 1 Jul 2017, 5:02


--------------------
Go to the top of the page
 
+Quote Post
Harpie
post 1 Jul 2017, 5:04
Post #4



Group Icon

Group: Members
Posts: 22
Joined: 1 July 2017
From: VietNam
Member No.: 15531



QUOTE (Zeke @ 1 Jul 2017, 6:00) *
Add the line "MoodAttackCheckRate =", under "AutoAcquireEnemiesWhenIdle = Yes", and make it 0 or the same as "DelayBetweenShots" of the secondary weapon, whichever works better for you.

EDIT: Also if you're not planning to make the weapons switcchable like the USA Ranger, I suggest you remove the "DEFAULT_SWITCH_WEAPON" from the primary weapon's "AutoChooseSources" field


Oooh thank you for your reply
I was saw that code in Machine truck
i'll try it... thanks
Go to the top of the page
 
+Quote Post
Harpie
post 1 Jul 2017, 5:07
Post #5



Group Icon

Group: Members
Posts: 22
Joined: 1 July 2017
From: VietNam
Member No.: 15531



QUOTE (Zeke @ 1 Jul 2017, 6:00) *
Add the line "MoodAttackCheckRate =", under "AutoAcquireEnemiesWhenIdle = Yes", and make it 0 or the same as "DelayBetweenShots" of the secondary weapon, whichever works better for you.

EDIT: Also if you're not planning to make the weapons switcchable like the USA Ranger, I suggest you remove the "DEFAULT_SWITCH_WEAPON" from the primary weapon's "AutoChooseSources" field

I was see the Unit have Autochoose weapon while i force them to attack unit or infantry, building, but when i choose it my self, it's not autochoose anymore
Go to the top of the page
 
+Quote Post
Harpie
post 1 Jul 2017, 7:07
Post #6



Group Icon

Group: Members
Posts: 22
Joined: 1 July 2017
From: VietNam
Member No.: 15531



It's work....!!!, i was find those code for 2 years
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: 29 March 2024 - 7:19