모드 강좌
[GEN] 객체 생성 목록(ObjectCreationList. OCL)
페이지 정보
본문
게임을 하다보면 무기가 터질 때 방사능이나 독소 필드가 생기거나,
유닛이나 건물이 폭발할 때 잔해가 튀어나오는 것을 볼 것이다.
예전에 유닛과 건물, 필드 등은 하나의 객체(Object)라고 배웠다.
객체 생성 목록(OCL)을 사용하면 객체들을 임의로 생성할 수 있다.
보통 무기를 발사하거나, 터질 때, 유닛이 죽을 때 객체가 생성된다.
ObjectCreationList.ini를 열면 여러가지 OCL이 있다.
팔라딘 탱크의 무기에 방사능 효과를 추가해보자.
ProjectileDetonationOCL을 주면 무기가 폭발하면서 객체가 생성된다.
Weapon SuperPaladinTankGun
PrimaryDamage = 60.0
PrimaryDamageRadius = 5.0
ScatterRadiusVsInfantry = 10.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
--생략--
ProjectileDetonationFX = WeaponFX_GenericTankShellDetonation
ProjectileDetonationOCL = OCL_RadiationFieldMedium
--생략--
End
ObjectCreationList.ini에서 OCL_RadiationFieldMedium를 검색해보면 아래 코드가 나온다.
ObjectCreationList OCL_RadiationFieldMedium
CreateObject
ObjectNames = RadiationFieldMedium
Disposition = ON_GROUND_ALIGNED
End
End
RadiationFieldMedium 객체를 땅에 정렬되게 생성한다는 말이다.
System.ini에서 RadiationFieldMedium를 검색하면
움직이거나 선택할 수도 없는 방사능 필드만을 위한 객체가 나온다.
팔라딘 탱크가 죽을 때도 OCL을 사용할 수 있다.
OCL_PaladinTankDeathEffect는 팔라디 탱크가 죽으면서
잔해가 남고 포탑이 날아가는 모습을 연출한다.
Behavior = SlowDeathBehavior ModuleTag_05
DeathTypes = ALL -CRUSHED -SPLATTED
ProbabilityModifier = 50
; ModifierBonusPerOverkillPercent = 30% ; negative means less likely to pick this in the face of much damage, positive means more likely
DestructionDelay = 500
DestructionDelayVariance = 100
FX = INITIAL FX_GenericTankDeathEffect
FX = FINAL FX_GenericTankDeathExplosion
OCL = FINAL OCL_PaladinTankDeathEffect
End
잔해, 필드뿐만 아니라 슈퍼무기를 생성할 때도 OCL을 사용한다.
아래 코드는 중국 포대탄막을 위한 OCL이다.
ObjectCreationList SUPERWEAPON_ArtilleryBarrage1
DeliverPayload
Transport = ChinaArtilleryCannon
FormationSize = 12
FormationSpacing = 1.0
StartAtPreferredHeight = Yes
StartAtMaxSpeed = Yes
MaxAttempts = 1 ;max attempts
DeliveryDistance = 250 ;distance from target allowed to start/stop dropping.
WeaponErrorRadius = 100 ; how bad the artillerist is
DelayDeliveryMax = 3000 ; his delayed reaction to "Fire!"
VisibleItemsDroppedPerInterval = 1 ;Drops two bombs at a time
VisibleDropBoneBaseName = RootTransform ;The bombs are created and dropped at this bone base
VisibleSubObjectBaseName = Bomb ;The bombs are visible until dropped.
VisibleNumBones = 1 ;Number of bones.
VisiblePayloadTemplateName = ChinaArtilleryBarrageShell ;Created when payload is dropped.
VisiblePayloadWeaponTemplate = ArtilleryBarrageDamageWeapon
InheritTransportVelocity = Yes ;The bombs will start at transport velocity.
ExitPitchRate = 30 ;The bomb will pitch down.
SelfDestructObject = Yes ; so the delivery vehicle goes away 'POP!'
DeliveryDecalRadius = 125
DeliveryDecal
Texture = SCCArtilleryBarrage_China
Style = SHADOW_ALPHA_DECAL
OpacityMin = 25%
OpacityMax = 50%
OpacityThrobTime = 500
Color = R:255 G:156 B:0 A:255
OnlyVisibleToOwningPlayer = Yes
End
End
End
중국 커맨드 센터에도 포대탄막 OCL이 지정되어 있다.
Behavior = OCLSpecialPower ModuleTag_17
SpecialPowerTemplate = SuperweaponArtilleryBarrage
UpgradeOCL = SCIENCE_ArtilleryBarrage3 SUPERWEAPON_ArtilleryBarrage3
UpgradeOCL = SCIENCE_ArtilleryBarrage2 SUPERWEAPON_ArtilleryBarrage2
OCL = SUPERWEAPON_ArtilleryBarrage1
CreateLocation = CREATE_AT_EDGE_FARTHEST_FROM_TARGET
End