《最高指挥官2》创建/添加新单位,单位修改,武器修改,代码修改,单位代码中英对照表
本帖最后由 阿136793878 于 2024-12-6 19:56 编辑先简单讲一下《最高指挥官2》这个游戏的单位怎么修改:
在游戏安装目录下,打开gamedata文件夹,要修改的文件就在这里面。(scd格式的文件可用WinRAR或其它解压缩工具打开,打开后里面其它文件用记事本打开)
其中bp.scd这个文件里面的单位,是游戏时不勾选DLC(如图所示),游戏所调用的单位。(即不勾选DLC,改这里面的文件才有效)
而z_lua_dlc1.scd这个文件里面的单位,是游戏时勾选DLC,游戏所调用的单位。(即勾选DLC,改这里面的文件才有效)
遭遇战单位路径:bp.scd\Units\...(不勾选DLC)
遭遇战单位路径:z_lua_dlc1.scd\mods\DLC1\shadow\Units\...(勾选DLC)
战役单位路径:bp.scd\mods\CampaignBranch\shadow\Units\...
修改实例:修改Illuminate族指挥官传送冻结时间(遭遇战中)
文件路径:bp.scd\Units\Illuminate\UIL0001\UIL0001_unit.bp
如果这个文件没修改过,打开后会看到全是乱码(加密文件),这时需要打开uncompiled_lua.scd文件中相同路径下文件(即uncompiled_lua.scd\uncompiled\Units\Illuminate\UIL0001\UIL0001_unit.bp)并复制全部内容过来,覆盖掉bp.scd\Units\Illuminate\UIL0001\UIL0001_unit.bp中的乱码内容,然后找到TeleportCooldown = 30,把等号后面的30改成1并保存,此时会弹出“...你希望在压缩文件中更新它吗?”,选是。
到此修改就完成了,Illuminate族指挥官传送冻结时间由30变成了1。
本帖最后由 阿136793878 于 2024-10-16 10:18 编辑
分享最高指挥官2单位对照表
Illuminate空军:
UIA0103_unit --Vulthoo --秃鹰武装战机
UIA0104_unit --Weedoboth --万能者战机
UIA0901_unit --HeeHola --整合者运输机
Illuminate建筑:
UIB0001_unit--Land Factory --陆军工厂
UIB0002_unit--Air Factory --空军工厂
UIB0011_unit--Experimental Gantry --实验级工厂
UIB0021_unit--陆地工厂脚手架
UIB0022_unit--陆地大型脚手架
UIB0023_unit--陆地中型脚手架
UIB0024_unit--实验级脚手架
UIB0025_unit--陆地小型脚手架
UIB0101_unit--Long Range Point Defense---远程对地防御设施
UIB0102_unit--Anti-Air Tower--防空塔
UIB0106_unit--Tactical Missile Launcher--战术导弹发射器
UIB0107_unit--Nuke Missile Silo--核导单仓
UIB0202_unit--Shield Generator--护盾生成器
UIB0203_unit--Nuke Defense Silo--核防御仓
UIB0301_unit--Radar Installation--雷达
UIB0701_unit--Mass Extractor--质能采集站
UIB0702_unit--Energy Generator--发电站
UIB0704_unit--Mass Convertor--质能转换器
UIB0801_unit--Research Station --研究站
Illuminate陆军:
UIL0001_unit--ACU --指挥官
UIL0002_unit--Engineer --工程车
UIL0101_unit --Yenzoo --伊恩祖悬浮坦克
UIL0103_unit --Harvog --熔岩先锋
UIL0104_unit --Fistoosh--铁锤机动导弹发射车
UIL0105_unit --Crahdow--击落者悬浮防空炮车
UIL0202_unit --Bodaboom--神像装甲生成车
UIL0203_unit --Sliptack--滑钉悬浮反导车
Illuminate附加单位:
UIM0001_unit--Escape Pod--逃生舱
UIM0002_unit--Rogue Nanites--纳米暴徒
UIM0111_unit --Tactical Missile Launcher--战术导弹发射器(工厂附加)
UIM0121_unit --Anti-Air Turret--防空炮塔(工厂附加)
UIM0131_unit --Torpedo Turret--鱼雷塔(工厂附加)
UIM0141_unit --Intel Installation--情报设施(工厂附加)
UIM0211_unit --Shield Generator--护盾生成器(工厂附加)
Illuminate实验级单位:
UIX0101_unit--Urchinow--金刚(蜗牛)
UIX0102_unit--Wilfindja--孢囊
UIX0103_unit--Airnomo--净空者
UIX0111_unit--Universal Colossus --太虚巨神
UIX0112_unit--Darkenoid--暗影飞碟
UIX0113_unit--Space Temple --太虚神殿
UIX0114_unit--Loyalty Gun--忠义巨炮
UIX0115_unit--Pulinsmash --黑洞
-------------------------------------------------------------------------
UEF空军:
UUA0101_unit --Wasp--黄蜂歼击机
UUA0102_unit --Eagle Eye--鹰眼轰炸机
UUA0103_unit --Broadsword--阔剑武装直升机
UUA0901_unit --C18 Star Lifter--C18运输机
UEF建筑:
UUB0001_unit--Land Factory--陆军工厂
UUB0002_unit--Air Factory--空军工厂
UUB0003_unit--Sea Factory--海军工厂
UUB0011_unit--Land Gantry--实验级陆军基地
UUB0012_unit--Air Gantry--实验级空军基地
UUB0021_unit--陆地工厂脚手架
UUB0022_unit--陆地大型脚手架
UUB0023_unit--陆地中型脚手架
UUB0024_unit--实验级脚手架
UUB0025_unit--陆地小型脚手架
UUB0026_unit--水中中型脚手架
UUB0027_unit--海军工厂脚手架
UUB0028_unit--水中小型脚手架
UUB0101_unit--Heavy Point Defense--重型对地防御设施
UUB0102_unit--Heavy Anti-Air Tower--重装防空塔
UUB0104_unit--Fortified Artillery--强化火炮
UUB0105_unit--Long Range Artillery--远程火炮
UUB0107_unit--Nuke Missile Silo--核导弹仓
UUB0202_unit--Shield Generator--护盾生成器
UUB0203_unit--Nuke Defense Silo--核弹防仓
UUB0301_unit--Radar Installation--雷达
UUB0302_unit--Sonar Installation--声呐
UUB0701_unit--Mass Extractor--质能采集站
UUB0702_unit--Energy Generator--发电站
UUB0704_unit--Mass Convertor--质能转换器
UUB0801_unit--Research Station --研究站
UEF陆军:
UUL0001_unit --ACU--指挥官
UUL0002_unit --Engineer--工程车
UUL0101_unit --Rock Head--岩石坦克
UUL0102_unit --Demolisher--毁灭者机动火炮
UUL0103_unit --Titan--泰坦先锋机器人
UUL0104_unit --Meteor--陨石机动导弹发射车
UUL0105_unit --Archanist--炼金师防空炮车
UUL0201_unit --P-Shield--P型护盾生成车
UUL0203_unit --Sharp Shooter--利刃防空导弹车
UEF附加单位:
UUM0001_unit --Escape Pod--逃生舱
UUM0111_unit --Tactical Missile Launcher--战术导弹发射器(工厂附加)
UUM0121_unit -- Anti-Air Turret--防空炮塔(工厂附加)
UUM0131_unit --Torpedo Turret--鱼雷塔(工厂附加)
UUM0141_unit --Intel Installation--情报设施(工厂附加)
UUM0211_unit --Shield Generator--护盾生成器(工厂附加)
UEF海军:
UUS0102_unit --Mastadon--猛犸巡洋舰
UUS0104_unit --Tigershark--虎鲨潜艇
UUS0105_unit --Poseidon--波塞冬战列舰
UEF实验级单位:
UUX0101_unit --Fatboy II--胖墩2
UUX0102_unit --AC-1000 Terror--AC-1000恐鸟
UUX0103_unit --C-230 Star King Extreme--C-230星际至尊王者
UUX0104_unit --Atlantis II--亚特兰蒂斯2
UUX0111_unit --King Kriptor--克里普特帝王
UUX0112_unit --Mega Fortress--巨型堡垒
UUX0114_unit --Noah Unit Cannon--诺亚加农炮
UUX0115_unit --Disruptor Station--干扰站
--------------------------------------------------------------------
Cybran空军:
UCA0103_unit--Renegade--变节者
UCA0104_unit--Gemini--双子座战斗轰炸机
UCA0901_unit--Dragon Fly--蜻蜓运输机
Cybran建筑:
UCB0001_unit--Land Factory --陆军工厂
UCB0002_unit--Air Factory--空军工厂
UCB0003_unit--Sea Factory--海军工厂
UCB0011_unit--Land Gantry--实验级陆军基地
UCB0012_unit--Air Gantry--实验级空军基地
UCB0021_unit--陆地工厂脚手架
UCB0022_unit--陆地大型脚手架
UCB0023_unit--陆地中型脚手架
UCB0024_unit--实验级脚手架
UCB0025_unit--陆地小型脚手架
UCB0026_unit--水中中型脚手架
UCB0027_unit--海军工厂脚手架
UCB0028_unit--水中小型脚手架
UCB0101_unit--Rapid Fire Point Defense--快速火力对地防御设施
UCB0102_unit--High Damage Anti-Air Tower--高伤害防空塔
UCB0105_unit--Long Range Artillery--远程火炮
UCB0202_unit--Shield Generator--护盾发生器
UCB0204_unit--Nuke Missile and Defense Silo--核导弹和防御仓
UCB0303_unit--Sonar Installation--雷达/声呐
UCB0701_unit--Mass Extractor--质能采集站
UCB0702_unit--Energy Generator--发电站
UCB0704_unit--Mass Convertor--质能转换器
UCB0801_unit--Research Station--研究站
Cybran陆军:
UCL0001_unit--ACU--指挥官
UCL0002_unit--Engineer--工程车
UCL0102_unit--Brackman--布莱克曼(火炮)
UCL0103_unit--Loyalist--忠诚者先锋机器人
UCL0104_unit--Cobra--眼镜蛇机动导弹发射车
UCL0204_unit--Adaptor--编织者(护盾)
Cybran附加单位:
UCM0001_unit --Escape Pod--逃生舱
UCM0111_unit --Tactical Missile Launcher--战术导弹发射器(工厂附加)
UCM0121_unit -- Anti-Air Turret--防空炮塔(工厂附加)
UCM0131_unit --Torpedo Turret--鱼雷塔(工厂附加)
UCM0141_unit --Intel Installation--情报设施(工厂附加)
UCM0211_unit --Shield Generator--护盾生成器(工厂附加)
Cybran海军:
UCS0103_unit--Salem Class--塞勒姆级巡洋舰
UCS0105_unit--Executioner Class--处决级战列舰
UCS0901_unit--Command Class--指挥级母舰
Cybran实验级单位:
UCX0101_unit--Megalith II--巨石II
UCX0102_unit--Giant Transport--巨型运输机
UCX0103_unit--Bomb Bouncer--炸弹终结者
UCX0111_unit--Cybranasaurus Rex--铁甲基龙
UCX0112_unit--Soul Ripper II--灵魂撕裂者II
UCX0113_unit--Kraken--海妖(潜艇)
UCX0114_unit--Magnetron--磁控管单位吸引器
UCX0115_unit--Proto-Brain Complex--原脑复合体
UCX0116_unit--Proto-Brain--原脑
《最高指挥官2》指挥官修改成可生产(建造):
(以Illuminate族为例,文件路径:bp.scd\Units\Illuminate\UIL0001\UIL0001_unit.bp)
找到以下函数,并加入如下2行代码即可。
Categories = {
'PRODUCTSC2',
'SELECTABLE',
'MOBILE',
'ECONOMIC',
'COMMAND',
'MASSPRODUCTION',
'MASSFABRICATION',
'ENERGYPRODUCTION',
'ENGINEER',
'CONSTRUCTION',
'CAPTURE',
'DIRECTFIRE',
'LAND',
'NEEDMOBILEBUILD',
'VISIBLETORECON',
'PATROLHELPER',
'SHOWQUEUE',
'OVERLAYRADAR',
'OVERLAYDIRECTFIRE',
'OVERLAYINDIRECTFIRE',
'OVERLAYDEFENSE',
'PODSTAGINGPLATFORM',
'VERIFYMISSILEUI',
'SILO',
'ILLUMINATE',
'INTELLIGENCE',
'MOBILEGANTRYBUILDER',
'BUILTBYESCAPEPOD',
'BUILTBYMOBILE',-----新增这一行(用于建造功能)
'TECH1',------新增这一行(用于建造功能)
'ANTISURFACE',
'UIBASICSORTCATEGORY',
}, 修改AI,让对战的电脑也能自动建造指挥官(保持不少于2个指挥官)
(文件路径:bp.scd\lua\AI\skirmish\EngineerBuilders\SAIEngineerBuilders_Economy.bp)
查找到含有Rebuild ACU的以下函数,并加入如下9行代码即可。
SkirmishEngineerBlueprint {
AnnounceItem = false,
AnnounceFail = false,
BlueprintId = 'Rebuild ACU',
BuilderIds = {
'uum0001',
'ucm0001',
'uim0001',
'uul0002',----新增这一行
'ucl0002',----新增这一行
'uil0002',----新增这一行
'uul0001',----新增这一行
'ucl0001',----新增这一行
'uil0001',----新增这一行
},
Conditions = {
{
{ ConditionType = 'UnitBuildCheck', ConditionStringOne = 'uul0001', ConditionBool = true, },
{ ConditionType = 'EngineerBlueprintCanAfford', },
{ ConditionType = 'CategoryLessThan', ConditionCategoryStringOne = 'uul0001', ConditionIntegerOne = 2, },----(新增这一行,当指挥官数量少于2个时,建造新的指挥官)
{ ConditionType = 'EngineerBlueprintPositionQuery', },
},
{
{ ConditionType = 'UnitBuildCheck', ConditionStringOne = 'ucl0001', ConditionBool = true, },
{ ConditionType = 'EngineerBlueprintCanAfford', },
{ ConditionType = 'CategoryLessThan', ConditionCategoryStringOne = 'ucl0001', ConditionIntegerOne = 2, },----(新增这一行,当指挥官数量少于2个时,建造新的指挥官)
{ ConditionType = 'EngineerBlueprintPositionQuery', },
},
{
{ ConditionType = 'UnitBuildCheck', ConditionStringOne = 'uil0001', ConditionBool = true, },
{ ConditionType = 'EngineerBlueprintCanAfford', },
{ ConditionType = 'CategoryLessThan', ConditionCategoryStringOne = 'uil0001', ConditionIntegerOne = 2, },----(新增这一行,当指挥官数量少于2个时,建造新的指挥官)
{ ConditionType = 'EngineerBlueprintPositionQuery', },
},
},
InstanceCount = 1,
ItemGroups = {
'Default Expansion Item Group',
'Default Item Group',
'Rush Item Group',
'Rush Expansion Item Group',
},
PlatoonBehavior = 'EngineerBuild',
UnitToBuild = 'ACU',
BasePriority = 2000,
InstanceCount = 1,
SkirmishResourceType = 'All',
BuildLocation = 'Base',
BuildRelative = 'CenterPoint',
} 本帖最后由 阿136793878 于 2024-10-4 03:47 编辑
《最高指挥官2》修改建筑,变成可在水面建造:
(以Illuminate族空军工厂为例,文件路径:bp.scd\Units\Illuminate\UIB0002\UIB0002_unit.bp)
找到以下函数,并加入如下1行代码即可。
Physics = {
BankingSlope = 0,
BuildOnLayerCaps = {
LAYER_Land = true,
LAYER_Water = true,-----新增这一行,使建筑能在水面建筑
},
MaxSteerForce = 0,
MeshExtentsX = 4.25,
MeshExtentsY = 2.5,
MeshExtentsZ = 5,
MotionType = 'RULEUMT_None',
OccupyGround = true,
}, 本帖最后由 阿136793878 于 2024-10-4 04:08 编辑
《最高指挥官2》逃生舱修改成可在工厂中生产:
(以Illuminate族为例,文件路径:bp.scd\Units\Illuminate\UIM0001\UIM0001_unit.bp)
找到以下函数,并加入如下2行代码即可。
Categories = {
'PRODUCTSC2',
'SELECTABLE',
'BUILTBYFACTORY',----(新加入这一行)
'TECH1',----(新加入这一行)
'MOBILE',
'ECONOMIC',
'COMMAND',
'ENGINEER',
'CONSTRUCTION',
'AIR',
'VISIBLETORECON',
'ILLUMINATE',
'ESCAPEPOD',
},
阿136793878 发表于 2024-10-4 04:07
《最高指挥官2》逃生舱修改成可在工厂中生产:
(以Illuminate族为例,文件路径:bp.scd%units\Illuminate%u ...
逃生舱如果不用来建造指挥官,其实可以当核弹用,因为它能产生核爆。
如果你再修改它的飞行速度和爆炸威力,它比核弹好用得多。
《最高指挥官2》修改指挥官蓄能模式的冻结时间,可连续使用蓄能模式攻击:
(文件路径:bp.scd\abilities\Overcharge_Ability.bp)
打开文件后查找到Cooldown并把等号后面的35改为5或更小的值,保存即可。
如果还想改蓄能模式消耗的电量,再查找到SourceAmount并把等号后面的电量值改小保存即可。 《最高指挥官2》指挥官的一些重要代码修改:
最大建造/维修距离,最大俘获/占领距离,武器射程等等
(以Illuminate族为例,文件路径:bp.scd\Units\Illuminate\UIL0001\UIL0001_unit.bp)
以下是指挥官的完整代码,部分代码作了注释说明。
UnitBlueprint {
AI = {
Attacker = {
RelocateToFire = true,
},
GuardRadius = 10,-----警戒半径
TargetBones = {
'UIL0001_Head',
'UIL0001_Turret01',
},
},
Abilities = {
{
Blueprint = 'Overcharge',-----蓄能
},
{
Blueprint = 'ACU_Hunker',-----蹲下
},
{
Blueprint = 'EscapePod',-----逃生舱
},
{
Blueprint = 'RogueNanites',-----纳米机器人
},
},
AnimSet = {
hunker = 'UIL0001_Hunker',
hunkerend = 'UIL0001_HunkerEnd',
idle = 'UIL0001_Idle',
killed = 'UIL0001_Killed',
walk = 'UIL0001_Walk',
},
AnimTree = '/anims/cdr_unit_animtree.bp',
Audio = {
CaptureLoop = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Capture_Loop',
ConstructLoop = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Construct_Loop',
FootFallGeneric = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Move_Step',
FootFallGenericSeabed = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Move_UW_Step',
Hunker = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_hunker_pack',
Killed = 'SC2/SC2/Destructions/Explosions/UEF/snd_Destroy_Sml_Land',
KilledNuke = 'SC2/SC2/Destructions/Explosions/ILLUMINATE/snd_Nuke_Impact',
OnReclaimed = 'SC2/SC2/Destructions/Explosions/UEF/snd_Destroy_Med_Land',
OverchargeOff = 'SC2/SC2/Commanders/snd_ACU_Overcharge_Off',
OverchargeOn = 'SC2/SC2/Commanders/snd_ACU_Overcharge_On',
ReclaimLoop = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Reclaim_Loop',
StartMove = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Move_Start',
StopMove = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Move_Stop',
TeleportEnd = 'SC2/SC2/Units/ILLUMINATE/snd_TeleportEnd',
TeleportStart = 'SC2/SC2/Units/ILLUMINATE/snd_TeleportStart',
UISelection = 'SC2/SC2/Selection/snd_GENERIC_Select_Commander',
UnHunker = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_hunker_unpack',
},
Build = {
BuildArmManipulators = {
{
AimBone = 'UIL0001_T01_Muzzle01',
AutoInitiateRepairCommand = false,-----自动维修
PitchBone = 'UIL0001_RightElbow',
YawBone = 'UIL0001_Turret01',
},
},
BuildScaffoldUnit = 'uib0022',
EffectBones = {
'UIL0001_T01_Muzzle01',
},
MaxRepairDistance = 40,-----最大维修距离(原15)
RepairScanRadius = 45,-----维修扫描/探测半径(原20)
RepairTargetCheckInterval = 1,
},
Categories = {
'PRODUCTSC2',
'SELECTABLE',
'MOBILE',
'ECONOMIC',
'COMMAND',
'MASSPRODUCTION',
'MASSFABRICATION',
'ENERGYPRODUCTION',
'ENGINEER',
'CONSTRUCTION',
'CAPTURE',
'DIRECTFIRE',
'LAND',
'NEEDMOBILEBUILD',
'VISIBLETORECON',
'PATROLHELPER',
'SHOWQUEUE',
'OVERLAYRADAR',
'OVERLAYDIRECTFIRE',
'OVERLAYINDIRECTFIRE',
'OVERLAYDEFENSE',
'PODSTAGINGPLATFORM',
'VERIFYMISSILEUI',
'SILO',
'ILLUMINATE',
'INTELLIGENCE',
'MOBILEGANTRYBUILDER',
'BUILTBYESCAPEPOD',
'BUILTBYMOBILE',-----新增(用于建造功能)
'TECH1',------新增(用于建造功能)
'ANTISURFACE',
'UIBASICSORTCATEGORY',
},
Death = {
DeathAnimWaitTime = 2,
DebrisPieces = true,
ExplosionEffect = 'IlluminateDefaultDestroyEffectsMed01',
ExplosionTendrils = true,
Light = true,
},
Defense = {
AirThreatLevel = 0,
ArmorType = 'Commander',
EconomyThreatLevel = 10,
Health = 20000,-----生命值(原20000)
MaxHealth = 20000,-----最大生命值(原20000)
RegenRate = 24,-----自动回血速度(原24)
Shield = {
AllowPenetration = true,
ImpactEffects = 'ShieldHit01',
OwnerShieldTextureSet = 'Shield',
ShieldDamageAbsorb = 0.85,
ShieldMaxHealth = 12000,-----护甲防御值(原12000)
ShieldRechargeTime = 45,-----护甲损毁后多久开始重生(原45)
ShieldReflectChance = 0.5,-----护甲反弹攻击几率(原0.5)
ShieldReflectRandomVector = true,-----护甲反弹攻击方向随机
ShieldRegenRate = 100,-----护甲自我修复速度(原100)
SizeX = 1.7,
SizeY = 3.2,
SizeZ = 1.5,
StartOn = false,
},
SurfaceThreatLevel = 5,
},
Description = '<LOC UNIT_DESCRIPTION_0059>Armored Command Unit',
Display = {
DamageEffects = {
Land = {
BoneSets = {
{
Bone = 'UIL0001_Head',
},
{
Bone = 0,
},
{
Bone = 0,
},
},
EffectSets = {
'DamageElectricity01',
'DamageSparks01',
'DamageSmoke01',
},
},
Seabed = {
BoneSets = {
{
Bone = 0,
},
},
EffectSets = {
'DamageWaterSmoke01',
},
},
},
DisplayName = '<LOC UNIT_NAME_0118>ACU',
EffectGroupClassification = 'Medium',
IdleEffects = {
Seabed = {
Effects = {
{
Bones = {
'UIL0001_LeftElbow',
'UIL0001_T01_Muzzle02',
'UIL0001_RightElbow',
'UIL0001_T01_Muzzle01',
},
Type = 'UnderWater01',
},
},
},
},
Mesh = {
IconFadeInZoom = 130,
LODReduceImmune = true,
LODs = {
{
LODCutoff = 80,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/Illuminate_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/Units/Shared/IlluminateShield.dds',
RampName = '/textures/Units/Shared/Ramps/Illuminate_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow, shield',
},
},
Name = 'Shield',
},
},
},
{
LODCutoff = 160,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/Illuminate_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/Units/Shared/IlluminateShield.dds',
RampName = '/textures/Units/Shared/Ramps/Illuminate_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow, shield',
},
},
Name = 'Shield',
},
},
},
{
LODCutoff = 800,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/Illuminate_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, environment_mapping, team_color',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/Units/Shared/IlluminateShield.dds',
RampName = '/textures/Units/Shared/Ramps/Illuminate_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, environment_mapping, team_color, shield',
},
},
Name = 'Shield',
},
},
},
},
},
MovementEffects = {
Land = {
Effects = {
{
Bones = {
'UIL0001_LeftAnkle',
'UIL0001_RightAnkle',
},
Scale = 0.8,
Type = 'GroundKickup01',
},
},
Footfall = {
Bones = {
{
AnkleBone = 'UIL0001_RightToe',
FootBone = 'UIL0001_RightToe',
HipBone = 'UIL0001_RightHip',
KneeBone = 'UIL0001_RightKnee',
OrientFoot = true,
OrientFootAngleMax = 40,
OrientFootBlendHeight = 0.1,
Type = 'FootFall01',
},
{
AnkleBone = 'UIL0001_LeftToe',
FootBone = 'UIL0001_LeftToe',
HipBone = 'UIL0001_LeftHip',
KneeBone = 'UIL0001_LeftKnee',
OrientFoot = true,
OrientFootAngleMax = 40,
OrientFootBlendHeight = 0.1,
Type = 'FootFall01',
},
},
},
},
Seabed = {
Effects = {
{
Bones = {
'UIL0001_Turret01',
'UIL0001_RightElbow',
'UIL0001_LeftElbow',
'UIL0001_T01_Muzzle01',
'UIL0001_T01_Muzzle02',
'UIL0001_RightToe',
'UIL0001_LeftToe',
},
Type = 'UnderWater01',
},
},
Footfall = {
Bones = {
{
AnkleBone = 'UIL0001_RightToe',
FootBone = 'UIL0001_RightToe',
HipBone = 'UIL0001_RightHip',
KneeBone = 'UIL0001_RightKnee',
OrientFoot = true,
OrientFootAngleMax = 40,
OrientFootBlendHeight = 0.1,
Type = 'FootFall02',
},
{
AnkleBone = 'UIL0001_LeftToe',
FootBone = 'UIL0001_LeftToe',
HipBone = 'UIL0001_LeftHip',
KneeBone = 'UIL0001_LeftKnee',
OrientFoot = true,
OrientFootAngleMax = 40,
OrientFootBlendHeight = 0.1,
Type = 'FootFall02',
},
},
},
},
},
TransportAnimation = {
{
Animation = '/units/Illuminate/UIL0001/UIL0001_AhunkerIdle01.sca',
Weight = 100,
},
},
TransportDropAnimation = {
{
Animation = '/units/Illuminate/UIL0001/UIL0001_AhunkerIdle01.sca',
Weight = 100,
},
},
UniformScale = 0.1,
},
Economy = {
BuildRate = 4,
BuildTime = 150,
BuildableCategory = {
'BUILTBYMOBILE ILLUMINATE TECH1',
'uix0113',
'uix0114',
'uib0011',
},
CaptureRate = 20,-------俘获速度(原1)
CaptureTimeMult = 0.45,-------俘获时间系数(原0.45)
MaxCaptureDistance = 25,-----最大俘获/占领距离(新增)
EnergyValue = 7500,--------建造指挥官消耗电量值(原7500)
MassValue = 1500,--------建造指挥官消耗质能值(原1500)
MaxBuildDistance = 40,--------最大建造距离(原15)
NaturalProducer = true,
ProductionPerSecondEnergy = 5,-----每秒生产电量值(原5)
ProductionPerSecondMass = 1,-----每秒生产质能值(原1)
ProductionPerSecondResearch = 0.01,
RepairRate = 2,-------维修速度(原0.5)
},
EscapePod = {
EscapePodAttachBone = 'UIL0001_Head',
EscapePodUnitId = 'uim0001',-----逃生舱ID
},
General = {
Build = {
Bones = {
BuildEffectBones = {
'UIL0001_T01_Muzzle01',
},
},
},
BuildIconIndex = 9,---单位在建造栏第几格
BuildIconPage = 1,---单位在建造栏第几页
BuildIconSortPriority = 980,---建造栏排序权重(新增)
CapCost = 0,
CommandCaps = {
RULEUCC_Attack = true,
RULEUCC_CallTransport = true,-----
RULEUCC_Capture = true,
RULEUCC_Guard = true,
RULEUCC_Move = true,
RULEUCC_Patrol = true,
RULEUCC_Pause = true,
---RULEUCC_Reclaim = true,-----回收功能是否显示
RULEUCC_Repair = true,-----维修功能是否显示
RULEUCC_RetaliateToggle = true,-----回击/攻击开关是否显示
RULEUCC_Stop = true,
},
ExperienceTable = 'ACU',
ExperienceValue = 7500,
FactionName = 'Illuminate',-----派系名称
Icon = 'amph',
MoveEnergyCost = 300,-----心灵传送消耗电量
QuickSelectPriority = 1,
SelectionPriority = 3,
TeleportCooldown = 1,-----传送冻结时长
TeleportRange = 200,-----心灵传送距离
UnitName = '<LOC UNIT_NAME_0119>ACU',
UnitWeight = 1,
},
Intel = {
FreeIntel = true,
RadarRadius = 60,
SonarRadius = 60,
VisionRadius = 30,
WaterVisionRadius = 30,
},
LifeBarHeight = 0.23,
LifeBarOffset = 0.6,
LifeBarSize = 1.55,
Navigation = {
IgnoreNeighbors = true,
Radius = 3.5,
},
Physics = {
BankingSlope = 0,
BuildOnLayerCaps = {
LAYER_Land = true,
LAYER_Water = true,
LAYER_Seabed = true,
},
CollisionPushClass = 3,
CollisionPushable = false,
LayerChangeOffsetHeight = -0.9,
MaxAcceleration = 10,-----最大加速度
MaxBrake = 10,-----最大减速/刹车
MaxSpeed = 2.75,-----最大速度
MaxSpeedReverse = 0,-----最大逆向速度
MaxSteerForce = 12,
MotionType = 'RULEUMT_Amphibious',
RotateOnSpot = false,
StandUpright = true,
TurnRate = 130,-----转身速度
},
ResearchUpgrades = {
ICP_AA = {
Weapons = {
AntiAir = true,
},
},
},
SelectionCenterOffsetZ = -0.25,
SelectionMeshOffsetX = 0,
SelectionMeshOffsetY = -0.2,
SelectionMeshOffsetZ = -0.2,
SelectionMeshScaleX = 0.9,
SelectionMeshScaleY = 0.8,
SelectionMeshScaleZ = 0.8,
SelectionSizeX = 1.4,
SelectionSizeZ = 1.2,
SelectionThickness = 0.9,
SelectionYOffset = 0,
SizeX = 3,
SizeY = 6,
SizeZ = 2.5,
StrategicIconName = 'icon_commander_generic',
StrategicIconSortPriority = 0,
Transport = {
StorageSize = 15,-----运输占用空间(原15)
TeleportTime = 1,-----传送用时(原6)
},
Weapons = {
---------------------------以下主炮武器(默认使用)----------------------------------
{
AboveWaterFireOnly = true,
AboveWaterTargetsOnly = true,
AlwaysRecheckTarget = false,
Audio = {
Fire = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Chronotron_Cannon',
},
AutoInitiateAttackOnPatrol = true,
BallisticArc = 'RULEUBA_LowArc',
CollideFriendly = false,
Damage = 400,
DamageFriendly = false,
DamageType = 'Normal',
DisplayName = 'Chronotron Cannon',
FireTargetLayerCaps = {
Land = 'Land|Water|Seabed',
Seabed = 'Land|Water|Seabed',
},
FiringTolerance = 0.2,
Label = 'MainGun',---------主炮
MaxRadius = 20,---------主炮最大射程半径(原20)
MinRadius = 3,---------主炮最小射程半径(原3)
MuzzleChargeDelay = 0.4,
MuzzleChargeEffect = 'Illuminate_Plasma05_Launch02',
MuzzleFlashEffect = 'Illuminate_Plasma05_Launch01',
MuzzleSalvoDelay = 0,
MuzzleSalvoSize = 1,
MuzzleVelocity = 35,
ProjectileId = '/projectiles/Illuminate/IChronCannon01/IChronCannon01_proj.bp',
ProjectileLifetimeUsesMultiplier = 2,
RackBones = {
{
MuzzleBones = {
'UIL0001_T01_Muzzle02',
},
RackBone = 'UIL0001_LeftElbow',
},
},
RackFireTogether = false,
RackRecoilDistance = 0,
RackReloadTimeout = 10,
RackSalvoChargeTime = 0,
RackSalvoReloadTime = 0,
RackSalvoSize = 1,
RackSlavedToTurret = false,
RangeCategory = 'UWRC_DirectFire',
RateOfFire = 0.5,
TargetCheckInterval = 0.5,
TargetPriorities = {
'LAND MOBILE',
'ALLUNITS',
},
TargetRestrictDisallow = 'UNTARGETABLE',
TurretBoneMuzzle = 'UIL0001_T01_Muzzle02',
TurretBonePitch = 'UIL0001_LeftElbow',
TurretBoneYaw = 'UIL0001_Turret01',
TurretDualManipulators = false,
TurretPitch = 0,
TurretPitchRange = 80,
TurretPitchSpeed = 120,
TurretYaw = 0,
TurretYawRange = 180,
TurretYawSpeed = 180,
Turreted = true,
ValidateFiringTrajectory = true,
WeaponCategory = 'Direct Fire',
},
---------------------------以下蓄能武器----------------------------------
{
AboveWaterFireOnly = true,
AboveWaterTargetsOnly = true,
AlwaysRecheckTarget = false,
Audio = {
Fire = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_Chronotron_Overcharge',
},
BallisticArc = 'RULEUBA_None',
CameraShakeDuration = 0.4,
CameraShakeMax = 1.2,
CameraShakeMin = 0.4,
CameraShakeRadius = 30,
CollideFriendly = false,
Damage = 1000,
DamageFriendly = false,
DamageRadius = 10,
DamageType = 'Overcharge',
DisplayName = 'UPGRADE - Chronotron Overcharge Cannon',
FireTargetLayerCaps = {
Land = 'Land|Water|Seabed',
Seabed = 'Land|Water|Seabed',
},
FiringTolerance = 0.2,
InitiallyDisabled = true,
Label = 'OverCharge',---------蓄能
MaxRadius = 30,---------蓄能武器最大半径(原20)
MinRadius = 3,---------蓄能武器最小半径(原3)
MuzzleChargeDelay = 0.4,
MuzzleChargeEffect = 'Illuminate_ChronCannon02_Launch02',
MuzzleFlashEffect = 'Illuminate_ChronCannon02_Launch01',
MuzzleSalvoDelay = 0,
MuzzleSalvoSize = 1,
MuzzleVelocity = 45,
ProjectileId = '/projectiles/Illuminate/IChronCannon02/IChronCannon02_proj.bp',
ProjectileLifetimeUsesMultiplier = 2,
RackBones = {
{
MuzzleBones = {
'UIL0001_T01_Muzzle02',
},
RackBone = 'UIL0001_LeftElbow',
},
},
RackFireTogether = false,
RackRecoilDistance = 0,
RackReloadTimeout = 10,
RackSalvoChargeTime = 0,
RackSalvoReloadTime = 0,
RackSalvoSize = 1,
RackSlavedToTurret = false,
RangeCategory = 'UWRC_DirectFire',
RateOfFire = 1,
SlavedToBody = false,
TargetCheckInterval = 0.2,
TargetPriorities = {
'LAND MOBILE',
'ALLUNITS',
},
TargetRestrictDisallow = 'UNTARGETABLE',
TurretBoneMuzzle = 'UIL0001_T01_Muzzle02',
TurretBonePitch = 'UIL0001_LeftElbow',
TurretBoneYaw = 'UIL0001_Turret01',
TurretDualManipulators = false,
TurretPitch = 0,
TurretPitchRange = 80,
TurretPitchSpeed = 120,
TurretYaw = 0,
TurretYawRange = 180,
TurretYawSpeed = 120,
Turreted = true,
WeaponCategory = 'Experimental',
},
---------------------------以下核爆武器----------------------------------
{
AboveWaterTargetsOnly = true,
AlwaysRecheckTarget = false,
CollideFriendly = false,
Damage = 0,
DamageFriendly = true,
DamageRadius = 0,
DamageType = 'Normal',
DisplayName = 'Death Nuke',
FiringTolerance = 0.2,
InitiallyDisabled = true,
Label = 'DeathWeapon',---------死亡武器
MaxRadius = 1,
MuzzleFlashEffect = 'SDFLaanseMissleMuzzleFlash',
MuzzleSalvoDelay = 0,
MuzzleSalvoSize = 1,
MuzzleVelocity = 0,
NukeData = {
InnerDamage = 3500,
InnerRadius = 20,
InnerToOuterSegmentCount = 10,
OuterDamage = 500,
OuterRadius = 40,
PulseCount = 10,
PulseDamage = 200,
TimeToOuterRadius = 5,
},
ProjectileId = '/effects/Entities/UEFNukeEffectController01/UEFNukeEffectController01_proj.bp',
RackBones = {
{
MuzzleBones = {
0,
},
RackBone = 0,
},
},
RackRecoilDistance = 0,
RateOfFire = 1,
TargetCheckInterval = 9999999,
TargetRestrictDisallow = 'UNTARGETABLE',
Turreted = false,
WeaponCategory = 'Death',
},
---------------------------以下防空武器----------------------------------
{
AboveWaterFireOnly = true,
AlwaysRecheckTarget = false,
Audio = {
RackSalvoBeginFire = 'SC2/SC2/Commanders/ILLUMINATE/UIL0001/snd_UIL0001_ACU_AA_addon',
},
BallisticArc = 'RULEUBA_None',
CannotAttackGround = true,
CollideFriendly = false,
Damage = 125,
DamageFriendly = false,
DamageType = 'Normal',
DisplayName = 'UPGRADE - Linked Railgun',
FireTargetLayerCaps = {
Land = 'Air',
Seabed = 'Air',
},
FiringTolerance = 0.2,
InitiallyDisabled = true,
Label = 'AntiAir',---------防空
MaxRadius = 32,---------防空武器最大半径(原32)
MuzzleFlashEffect = 'Illuminate_AntiAir01_Launch01',
MuzzleSalvoDelay = 0.1,
MuzzleSalvoSize = 2,
MuzzleVelocity = 45,
ProjectileId = '/projectiles/Illuminate/IAntiAir04/IAntiAir04_proj.bp',
ProjectileLifetimeUsesMultiplier = 2,
ProjectilesPerOnFire = 2,
RackBones = {
{
MuzzleBones = {
'UIL0001_T02_B01_Muzzle01',
'UIL0001_T02_B01_Muzzle02',
},
RackBone = 'UIL0001_T02_Barrel01',
},
},
RackRecoilDistance = 0,
RackRecoilReturnSpeed = 0,
RackReloadTimeout = 10,
RackSalvoChargeTime = 0,
RackSalvoReloadTime = 0,
RackSalvoSize = 1,
RackSlavedToTurret = true,
RangeCategory = 'UWRC_AntiAir',
RateOfFire = 1,
TargetCheckInterval = 0.5,
TargetPriorities = {
'AIR MOBILE',
'ALLUNITS',
},
TargetRestrictDisallow = 'UNTARGETABLE,STRUCTURE,NAVAL',
TrackingRadius = 1.4,
TurretBoneMuzzle = 'UIL0001_T02_B01_Muzzle01',
TurretBonePitch = 'UIL0001_T02_Barrel01',
TurretBoneYaw = 'UIL0001_Turret02',
TurretPitch = 0,
TurretPitchRange = 80,
TurretPitchSpeed = 360,
TurretYaw = 0,
TurretYawRange = 360,
TurretYawSpeed = 360,
Turreted = true,
WeaponCategory = 'Anti Air',
},
},
Wreckage = {
Blueprint = '/props/Wreckage/Illuminate/UIL0001/UIL0001_wreckage01_prop.bp',
EnergyMult = 0,
HealthMult = 0.9,
MassMult = 0.2,
ReclaimTimeMultiplier = 0.1,
UseCustomMesh = true,
WreckageLayers = {
Land = true,
},
},
}
《最高指挥官2》给单位加护盾,怎么修改?(以Illuminate族质能采集站为例)
第1步:
打开护盾生成器的代码文件:uncompiled_lua.scd\uncompiled\Units\Illuminate\UIB0202\UIB0202_unit.bp
查找到Defense函数,复制其中Shield函数包含的所有代码。
Defense = {
AirThreatLevel = 10,
EconomyThreatLevel = 5,
Health = 1500,
MaxHealth = 1500,
RegenRate = 4,
Shield = { -------Shield函数起始行
AllowPenetration = true,
CollisionOffsetY = -4,
CollisionShape = 'Sphere',
ImpactEffects = 'ShieldHit01',
Mesh = '/meshes/Shield/Shield03_mesh',
PanelArray = {
Panel_1 = '/meshes/Shield/ShieldDomeSection05_mesh',
Panel_2 = '/meshes/Shield/ShieldDomeSection06_mesh',
},
ShieldDamageAbsorb = 0.85,
ShieldMaxHealth = 10000,
ShieldRechargeTime = 40,
ShieldReflectChance = 0.5,
ShieldReflectRandomVector = true,
ShieldRegenRate = 50,
ShieldSize = 46,
ShieldType = 'Panel',
}, -------Shield函数结束行
SurfaceThreatLevel = 10,
},
第2步:
打开质能采集站的代码文件:bp.scd\Units\Illuminate\UIB0701\UIB0701_unit.bp
查找到Defense函数,在函数内空出一行,粘贴第1步中复制的Shield函数代码,粘贴完后的代码如下:
Defense = {
AirThreatLevel = 0,
EconomyThreatLevel = 20,
Health = 4000,
MaxHealth = 4000,
RegenRate = 10,
SurfaceThreatLevel = 0,
Shield = { -------Shield函数起始行
AllowPenetration = true,
CollisionOffsetY = -4,
CollisionShape = 'Sphere',
ImpactEffects = 'ShieldHit01',
Mesh = '/meshes/Shield/Shield03_mesh',
PanelArray = {
Panel_1 = '/meshes/Shield/ShieldDomeSection05_mesh',
Panel_2 = '/meshes/Shield/ShieldDomeSection06_mesh',
},
ShieldDamageAbsorb = 0.85,
ShieldMaxHealth = 10000,
ShieldRechargeTime = 40,
ShieldReflectChance = 0.5,
ShieldReflectRandomVector = true,
ShieldRegenRate = 50,
ShieldSize = 46,
ShieldType = 'Panel',
}, -------Shield函数结束行
},
保存后Illuminate族质能采集站就有了护盾(如图所示)。
本帖最后由 阿136793878 于 2024-10-13 13:16 编辑
其它修改
1.《最高指挥官2》单位/人口上限修改:
文件路径:C:\Users\用户名\AppData\Local\Gas Powered Games\Supreme Commander 2\Game.prefs
查找到UnitCap将等号后面的数字改成1000即可。
2.《最高指挥官2》UEF族的电厂/发电站共享给另外两族,这样你玩其它族也能用这个电厂维护基地。
文件路径:bp.scd\Units\UEF\UUB0702\UUB0702_unit.bp
查找到Categories函数,加入如下2行代码即可。
Categories = {
'PRODUCTSC2',
'SELECTABLE',
'BUILTBYMOBILE',
'BUILTBYCOMMANDER',
'STRUCTURE',
'LAND',
'TECH1',
'ECONOMIC',
'ENERGYPRODUCTION',
'ENERGYEXTRACTION',
'SIZE4',
'VISIBLETORECON',
'DRAGBUILD',
'RECLAIMABLE',
'SORTECONOMY',
'UEF',
'ILLUMINATE',------新增(发电站属于Illuminate族)
'CYBRAN',------新增(发电站属于Cybran族)
'UIBASICSORTCATEGORY',
'REBUILDER',
},
3.《最高指挥官2》逃生舱修改成能建造任何一族的指挥官(以Illuminate族逃生舱为例)
文件路径:bp.scd\Units\Illuminate\UIM0001\UIM0001_unit.bp
查找到以下函数,加入如下2行代码即可
Economy = {
BuildRate = 2.5,
BuildTime = 10,
BuildableCategory = {
'BUILTBYESCAPEPOD ILLUMINATE',
'BUILTBYESCAPEPOD UEF',--------新增(可建造UEF族指挥官)
'BUILTBYESCAPEPOD CYBRAN',---------新增(可建造Cybran族指挥官)
},
CaptureTimeMult = 0.6,
EnergyValue = 100,
MassValue = 100,
MaxBuildDistance = 10,
NaturalProducer = false,
ProductionPerSecondEnergy = 150,
ProductionPerSecondMass = 50,
ProductionPerSecondResearch = 0,
}, 本帖最后由 阿136793878 于 2024-10-18 22:53 编辑
《最高指挥官2》超强防御:水下生产黑洞
文件路径:bp.scd\Units\Illuminate\UIB0011\UIB0011_unit.bp(不勾选DLC)
文件路径:z_lua_dlc1.scd\mods\DLC1\shadow\Units\Illuminate\UIB0011\UIB0011_unit.bp(勾选DLC)
打开Illuminate族实验级工厂,找到如下函数并加入两行代码,使工厂能在水下建造。
BuildOnLayerCaps = {
LAYER_Land = true,
LAYER_Water = true,-----新增这一行(可在水上建造)
LAYER_Seabed = true,-----新增这一行(可在水下建造)
},
使用水下的工厂生产黑洞,在敌军必经之地设防,黑洞在水下几乎无法被攻击。
本帖最后由 阿136793878 于 2024-11-1 21:47 编辑
《最高指挥官2》Illuminate族电厂改成激光武器自动攻击。
第一步:
文件路径:bp.scd\abilities\Electroshock_Ability.bp
打开以上路径文件,查找到Cooldown并把等号后面的数字改成1,使冻结时间变成1。再查找到SourceAmount并把等号后面的数字改成0,使消耗电量变成0。
第二步:
文件路径:z_lua_dlc1.scd\mods\DLC1\shadow\Units\Illuminate\UIB0702\UIB0702_unit.bp
打开以上路径文件,查找到InitiallyDisabled并将等号后面的true改成false,使激光武器能自动攻击。
如果想把武器改成能对空攻击,再查找到函数FireTargetLayerCaps,把大括号中的 Land = 'Land|Water|Seabed',改成Land = 'Land|Air|Water|Seabed',使武器能对空攻击。
楼主你好,感谢你的教程,想咨询一个问题,尝试给一个没有维修功能的实验级单位添加维修,从工程车那里复制添加了这段代码
Build = {
AssistMultiplier = 1,
BuildArmManipulators = {
{
AimBone = 'T01_B01_Muzzle01',
PitchBone = 'T01_Barrel01',
YawBone = 'Turret01',
},
},
EffectBones = {
'T01_B01_Muzzle01',
'T01_B01_Muzzle02',
'T01_B01_Muzzle03',
},
MaxRepairDistance = 45,
RepairScanRadius = 50,
RepairTargetCheckInterval = 1,
},
到了游戏里,维修的时候没有绿色光效,而且必须我选中维修目标下命令才能修,有没有什么办法能让他显示光效还有像原版工程车一样自动维修范围内的残血 本帖最后由 阿136793878 于 2024-12-3 23:20 编辑
power2021 发表于 2024-11-28 20:29
楼主你好,感谢你的教程,想咨询一个问题,尝试给一个没有维修功能的实验级单位添加维修,从工程车那里复制 ...
已更新,请参考下一楼的修改内容。
本帖最后由 阿136793878 于 2024-12-3 23:22 编辑
power2021 发表于 2024-11-28 20:29
楼主你好,感谢你的教程,想咨询一个问题,尝试给一个没有维修功能的实验级单位添加维修,从工程车那里复制 ...
终于搞定了,可以自动维修,也有激光效果。
我把Illuminate族的质能采集站改成有自动维修功能(把UEF族电厂的维修功能移植过来),具体方法如下:
文件路径:z_lua_dlc1.scd\mods\DLC1\shadow\Units\Illuminate\UIB0701\UIB0701_unit.bp
第1步:打开以上路径文件,找到以下函数并加入如下1行代码
Categories = {
'PRODUCTSC2',
'SELECTABLE',
'BUILTBYMOBILE',
'BUILTBYCOMMANDER',
'STRUCTURE',
'LAND',
'TECH1',
'ECONOMIC',
'MASSPRODUCTION',
'MASSEXTRACTION',
'SIZE4',
'VISIBLETORECON',
'RECLAIMABLE',
'SORTECONOMY',
'ILLUMINATE',
'UIBASICSORTCATEGORY',
'REBUILDER',------------------------新增
},
第2步:在Build函数中加入以下代码:
Build = {
BuildScaffoldUnit = 'uib0022',
UseBuildMaterial = true,
-------------------新增----------------------
BuildArmManipulators = {
{
AimBone = 'UIB0701_Exhaust01',
PitchBone = 'UIB0701_Exhaust01',
YawBone = 'UIB0701_Exhaust01',
},
},
BuildModifiersExclusionCategory = {
'EXPERIMENTAL',
},
EffectBones = {
'UIB0701_Exhaust01',
'UIB0701_Exhaust02',
'UIB0701_Exhaust03',
'UIB0701_Exhaust04',
},
MaxRepairDistance = 95,----最大维修距离
RepairScanRadius = 100,----最大探测距离(探测需要维修的单位)
RepairTargetCheckInterval = 0.2,
-------------------新增----------------------
},
第3步:找到以下函数,并加入如下1行代码
Economy = {
RepairRate = 5,--------维修速度(新增)
BuildTime = 25,
CaptureTimeMult = 0.6,
EnergyValue = 500,
MassValue = 200,
ProductionPerSecondMass = 1.2
RebuildBonusIds = {
'UIB0701',
},
SacrificeCaptureTimeMult = 0.2,
},
第4步:找到General函数并加入如下维修功能代码
General = {
-------------------新增----------------------
CommandCaps = {
RULEUCC_Repair = true,-----维修
RULEUCC_Stop = true,-----停止
},
-------------------新增----------------------
BuildIconIndex = 7,
BuildIconPage = 1,
BuildIconSortPriority = 60,
ExperienceValue = 1000,
FactionName = 'Illuminate',
Icon = 'land',
SelectionPriority = 5,
UnitName = '<LOC UNIT_NAME_0109>Mass Extractor',
UnitWeight = 1,
},
到这里,完成了单位的代码修改
接着还需要改脚本代码,如下:
1.打开uncompiled_lua.scd\uncompiled\Units\UEF\UUB0702\UUB0702_script.lua文件并复制全部代码。
2.打开z_lua_dlc1.scd\mods\DLC1\shadow\Units\Illuminate\UIB0701\UIB0701_script.lua文件,用刚复制的代码覆盖原有的代码。
3.把代码中有两处带等号的UUB0702改成UIB0701,再将self:SetBuilderAutoRepair(false)改成self:SetBuilderAutoRepair(true)并保存。
到此所有修改就完成了。
本帖最后由 阿136793878 于 2024-12-3 23:11 编辑
阿136793878 发表于 2024-12-3 22:49
终于搞定了,可以自动维修,也有激光效果。
我把Illuminate族的质能采集站改成有自动维修功能(把UEF族电 ...
我把完整代码贴出来,有个地方竟然自动变成表情包,我怕有人弄错,所以又删了完整的代码
《最高指挥官2》创建新的单位(利用游戏已有的素材),方法如下:
实例:给Cybran族创建一个新的防空塔单位,命名为UCB0102B。
第1点:需要的单位模型,纹理等等一些基本素材,在units.scd\units\Cybran\UCB0102文件夹中(9个文件)。
第2点:需要的代码素材,在uncompiled_lua.scd\uncompiled\Units\Cybran\UCB0102文件夹中(2个文件)。
第3点:需要的图标素材,在textures.scd\textures\ui\common\icons\hud\units文件夹中(3个文件),
以及在textures.scd\textures\ui\common\icons\hud\pc_units文件夹中(1个文件)。
素材有了,游戏如何才会调用这些素材呢?
在gamedata文件夹中创建一个新的文件夹,命名需要以.scd结尾,比如命名为123.scd或者newunit.scd都可以,甚至用中文命名也可以,但必须是以.scd结尾,游戏才会调用,此次举例文件夹名为123.scd。
接着把上面第1点中9个文件和第2点中2个文件复制到以下路径文件夹中:
123.scd\units\Cybran\UCB0102B
(路径中的文件夹,请自行创建)
把这些文件全部重新命名,名字中的UCB0102全部改为UCB0102B
再把上面第3点中textures.scd\textures\ui\common\icons\hud\units中名字带有UCB0102的文件复制到以下路径中:123.scd\textures\ui\common\icons\hud\units
把第3点中textures.scd\textures\ui\common\icons\hud\pc_units中名字带有UCB0102的文件复制到以下路径中:123.scd\textures\ui\common\icons\hud\pc_units
(路径中的文件夹,请自行创建)
把这些文件全部重新命名,名字中的UCB0102全部改为UCB0102B
重命名后的文件如图所示。
然后,脚本代码文件UCB0102B_script.lua需要打开,把里面所有地方的UCB0102全部改为UCB0102B并保存。
到此新单位创建就完成了,启动游戏可以看到新创建的单位。 本帖最后由 阿136793878 于 2024-12-14 12:03 编辑
阿136793878 发表于 2024-12-5 08:39
《最高指挥官2》创建新的单位(利用游戏已有的素材),方法如下:
实例:给Cybran族创建一个新的防空塔单 ...
把新创建的单位UCB0102B放大尺寸,并改成公用单位,修改武器,能对地、对空攻击,防御能力很强(效果如图)。
修改文件路径:123.scd\units\Cybran\UCB0102B\UCB0102B_unit.bp
修改后的完整代码如下(修改的部分已全部有注释说明):
UnitBlueprint {
Abilities = {
{
Blueprint = 'PowerDetonate',
},
},
Audio = {
-- DoneBeingBuilt = 'SC2/SC2/Buildings/CYBRAN/UCB0102/snd_UCB0102_AADefense_Activate',
Killed = 'SC2/SC2/Destructions/Explosions/CYBRAN/snd_Destroy_Lrg_PreDestroy',
OnReclaimed = 'SC2/SC2/Destructions/Explosions/UEF/snd_Destroy_Sml_Land',
UISelection = 'SC2/SC2/Selection/snd_GENERIC_Select_Building',
},
Build = {
---BuildScaffoldUnit = 'ucb0022',-----建造使用的脚手架
BuildSliderBone = 'UCB0102',
BuildSliderY = -2,
UseBuildMaterial = true,
},
Categories = {
'PRODUCTSC2',
'SELECTABLE',
'BUILTBYMOBILE',
'STRUCTURE',
'LAND',
'TECH1',
'ANTIAIR',
'DEFENSE',
'DRAGBUILD',
'SIZE4',
'VISIBLETORECON',
'RECLAIMABLE',
'OVERLAYANTIAIR',
'SORTDEFENSE',
'ILLUMINATE',-----所属派别
'CYBRAN',-----所属派别
'UEF',-----所属派别
'UIADVANCEDSORTCATEGORY',------高级单位(在建造栏第2页)
},
CollisionOffsetY = -0.25,
CollisionOffsetZ = -0.25,
Death = {
DestructionParts = {
{
AttachBone = 'Turret01',
Mesh = '/projectiles/debris/Cybran/UCB0102/UCB0102_Turret_Debris_01_mesh',
Projectile = '/projectiles/debris/DebrisGenericMedium01/DebrisGenericMedium01_proj.bp',
},
},
ExplosionEffect = 'CybranStructureDestroyEffectsSmall01',
ExplosionEffectScale = 0.5,
},
Defense = {
AirThreatLevel = 5,
EconomyThreatLevel = 0,
Health = 30000,-----生命值
MaxHealth = 30000,-----最大生命值
RegenRate = 20,------自动恢复生命速度
SurfaceThreatLevel = 0,
},
Description = '<LOC UNIT_DESCRIPTION_0008>Land Defense Tower',----单位描述(名称下面小字体)
Display = {
DamageEffects = {
{
Bone = 0,
OffsetX = 0,
OffsetY = 0.75,
OffsetZ = 0,
},
},
DisplayName = '<LOC UNIT_NAME_0018>High Damage Anti-Air Tower',----单位名称
IdleEffects = {
Water = {
Effects = {
{
Bones = {
'UCB0102',
},
Type = 'SeaIdle02',
},
},
},
},
Mesh = {
IconFadeInZoom = 130,
LODs = {
{
LODCutoff = 50,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/Cybran_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/units/shared/illuminatebuild.dds',
RampName = '/textures/Units/Shared/Ramps/Cybran_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow, chrome, build_overlay',
},
},
Name = 'Build',
},
},
},
{
LODCutoff = 100,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/Cybran_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, point_cloud',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/units/shared/illuminatebuild.dds',
RampName = '/textures/Units/Shared/Ramps/Cybran_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, point_cloud, chrome, build_overlay',
},
},
Name = 'Build',
},
},
},
{
LODCutoff = 500,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/Cybran_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, ambient_occlusion, team_color, point_cloud',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/units/shared/illuminatebuild.dds',
RampName = '/textures/Units/Shared/Ramps/Cybran_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, ambient_occlusion, team_color, point_cloud, chrome, build_overlay',
},
},
Name = 'Build',
},
},
},
},
},
UniformScale = 0.25,------单位在游戏中显示的比例(原0.1)
},
Economy = {
BuildTime = 28,
CaptureTimeMult = 0.6,
EnergyValue = 500,
MassValue = 200,
RebuildBonusIds = {
'UCB0102',-----(建筑类单位)在残骸原位重建耗费资源更少,显示会出现蓝色线框
},
SacrificeCaptureTimeMult = 0.2,
},
Footprint = {
MinWaterDepth = 1,
SizeX = 6,----封装尺寸(占地尺寸,原2)
SizeZ = 6,----封装尺寸(占地尺寸,原2)
},
General = {
BuildIconIndex = 7,
BuildIconPage = 1,
BuildIconSortPriority = 180,
CommandCaps = {
RULEUCC_Attack = true,
RULEUCC_RetaliateToggle = true,
RULEUCC_Stop = true,
},
ExperienceTable = 'TURRET',
ExperienceValue = 300,
FactionName = 'Cybran',
Icon = 'amph',
SelectionPriority = 5,
UnitName = '<LOC UNIT_NAME_0019>High Damage Anti-Air Tower',
UnitWeight = 1,
},
Intel = {
VisionRadius = 150,
},
LifeBarHeight = 0.25,-----血条高度(原0.12)
LifeBarOffset = 0.35,
LifeBarSize = 3.0,-----血条长度(原0.9)
Navigation = {
CostStamp = '/coststamps/Default/Default2x2_coststamp.lua',
},
Physics = {
BankingSlope = 0,
BuildOnLayerCaps = {
LAYER_Land = true,
LAYER_Water = true,
},
MaxSteerForce = 0,
MeshExtentsX = 1,
MeshExtentsY = 1.25,
MeshExtentsZ = 1,
MotionType = 'RULEUMT_None',
OccupyGround = true,
},
SelectionCenterOffsetZ = -0.05,
SelectionMeshOffsetX = 0,
SelectionMeshOffsetY = 0.2,
SelectionMeshOffsetZ = -0.2,
SelectionMeshScaleX = 0.7,
SelectionMeshScaleY = 0.8,
SelectionMeshScaleZ = 0.8,
SelectionSizeX = 3.3,------选中单位后边缘的亮光尺寸(原1.1)
SelectionSizeZ = 3.3,------选中单位后边缘的亮光尺寸(原1.1)
SelectionThickness = 1,
SizeX = 1,
SizeY = 2.7,
SizeZ = 1,
StrategicIconName = 'icon_structure_antiair',
StrategicIconSortPriority = 205,
Weapons = {
{
AlwaysRecheckTarget = false,
Audio = {
Fire = 'SC2/SC2/Buildings/CYBRAN/UCB0102/snd_UCB0102_AADefense_Shleo_AA_Autogun',---开火声音
},
BallisticArc = 'RULEUBA_None',
---CannotAttackGround = false,-------原true
CollideFriendly = false,
Damage = 300,-------伤害(原150)
DamageFriendly = false,
DamageRadius = 10,---------伤害半径
DamageType = 'Normal',
DisplayName = 'Linked Railgun',
FireTargetLayerCaps = {
Air = 'Air|Land|Water|Seabed',-----陆海空都能打
Land = 'Air|Land|Water|Seabed',-----陆海空都能打
Water = 'Air|Land|Water|Seabed',-----陆海空都能打
},
FiringRandomness = 0,
FiringTolerance = 0.2,
Label = 'AntiAir01',
MaxRadius = 60,-----射程半径(原66)
MuzzleFlashEffect = 'Cybran_AntiAir01_Launch01',
MuzzleSalvoDelay = 0,
MuzzleSalvoSize = 1,
MuzzleVelocity = 45,-------抛射体飞行速度(原45)
ProjectileId = '/projectiles/UEF/UCannon01/UCannon01_proj.bp',----蓄能武器的抛射效果
ProjectileLifetimeUsesMultiplier = 2,
ProjectilesPerOnFire = 1,
RackBones = {
{
MuzzleBones = {
'T01_B01_Muzzle01',
},
RackBone = 'T01_Barrel01',
},
{
MuzzleBones = {
'T01_B04_Muzzle01',
},
RackBone = 'T01_Barrel04',
},
{
MuzzleBones = {
'T01_B02_Muzzle01',
},
RackBone = 'T01_Barrel02',
},
{
MuzzleBones = {
'T01_B05_Muzzle01',
},
RackBone = 'T01_Barrel05',
},
{
MuzzleBones = {
'T01_B03_Muzzle01',
},
RackBone = 'T01_Barrel03',
},
{
MuzzleBones = {
'T01_B06_Muzzle01',
},
RackBone = 'T01_Barrel06',
},
},
RackFireTogether = false,
RackRecoilDistance = -1.5,
RackReloadTimeout = 10,
RackSalvoChargeTime = 0,
RackSalvoReloadTime = 0,
RackSalvoSize = 1,
RackSlavedToTurret = false,
RangeCategory = 'UWRC_AntiAir',
RateOfFire = 9,--------------------------开火速度(原1.5)
TargetCheckInterval = 0.5,
TargetPriorities = {
---'AIR MOBILE',------优先攻击空中移动单位
'LAND MOBILE',------优先攻击地面移动单位
'ALLUNITS',
},
TargetRestrictDisallow = 'UNTARGETABLE',---驳回攻击目标(鼠标无法点击攻击的目标)
TrackingRadius = 1.4,
TurretBoneMuzzle = 'T01_Rack01',
TurretBonePitch = 'T01_Rack01',
TurretBoneYaw = 'Turret01',
TurretDualManipulators = false,
TurretPitch = 45,
TurretPitchRange = 80,
TurretPitchSpeed = 360,
TurretYaw = 0,
TurretYawRange = 180,
TurretYawSpeed = 360,
Turreted = true,
WeaponCategory = 'Anti Air',
},
{
Damage = 2000,
DamageFriendly = false,
DamageRadius = 15,
DamageType = 'Normal',
DisplayName = 'Power Detonate',
DummyWeapon = true,
ExplosionEffect = 'PowerDetonateEffectsSmall01',
Label = 'PowerDetonate',
WeaponCategory = 'Death',
},
},
Wreckage = {
Blueprint = '/props/Wreckage/Cybran/UCB0102/UCB0102_Wreckage01_prop.bp',
Decay = 360,
EnergyMult = 0,
HealthMult = 0.9,
MassMult = 0.2,
ReclaimTimeMultiplier = 0.1,
UseCustomMesh = true,
WreckageLayers = {
Land = true,
Seabed = true,
Water = true,
},
},
}
《最高指挥官2》分享自己创建的一个火炮,几乎是全能类型。
功能:海陆空都能打,+维修功能+俘获/占领功能+电厂+质能采集+电能转换+护盾
按18楼的方法创建这个单位,我把创建好的单位代码贴出来。
文件路径:123.scd\units\GY\UUX0115B\UUX0115B_unit.bp
详细代码如下:
UnitBlueprint {
Abilities = {
{
Blueprint = 'DisruptorStation',-----干扰功能
},
{
Blueprint = 'ConvertEnergy',-----电能转换功能(新增)
},
},
Audio = {
ActivateDisruptor = 'SC2/SC2/Experimentals/UEF/UUX0115/snd_UUX0115_DisruptStation_Activation',
DeathExplosion = 'SC2/SC2/Destructions/Explosions/UEF/snd_Destroy_Lrg_PreDestroy',
Destroyed = 'SC2/SC2/Destructions/Explosions/UEF/snd_Destroy_Huge',
OnReclaimed = 'SC2/SC2/Destructions/Explosions/UEF/snd_Destroy_Med_Land',
UISelection = 'SC2/SC2/Selection/snd_GENERIC_Select_Experimentals',
},
Build = {
---BuildScaffoldUnit = 'uub0021',-----建造使用的脚手架
UseBuildMaterial = true,
-------------------新增----------------------
BuildArmManipulators = {
{
AimBone = 'Turret01',
PitchBone = 'Turret01',
YawBone = 'Turret01',
},
},
BuildModifiersExclusionCategory = {
'EXPERIMENTAL',
},
EffectBones = {
'Disk01',---维修激光效果射出点
---'Disk02',---维修激光效果射出点
'Disk03',---维修激光效果射出点
---'Disk04',---维修激光效果射出点
},
MaxRepairDistance = 95,----最大维修距离
RepairScanRadius = 100,----最大探测距离(探测需要维修的单位)
RepairTargetCheckInterval = 0.2,
-------------------新增----------------------
},
Categories = {
'PRODUCTSC2',
'SELECTABLE',
'BUILTBYTIER3ENGINEER',
'BUILTBYTIER3COMMANDER',
'BUILTBYMOBILE',
'LAND',
'STRUCTURE',
'TECH1',
'DRAGBUILD',
'SIZE12',
'VISIBLETORECON',
'RECLAIMABLE',
'ANTISURFACE',
'REBUILDER',-----新增(维修)
'CAPTURE',-----新增(俘获/占领)
'ILLUMINATE',-----所属派别
'CYBRAN',-----所属派别
'UEF',-----所属派别
'UIADVANCEDSORTCATEGORY',------高级单位(在建造栏第2页)
},
Death = {
DebrisPieces = true,
DestructionParts = {
{
AttachBone = 'Turret01',
Meshes = {
'/projectiles/debris/UEF/UUX0115/UUX0115_Turret_Debris_01_mesh',
'/projectiles/debris/UEF/UUX0115/UUX0115_Turret_Debris_02_mesh',
},
Projectile = '/projectiles/debris/DebrisGenericLow01/DebrisGenericLow01_proj.bp',
},
{
AttachBone = 'Disk03',
Mesh = '/projectiles/debris/UEF/UUX0115/UUX0115_Turret_Debris_03_mesh',
Projectile = '/projectiles/debris/DebrisGenericMedium01/DebrisGenericMedium01_proj.bp',
},
{
AttachBone = 'Disk02',
Mesh = '/projectiles/debris/UEF/UUX0115/UUX0115_Turret_Debris_03_mesh',
Projectile = '/projectiles/debris/DebrisGenericMedium01/DebrisGenericMedium01_proj.bp',
},
},
ExplosionEffect = 'UEFStructureDestroyEffectsExtraLarge02',
ExplosionTendrils = true,
},
Defense = {
AirThreatLevel = 0,
EconomyThreatLevel = 20,
Health = 35000,-----生命值
MaxHealth = 35000,-----最大生命值
RegenRate = 29,------自动恢复生命速度
SurfaceThreatLevel = 0,
Shield = {
AllowPenetration = false,
CollisionOffsetY = -1,
CollisionShape = 'Sphere',
ImpactEffects = 'ShieldHit01',
Mesh = '/meshes/Shield/Shield01_mesh',
PanelArray = {
Panel_1 = '/meshes/Shield/ShieldDomeSection01_mesh',
Panel_2 = '/meshes/Shield/ShieldDomeSection02_mesh',
},
ShieldMaxHealth = 10000,-----护盾最大生命值
ShieldRechargeTime = 40,
ShieldRegenRate = 100,
ShieldSize = 40,-----护盾尺寸(俘获半径两倍,方便看出俘获距离)
ShieldType = 'Panel',
},
},
---Description = '<LOC UNIT_DESCRIPTION_0127>Experimental Quantum Distortion Artillery',
Description = '<LOC UNIT_DESCRIPTION_0008>Land Defense Tower',------已修改
Display = {
---DisplayName = '<LOC UNIT_NAME_0254>Disruptor Station',
DisplayName = '<LOC UNIT_NAME_0018>High Damage Anti-Air Tower',------已修改
Mesh = {
IconFadeInZoom = 130,
LODReduceImmune = true,
LODs = {
{
LODCutoff = 150,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/UEF_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/units/shared/illuminatebuild.dds',
RampName = '/textures/Units/Shared/Ramps/UEF_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow, chrome, build_overlay',
},
},
Name = 'Build',
},
},
},
{
LODCutoff = 300,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/UEF_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/units/shared/illuminatebuild.dds',
RampName = '/textures/Units/Shared/Ramps/UEF_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, specular_lighting, ambient_occlusion, team_color, environment_mapping, point_cloud, glow, chrome, build_overlay',
},
},
Name = 'Build',
},
},
},
{
LODCutoff = 9001,
MaterialSets = {
{
Materials = {
{
RampName = '/textures/Units/Shared/Ramps/UEF_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, ambient_occlusion, environment_mapping, team_color, point_cloud',
},
},
Name = 'Base',
},
{
Materials = {
{
EffectName = '/textures/units/shared/illuminatebuild.dds',
RampName = '/textures/Units/Shared/Ramps/UEF_Ramp01.dds',
ShaderMacros = 'ambient_lighting, diffuse_lighting, ambient_occlusion, environment_mapping, team_color, point_cloud, chrome, build_overlay',
},
},
Name = 'Build',
},
},
},
},
},
Tarmacs = {
{
DeathLifetime = 300,
FadeOut = 150,
Length = 12.8,
Orientations = {
0,
90,
180,
270,
},
RemoveWhenDead = false,
Width = 12,
},
},
UniformScale = 0.1075,------单位在游戏中显示的比例
},
Economy = {
RepairRate = 5,------维修速度(新增)
BuildTime = 90,------建造耗时(原190)
CaptureRate = 5,-----俘获/占领速度(新增)
CaptureTimeMult = 0.6,
MaxCaptureDistance = 20,-----俘获/占领最大距离(新增,同护盾半径)
EnergyValue = 500,------建造消耗电量(原3850)
MassValue = 500,------建造消耗质能值(原1140)
ProductionPerSecondMass = 1.8,-----每秒产生质能(新增)
ProductionPerSecondEnergy = 90,-----每秒产生电量(新增)
RebuildBonusIds = {
'UUX0115',-----(建筑类单位)在残骸原位重建耗费资源更少,显示会出现蓝色线框
},
SacrificeCaptureTimeMult = 0.2,
},
Footprint = {
SizeX = 14,----封装尺寸X
SizeZ = 14,----封装尺寸Z
},
General = {
BuildIconIndex = 8,
BuildIconPage = 3,
BuildIconSortPriority = 210,
CommandCaps = {
RULEUCC_Attack = true,
RULEUCC_RetaliateToggle = true,
RULEUCC_Repair = true,-----维修(新增)
RULEUCC_Capture = true,-----俘获/占领
RULEUCC_Stop = true,-----停止
},
ExperienceTable = 'MAJOR',
ExperienceValue = 4500,
FactionName = 'UEF',
Icon = 'land',
SelectionPriority = 5,
UnitName = '<LOC UNIT_NAME_0255>Disruptor Station',
UnitWeight = 1,
},
Intel = {
VisionRadius = 280,-----视野半径(原28)
},
LifeBarHeight = 0.32,-----血条高度(原0.32)
LifeBarOffset = 5.2,
LifeBarSize = 12.5,-----血条长度(原12.5)
Navigation = {
CostStamp = '/coststamps/Default/Default14x14_coststamp.lua',
},
Physics = {
BankingSlope = 0,
BuildOnLayerCaps = {
LAYER_Land = true,
LAYER_Water = true,------新增
},
MaxSteerForce = 0,
MotionType = 'RULEUMT_None',
OccupyGround = true,
},
SelectionCenterOffsetZ = -0.1,
SelectionMeshOffsetX = 0,
SelectionMeshOffsetY = -2,
SelectionMeshOffsetZ = 0,
SelectionMeshScaleX = 0.95,
SelectionMeshScaleY = 0.2,
SelectionMeshScaleZ = 0.95,
SelectionSizeX = 8.9,------选中单位后边缘的亮光尺寸(原8.9)
SelectionSizeZ = 8.9,------选中单位后边缘的亮光尺寸(原8.9)
SelectionThickness = 0.4,
SizeX = 12,
SizeY = 2.5,
SizeZ = 12,
StrategicIconName = 'icon_experimental_generic',
StrategicIconSortPriority = 200,
Weapons = {
{
AboveWaterTargetsOnly = true,
Audio = {
BarrelLoop = 'SC2/SC2/Experimentals/UEF/UUX0115/snd_UUX0115_DisruptStation_Turret_Loop',
RackSalvoBeginFire = 'SC2/SC2/Experimentals/UEF/UUX0115/snd_UUX0115_DisruptStation_LongRangeGun',
},
BallisticArc = 'RULEUBA_None',-----抛射幅度(原RULEUBA_HighArc)
CameraShakeDuration = 0.4,
CameraShakeMax = 0.8,
CameraShakeMin = 0.3,
CameraShakeRadius = 50,
CollideFriendly = false,
Damage = 180,-------伤害值(原750)
DamageFriendly = false,
DamageRadius = 5,---------伤害半径(原7)
DamageType = 'Normal',
DisplayName = 'Disruptor Cannon',
FireTargetLayerCaps = {
Air = 'Air|Land|Water|Seabed',-----陆海空都能打
Land = 'Air|Land|Water|Seabed',-----陆海空都能打
Water = 'Air|Land|Water|Seabed',-----陆海空都能打
},
FiringRandomness = 0.9,
FiringTolerance = 2,
Label = 'MainGun',-------主炮
MaxRadius = 120,-----最大射程半径(原750)
MinRadius = 0,-----最小射程半径(原50)
MuzzleFlashEffect = 'UEF_DisruptorArtillery01_Launch01',
MuzzleSalvoDelay = 0,
MuzzleSalvoSize = 1,
MuzzleVelocity = 200,-------炮弹速度(原61)
MuzzleVelocityReduceDistance = 80,-----炮弹开始减速距离(原700)
ProjectileId = '/projectiles/UEF/UCannon01/UCannon01_proj.bp',----蓄能武器的抛射效果
ProjectileLifetime = 120,
ProjectilesPerOnFire = 4,-----每次开火打出几发炮弹(原4)
RackBones = {
{
MuzzleBones = {
'T01_B01_Muzzle01',
'T01_B01_Muzzle02',
'T01_B01_Muzzle03',
'T01_B01_Muzzle04',
},
RackBone = 'T01_Barrel01',
},
},
RackFireTogether = true,
RackRecoilDistance = -6,
RackReloadTimeout = 2,
RackSalvoChargeTime = 0,
RackSalvoReloadTime = 0,
RackSalvoSize = 1,
RackSlavedToTurret = false,
RangeCategory = 'UWRC_IndirectFire',
RateOfFire = 1.5,----------------开火速度/频率(原0.1)
StunChance = 0.125,
StunDuration = 2.5,
TargetCheckInterval = 5,
TargetPriorities = {
---'AIR MOBILE',------优先攻击空中移动单位
---'LAND MOBILE',------优先攻击地面移动单位
'ALLUNITS',
},
TargetRestrictDisallow = 'UNTARGETABLE',---驳回攻击目标(鼠标无法点击攻击的目标)
TrackingRadius = 1.15,
TurretBoneMuzzle = 'T01_B01_Muzzle03',
TurretBonePitch = 'T01_Barrel01',
TurretBoneYaw = 'Turret01',
TurretDualManipulators = false,
TurretPitch = 30,
TurretPitchRange = 60,
TurretPitchSpeed = 80,--------炮管上下摆动速度(原8)
TurretYaw = 0,
TurretYawRange = 180,
TurretYawSpeed = 80,--------炮塔转动速度(原8)
Turreted = true,
UseFiringSolutionInsteadOfAimBone = true,
WeaponCategory = 'Artillery',
},
},
Wreckage = {
Blueprint = '/props/Wreckage/UEF/UUX0115/UUX0115_wreckage01_prop.bp',
Decay = 0,
EnergyMult = 0,
HealthMult = 0.9,
MassMult = 0.2,
ReclaimTimeMultiplier = 0.1,
UseCustomMesh = true,
WreckageLayers = {
Land = true,
},
},
}
脚本代码文件路径:123.scd\units\GY\UUX0115B\UUX0115B_script.lua
详细代码如下:
-----------------------------------------------------------------------------
--File : /units/uef/uux0115/uux0115_script.lua
--Author(s): Gordon Duclos
--Summary: SC2 UEF Experimental Disruptor Station: UUX0115
--Copyright ?2009 Gas Powered Games, Inc.All rights reserved.
-----------------------------------------------------------------------------
local StructureUnit = import('/lua/sim/StructureUnit.lua').StructureUnit
local DefaultProjectileWeapon = import('/lua/sim/DefaultWeapons.lua').DefaultProjectileWeapon
local captureCategory = (categories.MOBILE + categories.STRUCTURE) - categories.COMMAND - (categories.AIR * categories.MOBILE)------新增
UUX0115B = Class(StructureUnit) {
ExhaustEffects = {
'/effects/emitters/units/uef/uux0115/ambient/uux0115_amb_03_steam_emit.bp',
},
OnStopBeingBuilt = function(self,builder,layer)
StructureUnit.OnStopBeingBuilt(self,builder,layer)
self.AmbientEffectsBag = {}
-- Exhaust smoke effects
for k, v in self.ExhaustEffects do
table.insert( self.AmbientEffectsBag, CreateAttachedEmitter( self, 'Turret01', self:GetArmy(), v ) )
end
end,
Weapons = {
MainGun = Class(DefaultProjectileWeapon) {
OnCreate = function(self)
self.Spinner01 = CreateRotator(self.unit, 'Disk01', 'y', nil)
self.Spinner02 = CreateRotator(self.unit, 'Disk02', '-y', nil)
self.Spinner03 = CreateRotator(self.unit, 'Disk03', 'y', nil)
self.Spinner04 = CreateRotator(self.unit, 'Disk04', '-y', nil)
self.unit.Trash:Add(self.Spinner01)
self.unit.Trash:Add(self.Spinner02)
self.unit.Trash:Add(self.Spinner03)
self.unit.Trash:Add(self.Spinner04)
self.SpinnerGoal = 180
DefaultProjectileWeapon.OnCreate(self)
end,
PlayFxRackReloadSequence = function(self)
local army = self.unit:GetArmy()
-- Reload effects
CreateBoneEffects( self.unit, 'Disk01', army, EffectTemplates.Units.UEF.Experimental.UUX0115.Reload01 )
CreateBoneEffects( self.unit, 'Disk02', army, EffectTemplates.Units.UEF.Experimental.UUX0115.Reload01 )
CreateBoneEffects( self.unit, 'Disk03', army, EffectTemplates.Units.UEF.Experimental.UUX0115.Reload01 )
CreateBoneEffects( self.unit, 'Disk04', army, EffectTemplates.Units.UEF.Experimental.UUX0115.Reload01 )
-- Rotate spinners during reload
if self.SpinnerGoal == 180 then
self.Spinner01:SetCurrentAngle(0)
self.Spinner02:SetCurrentAngle(0)
self.Spinner03:SetCurrentAngle(0)
self.Spinner04:SetCurrentAngle(0)
self.Spinner01:SetGoal(self.SpinnerGoal)
self.Spinner02:SetGoal(self.SpinnerGoal)
self.Spinner03:SetGoal(self.SpinnerGoal)
self.Spinner04:SetGoal(self.SpinnerGoal)
self.Spinner01:SetSpeed(100)
self.Spinner01:SetAccel(10)
self.Spinner02:SetSpeed(100)
self.Spinner02:SetAccel(10)
self.Spinner03:SetSpeed(100)
self.Spinner03:SetAccel(10)
self.Spinner04:SetSpeed(100)
self.Spinner04:SetAccel(10)
self.SpinnerGoal = 360
elseif self.SpinnerGoal == 360 then
self.Spinner01:SetCurrentAngle(180)
self.Spinner02:SetCurrentAngle(180)
self.Spinner03:SetCurrentAngle(180)
self.Spinner04:SetCurrentAngle(180)
self.Spinner01:SetGoal(self.SpinnerGoal)
self.Spinner02:SetGoal(self.SpinnerGoal)
self.Spinner03:SetGoal(self.SpinnerGoal)
self.Spinner04:SetGoal(self.SpinnerGoal)
self.Spinner01:SetSpeed(100)
self.Spinner01:SetAccel(10)
self.Spinner02:SetSpeed(100)
self.Spinner02:SetAccel(10)
self.Spinner03:SetSpeed(100)
self.Spinner03:SetAccel(10)
self.Spinner04:SetSpeed(100)
self.Spinner04:SetAccel(10)
self.SpinnerGoal = 180
else
self.Spinner01:SetCurrentAngle(0)
self.Spinner02:SetCurrentAngle(0)
self.Spinner03:SetCurrentAngle(0)
self.Spinner04:SetCurrentAngle(0)
self.Spinner01:SetGoal(self.SpinnerGoal)
self.Spinner02:SetGoal(self.SpinnerGoal)
self.Spinner03:SetGoal(self.SpinnerGoal)
self.Spinner04:SetGoal(self.SpinnerGoal)
self.Spinner01:SetSpeed(100)
self.Spinner01:SetAccel(10)
self.Spinner02:SetSpeed(100)
self.Spinner02:SetAccel(10)
self.Spinner03:SetSpeed(100)
self.Spinner03:SetAccel(10)
self.Spinner04:SetSpeed(100)
self.Spinner04:SetAccel(10)
self.SpinnerGoal = 360
end
DefaultProjectileWeapon.PlayFxRackReloadSequence(self)
end,
OnWeaponFired = function(self)
local army = self.unit:GetArmy()
-- Base dust effects when unit fires
CreateBoneEffects( self.unit, -2, army, EffectTemplates.Units.UEF.Experimental.UUX0115.BaseLaunch01 )
-- Rearward steam on launch
CreateBoneEffects( self.unit, 'Turret01', army, EffectTemplates.Units.UEF.Experimental.UUX0115.BaseLaunch02 )
-- Single muzzle flash effects, supplements the 4 individual muzzle flashes
CreateBoneEffects( self.unit, 'T01_Barrel01', army, EffectTemplates.Units.UEF.Experimental.UUX0115.MuzzleFlashSingle01 )
DefaultProjectileWeapon.OnWeaponFired(self)
end,
},
},
OnActivateDisrutorStation = function(self, abilityBP, state )
if state == 'activate' then
self:PlayUnitSound('ActivateDisruptor')
for k, v in EffectTemplates.Units.UEF.Experimental.UUX0115.Activate01 do
CreateAttachedEmitter( self, 'Turret01', self:GetArmy(), v )
end
end
end,
--------------------维修脚本---------------------
OnCreate = function(self, createArgs)
StructureUnit.OnCreate(self, createArgs)
self:SetBuilderAutoRepair(true)----修改
end,
OnStartBuild = function(self, unitBeingBuilt, order )
StructureUnit.OnStartBuild(self,unitBeingBuilt, order)
self.UnitBeingBuilt = unitBeingBuilt
self.UnitBuildOrder = order
self.BuildingUnit = true
local bp = self:GetBlueprint()
if self.UnitBeingBuilt and not self.UnitBeingBuilt:IsDead() and
self.UnitBeingBuilt.BuildScaffoldUnit and not self.UnitBeingBuilt.BuildScaffoldUnit:IsDead() then
self.UnitBeingBuilt.BuildScaffoldUnit:OnUnpaused()
end
self:StartBuildingEffects( unitBeingBuilt, order )
end,
OnStopBuild = function(self, unitBeingBuilt)
StructureUnit.OnStopBuild(self,unitBeingBuilt)
if self.UnitBeingBuilt and not self.UnitBeingBuilt:IsDead() and
self.UnitBeingBuilt.BuildScaffoldUnit and not self.UnitBeingBuilt.BuildScaffoldUnit:IsDead() then
self.UnitBeingBuilt.BuildScaffoldUnit:OnPaused()
end
self.UnitBeingBuilt = nil
self.UnitBuildOrder = nil
self.BuildingUnit = false
end,
OnPaused = function(self)
--When construction is paused take some action
self:StopUnitAmbientSound( 'ConstructLoop' )
StructureUnit.OnPaused(self)
if self.BuildingUnit then
StructureUnit.StopBuildingEffects(self, self:GetUnitBeingBuilt())
end
end,
OnUnpaused = function(self)
if self.BuildingUnit then
self:PlayUnitAmbientSound( 'ConstructLoop' )
StructureUnit.StartBuildingEffects(self, self:GetUnitBeingBuilt(), self.UnitBuildOrder)
end
StructureUnit.OnUnpaused(self)
end,
CreateBuildEffects = function( self, unitBeingBuilt, order )
CreateRepairBeams( self, unitBeingBuilt, self:GetBlueprint().Build.EffectBones, self.BuildEffectsBag )
end,
OnResearchedTechnologyAdded = function( self, upgradeName, level, modifierGroup )
StructureUnit.OnResearchedTechnologyAdded( self, upgradeName, level, modifierGroup )
if upgradeName == 'UBP_ENGINEERINGTOWER' then
self:SetBuilderAutoRepair(true)
end
end,
--------------------维修脚本---------------------
--------------------俘获脚本---------------------
BeamAttachBones = {
'Disk04',
},
AmbientEffectBones02 = {
'Addon01',
},
OnStopBeingBuilt = function(self,builder,layer)
StructureUnit.OnStopBeingBuilt(self,builder,layer)
self.Trash:Add(CreateRotator(self, 'Rotor01', 'z', nil, 0, 60, 360):SetTargetSpeed(-105))
self.Trash:Add(CreateRotator(self, 'Rotor02', 'z', nil, 0, 60, 360):SetTargetSpeed(-105))
self.Trash:Add(CreateRotator(self, 'Rotor03', 'z', nil, 0, 60, 360):SetTargetSpeed(-105))
self.Trash:Add(CreateRotator(self, 'Rotor04', 'z', nil, 0, 60, 360):SetTargetSpeed(-105))
self:ForkThread( self.AutoCapture )
self.AmbientEffectsBag = {}
self.UnitCaptureEffects = {}
-- Ambient effects
for k, v in self.AmbientEffects01 do
table.insert( self.AmbientEffectsBag, CreateAttachedEmitter( self, 'UIX0114', self:GetArmy(), v ) )
end
for kEffect, vEffect in self.AmbientEffectBones01 do
table.insert( self.AmbientEffectsBag, CreateAttachedEmitter( self, vEffect, self:GetArmy(), '/effects/emitters/units/illuminate/uix0114/ambient/uix0114_ambient_01_plasma_emit.bp' ) )
end
for kBone, vBone in self.AmbientEffectBones02 do
table.insert( self.AmbientEffectsBag, CreateAttachedEmitter( self, vBone, self:GetArmy(), '/effects/emitters/units/illuminate/uix0114/ambient/uix0114_ambient_07_plasmalines_emit.bp' ) )
end
table.insert( self.AmbientEffectsBag, CreateAttachedEmitter( self, 'T01_Barrel01', self:GetArmy(), '/effects/emitters/units/illuminate/uix0114/ambient/uix0114_ambient_06_plasmaeye_emit.bp' ) )
end,
CreateCaptureEffects = function( self, target )
local emitters = EffectTemplates.LoyaltyBeamMuzzle01
local emitters02 = EffectTemplates.LoyaltyBeamImpact01
local army = self:GetArmy()
-- Create emitters at beam start point
for h, v in emitters do
self.CaptureEffectsBag:Add(CreateAttachedEmitter(self, 'Addon01', army, v))
end
for kBone, vBone in self.AmbientEffectBones02 do
self.CaptureEffectsBag:Add(CreateAttachedEmitter( self, vBone, army, '/effects/emitters/units/illuminate/uix0114/event/capture/illuminate_uix0114_01_glow_emit.bp' ):ScaleEmitter(0.4):OffsetEmitter( 0, 0, -0.9 ))
end
self.CaptureEffectsBag:Add(CreateAttachedEmitter( self, 'Disk02', army, '/effects/emitters/units/illuminate/uix0114/event/capture/illuminate_uix0114_04_smallglow_emit.bp' ))
-- Create our beam between this unit and our beam end point entity
for k, v in self.BeamAttachBones do
self.CaptureEffectsBag:Add(AttachBeamEntityToEntity(self, v, self, 'Disk02', army, '/effects/emitters/units/illuminate/uix0114/event/capture/illuminate_loyalty_beam_02_emit.bp' ))
end
WaitSeconds( 0.7 )
if self and not self:IsDead() and target and not target:IsDead() then
-- Create our beam between this unit and our beam end point entity
local beam = AttachBeamEntityToEntity(self, 'Disk02', target, -1, army, '/effects/emitters/units/illuminate/uix0114/event/capture/illuminate_loyalty_beam_01_emit.bp' )
self.CaptureEffectsBag:Add(beam)
-- Create emitters on beam end entity
for h, v in emitters02 do
self.CaptureEffectsBag:Add(CreateAttachedEmitter(target, -1, army, v))
end
end
end,
AutoCapture = function(self)
local unitBp = self:GetBlueprint()
local aiBrain = self:GetAIBrain()
while not self:IsDead() do
if not self:IsUnitState('Capturing') and not self:IsStunned() then
-- look for capturables in area
local targets = aiBrain:GetUnitsAroundPoint( captureCategory, self:GetPosition(), unitBp.Economy.MaxCaptureDistance, 'Enemy' )
if not table.empty(targets) then
local sorted = SortEntitiesByDistanceXZ( self:GetPosition(), targets )
-- order capture
for k,v in sorted do
if not v:IsCapturable() or v:IsUnitState('BeingCaptured') then
continue
end
IssueCapture( {self}, v )
break
end
end
end
WaitSeconds(1)
end
end,
OnStunned = function(self,stunned)
if stunned then
IssueClearCommands({self})
end
end,
--------------------俘获脚本---------------------
}
TypeClass = UUX0115B 感谢分享
页:
[1]