Animation not working when editing existing models

Everything about mods can be found here.

Moderator: Morax

Animation not working when editing existing models

Postby DDDX » 27 Mar 2018, 19:58

So... I want to make an XXL Fire beetle (XRL0302 unit) that explodes in a large radius when killed. This is not a problem and I did it, both for the XRL0302 unit (via a blueprints merge in which I added the volitale attribute) and a script.lua in my mod giving it a AOE death weapon, and for my custom made, XXL Doom beetle named SXRL0302.

However - it does not walk, it glides (no walk animation). The hooked one does, no problem; it is bigger and splashes on death like it should and walks and overall works like a charm ;). The custom made one, however...does not.

I followed this guide to the letter to test what I was doing wrong, but no help. (chapter 4)

https://rogercpress.wordpress.com/2012/ ... -tutorial/

I tried it with several other units to no avail, walking animation would always lack.
What I do is take the unit folder, copy it in my mod under units, rename the folder and all files inside it accordingly, rename the 2 values in the scrpit.lua and those in the .bp files, YES I know it needs to have the full path to my mod and not just 'units/xyunit/ for all animations (wish it were that simple... ;(

What the hell am I doing wrong??? Why does it not walkkkk? I am clearly missing something.

Much obliged.

Code: Select all
UnitBlueprint {
    Audio = {
        AmbientMove = Sound {
            Bank = 'XRL',
            Cue = 'XRL0302_Move_Loop',
            LodCutoff = 'UnitMove_LodCutoff',
        },
        Destroyed = Sound {
            Bank = 'TM_EXPLOSIONS',                  -- custom explosion sound when killed, or suicided
            Cue = 'TMBIGROBOTDEATHFX',
            LodCutoff = 'UnitMove_LodCutoff',
        },
        Killed = Sound {
            Bank = 'TM_EXPLOSIONS',
            Cue = 'TMBIGROBOTDEATHFX',
            LodCutoff = 'UnitMove_LodCutoff',
        },
        HoverKilledOnWater = Sound {
            Bank = 'Explosions',
            Cue = 'Expl_Water_Lrg_01',
            LodCutoff = 'UnitMove_LodCutoff',
        },
        StartMove = Sound {
            Bank = 'XRL',
            Cue = 'XRL0302_Move_Start',
            LodCutoff = 'UnitMove_LodCutoff',
        },
        StopMove = Sound {
            Bank = 'XRL',
            Cue = 'XRL0302_Move_Stop',
            LodCutoff = 'UnitMove_LodCutoff',
        },
        UISelection = Sound {
            Bank = 'Interface',
            Cue = 'Cybran_Select_Vehicle',
            LodCutoff = 'UnitMove_LodCutoff',
        },
    },
        Buffs = {
        Regen = {
            Level1 = 10,
            Level2 = 20,
            Level3 = 30,
            Level4 = 40,
            Level5 = 50,
        },
    },
    BuildIconSortPriority = 80,
    Categories = {
        'PRODUCTFA',
        'SELECTABLE',
        'BUILTBYTIER3ENGINEER',
        'BUILTBYTIER3COMMANDER',
        'CYBRAN',
        'MOBILE',
        'LAND',
        'TECH3',
        'EXPERIMENTAL',
        'DIRECTFIRE',
        'VISIBLETORECON',
        'RECLAIMABLE',
        'SHOWATTACKRETICLE',
        'NEEDMOBILEBUILD',
        'DRAGBUILD',
    },
    CollisionOffsetY = -0.025,
    CollisionOffsetZ = 0.05,
    Defense = {
        AirThreatLevel = 5,
        ArmorType = 'Normal',
        EconomyThreatLevel = 0,
        Health = 50750,
        MaxHealth = 50750,
        RegenRate = 100,
        SubThreatLevel = 20,
        SurfaceThreatLevel = 20,
    },
    Description = '<LOC SXRL0302_desc>Mobile Bomb MK2',
    Display = {
        Abilities = {
            '<LOC ability_suicideweapon>Suicide Weapon',
            '<LOC ability_deathaoe>Volatile',
            '<LOC ability_amphibious>Amphibious',
        },
        AnimationWalk = '/mods/Survival Mayhem&BO balance/units/SXRL0302/SXRL0302_Awalk.sca',  -- full mod path
        AnimationWalkRate = 11.5,
        Mesh = {
            IconFadeInZoom = 130,
            LODs = {
                {
                    LODCutoff = 100,
                    ShaderName = 'Insect',
                },
                {
                    AlbedoName = 'SXRL0302_lod1_albedo.dds',
                    LODCutoff = 215,
                    ShaderName = 'Insect',
                    SpecularName = 'SXRL0302_lod1_specteam.dds',
                },
            },
        },
        MovementEffects = {
            Land = {
                Effects = {
                    {
                        Bones = {
                            'SXRL0302',                                         -- i tried it without the S as well, nope.
                        },
                        Type = 'GroundKickup01',
                    },
                },
            },
        },
        PlaceholderMeshName = 'UXL0011',
        SpawnRandomRotation = true,
        TransportAnimation = {
            {
                Animation = '/mods/Survival Mayhem&BO balance/units/SXRL0302/SXRL0302_Afold01.sca',
                Weight = 100,
            },
        },
        UniformScale = 0.354,                                     -- yup it's huge, original is 0.054
    },
    Economy = {               
        BuildCostEnergy = 180000,
        BuildCostMass = 10000,
        BuildTime = 12000,
        TeleportEnergyMod = 0.15,
        TeleportMassMod = 1,
        TeleportTimeMod = 0.01,
    },
    General = {
        Category = 'Utility',
        Classification = 'RULEUC_MilitaryVehicle',
        CommandCaps = {
            RULEUCC_Attack = true,
            RULEUCC_CallTransport = true,
            RULEUCC_Capture = false,
            RULEUCC_Guard = true,
            RULEUCC_Move = true,
            RULEUCC_Patrol = true,
            RULEUCC_Reclaim = false,
            RULEUCC_Repair = false,
            RULEUCC_RetaliateToggle = true,
            RULEUCC_Stop = true,
            RULEUCC_Transport = false,
        },
        FactionName = 'Cybran',
        Icon = 'land',
        TechLevel = 'RULEUTL_Basic',
        UnitName = '<LOC SXRL0302_name>DOOM beetle',
        UnitWeight = 1,
    },
    Intel = {
        VisionRadius = 24,
    },
    Interface = {
        HelpText = '<LOC SXRL0302_help>Mobile Bomb MK2',
    },
    LifeBarHeight = 0.075,
    LifeBarOffset = 0.25,
    LifeBarSize = 3.3,
    Physics = {
        BankingSlope = 0.5,
        BuildOnLayerCaps = {
            LAYER_Air = false,
            LAYER_Land = true,
            LAYER_Orbit = false,
            LAYER_Seabed = false,
            LAYER_Sub = false,
            LAYER_Water = false,
        },
        DragCoefficient = 0.2,
        Elevation = 0.25,
        MaxAcceleration = 1,
        MaxBrake = 5,
        MaxSpeed = 6,
        MaxSpeedReverse = 5,
        MaxSteerForce = 50,
        MeshExtentsX = 0.55,
        MeshExtentsY = 0.25,
        MeshExtentsZ = 0.65,
        MinSpeedPercent = 0,
        MotionType = 'RULEUMT_Amphibious',
        TurnRadius = 3,
        TurnRate = 80,
        WaterSpeedMultiplier = 0.85,
    },
    SelectionSizeX = 1.35,
    SelectionSizeZ = 1.45,
    SelectionThickness = 0.83,
    SizeX = 1.4,
    SizeY = 1.35,
    SizeZ = 1.55,
    StrategicIconName = 'icon_land2_bomb',
    StrategicIconSortPriority = 135,
    Transport = {
        CanFireFromTransport = false,
    },
    Weapon = {
        {
            AboveWaterTargetsOnly = true,
            CollideFriendly = false,
            Damage = 52000,
            DamageFriendly = true,
            DamageRadius = 20,
            DamageType = 'Normal',
            DisplayName = 'Suicide',
            FireTargetLayerCapsTable = {
                Air = 'Land|Water|Seabed',
                Land = 'Land|Water|Seabed',
                Water = 'Land|Water|Seabed',
            },
            FiringTolerance = 2,
            Label = 'Suicide',
            MaxRadius = 3,
            TargetCheckInterval = 999999,
            TargetPriorities = {
                'SPECIALHIGHPRI',
                'MOBILE',
                'STRUCTURE DEFENSE',
                'SPECIALLOWPRI',
                'ALLUNITS',
            },
            TargetRestrictDisallow = 'UNTARGETABLE',
            Turreted = false,
            WeaponCategory = 'Kamikaze',
        },
        {
            CollideFriendly = false,                                                  -- new death weapon, works, added in the script too
            Damage = 45000,
            DamageFriendly = true,
            DamageRadius = 18,
            DamageType = 'Normal',
            DisplayName = 'Death Nuke',
            FireOnDeath = false,
            FiringTolerance = 3,
            Label = 'DeathWeapon',
            MaxRadius = 3,
            MuzzleSalvoDelay = 0,
            MuzzleSalvoSize = 1,
            MuzzleVelocity = 0,
            ProjectileId = '/effects/Entities/SCUDeath01/SCUDeath01_proj.bp',
            RackBones = {
                {
                    MuzzleBones = {
                        0,
                    },
                    RackBone = 0,
                },
            },
            RackRecoilDistance = 0,
            RateOfFire = 1,
            TargetCheckInterval = 9999999,
            TargetRestrictDisallow = 'UNTARGETABLE',
            Turreted = false,
            WeaponCategory = 'Death',
            CannotAttackGround = false,
        },
    },
    Wreckage = {
        Blueprint = '/props/DefaultWreckage/DefaultWreckage_prop.bp',
        EnergyMult = 0,
        HealthMult = 0.9,
        MassMult = 0.9,
        ReclaimTimeMultiplier = 1,
        WreckageLayers = {
            Air = false,
            Land = true,
            Seabed = false,
            Sub = false,
            Water = false,
        },
    },
}
Check out my 2 maps: "Survival_Mayhem&BO_3d_v1" "Survival_Mayhem&BO_3d_RPG"
as well as my mod: "Survival Mayhem&BO balance"
-- let me know of any bugs or issues regarding those 3.
DDDX
Avatar-of-War
 
Posts: 170
Joined: 21 Mar 2016, 16:13
Has liked: 18 times
Been liked: 16 times
FAF User Name: DDDX

Re: Animation not working when editing existing models

Postby Franck83 » 27 Mar 2018, 23:06

Hi DDDX, i think that if you change the file names, you need to change the bones names to match it.
For now, your model is rigged with the old unit bone names that 's why the animations aren't working.

It seems that you need to open 3d models in blender and change bones names to match the unit new name then export it in your mod folder.

You need to use the python plugins to export supcom models. The link is somewhere on this forum.
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: Animation not working when editing existing models

Postby DDDX » 28 Mar 2018, 01:01

Hi Franck.
I was hoping there'd be an easier way to do this, but sure, I can do it the hard way.

Ty for a quick reply
Check out my 2 maps: "Survival_Mayhem&BO_3d_v1" "Survival_Mayhem&BO_3d_RPG"
as well as my mod: "Survival Mayhem&BO balance"
-- let me know of any bugs or issues regarding those 3.
DDDX
Avatar-of-War
 
Posts: 170
Joined: 21 Mar 2016, 16:13
Has liked: 18 times
Been liked: 16 times
FAF User Name: DDDX

Re: Animation not working when editing existing models

Postby Uveso » 28 Mar 2018, 06:11

I don't think that bonenames are the issue.

I repacked the unit, renamed it, added your blueprint, changed LOD settings to use the original files and updated the script file.
(also removed all non script files. They are now loaded from the original unit.)

The unit also detonates on enemy weapon fire. If you don't want this, simply delete the "OnKilled" function from the unitscript.

SXRL0302.zip
(2.86 KiB) Downloaded 75 times
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Animation not working when editing existing models

Postby DDDX » 28 Mar 2018, 12:52

Thanx man. Imma go now and figure out what you did.
Where did you get this Mesh part from??
Code: Select all
            LODs = {
                {
                    MeshName = '/units/xrl0302/xrl0302_lod0.scm',
                    AlbedoName = '/units/xrl0302/xrl0302_albedo.dds',
                    SpecularName = '/units/xrl0302/xrl0302_specteam.dds',
                    NormalsName = '/units/xrl0302/xrl0302_normalsTS.dds',
                    LODCutoff = 100,
                    ShaderName = 'Insect',
                },
                {
                    MeshName = '/units/xrl0302/xrl0302_lod1.scm',
                    AlbedoName = '/units/xrl0302/xrl0302_lod1_albedo.dds',
                    SpecularName = '/units/xrl0302/xrl0302_lod1_specteam.dds',
                    NormalsName = '/units/xrl0302/xrl0302_lod1_normalsTS.dds',
                    LODCutoff = 215,
                    ShaderName = 'Insect',
                },
            },

I ask cause it is not what the original unit uses. That's your code up there, and this is what the original SUPCOM FA file looks like
Code: Select all
LODs = {
                {
                    LODCutoff = 100,
                    ShaderName = 'Insect',
                },
                {
                    AlbedoName = 'xrl0302_lod1_albedo.dds',
                    LODCutoff = 215,
                    ShaderName = 'Insect',
                    SpecularName = 'xrl0302_lod1_specteam.dds',
                },
            },



Yet they both walk :p Soooo...basically then, as far as animations go, all you did was tell the game like it was a moron to forcefully use another unit's files, whereas in the original unit it goes automatically due to the same name of the files and the unit, is that it?

God it both frustrates me and fascinates me that there are 5 different ways of achieving the same result in this world of .lua
Can you imagine the level of mindfuck that has on someone who learns everything from scratch? ;)

As usual, Uveso, you are my savior.
One day when I'm president of the world you are definitely getting a trip to the Maldives to go SCUBA diving
Check out my 2 maps: "Survival_Mayhem&BO_3d_v1" "Survival_Mayhem&BO_3d_RPG"
as well as my mod: "Survival Mayhem&BO balance"
-- let me know of any bugs or issues regarding those 3.
DDDX
Avatar-of-War
 
Posts: 170
Joined: 21 Mar 2016, 16:13
Has liked: 18 times
Been liked: 16 times
FAF User Name: DDDX

Re: Animation not working when editing existing models

Postby Uveso » 28 Mar 2018, 15:29

That's exactly how its works.
If you don't write Meshname, albedoname etc, the game will use defaults. That's why it's not in the original file.
Also with filepath. No path means it will search the file inside the same dir then the blueprint.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest