The 3rd Age

Build anywhere mod (buildmod)

Build anywhere mod (buildmod)

Let's you build anywhere in skirmish

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

Modules - Draw + Body + Behaviors

Tutorial for Battle for Middle-earth BFME, Battle for Middle-earth II BFME 2, Battle for Middle-earth II: Rise of the Witch-king ROTWK

Avatar of Ridder Geel

Ridder Geel

Category: Code
Level: Intermediate
Created: Tuesday May 5, 2009 - 10:16
Updated: Monday February 18, 2013 - 13:46
Views: 7837
Summary: Find info on all the modules (Body & Draw & AIUpdate are done) in the BFME series! (Far from done!)

Rating

Staff says

4.3

Members say

4.3

Average

4.3/5.0

11 votes

Page 1 2 3 4
-+-=-+-=-+-=-+-=-+- Art Modules -+-=-+-=-+-=-+-=-+-
The main Art module is a big one... So I will only explain the main parts of it, so do not expect to find ALL the different "states".

-W3DDefaultDraw-User imageUser imageUser image
This kind is used for things that are never really drawn ingame, such as spellbooks and "Audio Spots".
              
Code

Draw = W3DDefaultDraw ModuleTag_W3DDefaultDraw
    ;; Nothing It seems this kind of thing is never drawn.
End


-W3DDebrisDraw-User imageUser imageUser image
This one is rarely used and it never seemed to have anything in it.
              
Code

Draw = W3DDebrisDraw ModuleTag_W3DDebrisDraw
    ;; Nothing It seems this kind of thing is never drawn.
End


-W3DScriptedModelDraw-User imageUser imageUser image
This is the "Basic" W3D Drawer, its basics are used by several other W3D Draw things.
It is used by many objects in the BFME series' coding.

              
Code

Draw = W3DScriptedModelDraw ModuleTag_W3DScriptedModelDraw
    OkToChangeModelColor    = No        ;; Change the color of the model when using house colors
    StaticModelLODMode    = No        ;; Will append M or L to the skin name depending on GameLOD

    ExtraPublicBone = arrow        ;;Bones used in code for weapons and such
    ExtraPublicBone = PASSENGERBONE

    WadingParticleSys = EntRipples    ;;When in the water what kind of particle appears?

    DependencySharedModelFlags = TURN_LEFT_HIGH_SPEED TURN_RIGHT_HIGH_SPEED MOVING ACCELERATE DECELERATE TURN_LEFT TURN_RIGHT ATTACKING BACKING_UP

    RandomTexture = New TGA/Texture 0 Old TGA/Texture ;;This kind of "Texture changing" randomizes textures, it can be used to replace one texture in all the different states.


;;====================== MODELS ================================================================
    DefaultModelConditionState    ;;Without any other conditions
        Model                = RCRGeel_D_SKN    ;;Model Name
        Skeleton            = RCRGeel_D_SKL    ;;Model Skeleton
        WeaponLaunchBone    = PRIMARY arrow        ;;When firing a primary weapon fire it from here!
        Texture = Old TGA/Texture    New TGA/Texture    ;;Only in this state a texture is being replaced
    End

    ModelConditionState        = MOUNTED    ;;Mounted state
        Model = GUFrmrHrs_SKN        ;;Model Name
        WeaponLaunchBone = PRIMARY PASSENGERBONE    ;;When firing a primary weapon fire it from here!
    End


;;================== ANIMATIONS =================================================================
;; All code needs to be 'turned around'
;; You want the USER_ something to be before the normal attack animations and the Weaponset toggle ones must be before those!
;; Make sure that the User for Normal Non Toggled attacks are AFTER the Toggled Anims!
;;
;;-ORDER-
;;SPECIAL MOVES
;;MOUNTED + WEAPONSET_TOGGLE_1 + USER_??    <-MOUNTED WEAPONSET_TOGGLE_1 USER_?? ANIMATIONS
;;MOUNTED + WEAPONSET_TOGGLE_1            <-MOUNTED WEAPONSET_TOGGLE_1 ANIMATIONS
;;MOUNTED + USER_??                <-MOUNTED USER_?? ANIMATIONS
;;MOUNTED                    <-MOUNTED ANIMATIONS
;;WEAPONSET_TOGGLE_1 + USER_??            <-WEAPONSET_TOGGLE_1 USER_?? ANIMATIONS
;;WEAPONSET_TOGGLE_1                <-WEAPONSET_TOGGLE_1 ANIMATIONS
;;USER_??                    <-USER_?? ANIMATIONS
;;Default                    <-DEFAULT ANIMATIONS

    ;;The example state...
    AnimationState = SPECIAL_WEAPON_ONE    ;;What conditions are needed for me to be allowed to play this animation?
        StateName = STATE_Bow    ;;The state the model is in, used in the "Scripts", look further down and you will see where!
        Animation
            AnimationName    = RCRGeel_D_SKL.RCRGeel_D_SPCA ;; The animation played/to play
            AnimationMode    = ONCE    ;; Play the animation once or do we loop it or manual?
            AnimationSpeedFactorRange = 1.2 1.2    ;;How much faster or slower than the original animation speed do we play the animation?    

            AnimationPriority     = 5    ;;If there are more than 1 possible animation then this one has a priority of 5...
                            ;;Meaning... 5< (6,7,8,...) has a greater chance of playing...
                            ;;And <5 (1,2,3,4) has a smaller chance of playing.
            AnimationBlendTime = 15    ;;Time to use to blend with previous animation
        End
        FrameForPristineBonePositions = 59 ;;Does this mean we shoot then? <- not sure what this means!

        Flags    = RANDOMSTART ;;Start in a random position in the animation.
        Flags    = RESTART_ANIM_WHEN_COMPLETE ;;Restart the animation when complete.

        ParticleSysBone            = B_SWORDBONE ElendilFlare FollowBone:yes    ;;A particle is in this animation... (Attached to BONE - FX Name - Follows?)


        BeginScript
            CurDrawableShowSubObject("arrow")    ;;Show sub object during animation
            CurDrawableHideSubObject("sword")    ;;Hide sub object during animation
            ;;--------
            Prev = CurDrawablePrevAnimationState()    ;; Define "Prev"
            if Prev == "STATE_Sword" then CurDrawableSetTransitionAnimState("TRANS_SwordToBow") end    ;; If the previous animation had the "STATE_Sword" state then play this "Transition" animation first.
            ;;--------
            PrevAnim = CurDrawablePrevAnimation()    ;; Define "PrevAnim"
            if PrevAnim == "Foot_IDLB"    ;;IF the previous animations was Foot_IDLB then...
            then
                return "Sword_HITB"    ;;Play this animation next...
            else
                return "Swort_HITA"    ;;If it was not then play this animation!
            end
        EndScript
    End

    ;;The example transition state...
    TransitionState        = TRANS_SwordToBow_Running    ;;Name of T-State.
        Animation        = DrawBow        ;;Name of the T-State Animation.
            AnimationName = RCRGeel_D_SKL.RCRGeel_D_STHC    ;;Name of animation to play.
            AnimationMode = ONCE    ;;Usually it's Once because its a transition.
        End
    End


End


-W3DHordeModelDraw-User imageUser imageUser image
This Draw is the same as W3DScriptedModelDraw, But this one is usually found in a horde-unit's draw code.
              
Code

Draw = W3DHordeModelDraw ModuleTag_W3DHordeModelDraw
    ;; Same as W3DScriptedModelDraw, But this unit is usually found in a horde.
End


-W3DLaserDraw-User imageUser imageUser image
This Draw is never really used in the BFME series' coding. It is used to draw 'lazers'.
              
Code

Draw = W3DLaserDraw ModuleTag_W3DLaserDraw
    Texture = EXGandalfStaffBeam_00001.tga ; you can animate this texture
    Texture = EXGandalfStaffBeam_00002.tga ; just make a list of 'cells' like this
    Texture = EXGandalfStaffBeam_00003.tga ; they will loop in the order you list them here
    Texture = EXGandalfStaffBeam_00004.tga ; use as many as you want, but make sure they all have the same aspect ratio
    Texture = EXGandalfStaffBeam_00005.tga
        
    NumBeams = 2        ;Number of overlapping cylinders that make the beam. 1 beam will just use inner data.
    InnerBeamWidth = 60    ;The total width of beam
    InnerColor = R:255 G:255 B:255 A:255    ;The inside color of the laser (hot)
    OuterBeamWidth = 28    ;The total width of beam
    OuterColor = R:100 G:100 B:100 A:255    ;The outside color of the laser (cool)
    Tile = No    ;The height of the texture will determine how many times to tile the texture to fit without scaling.
    ScrollRate = 0    ;to pulse use 10                ;Scrolls the texture offset this fast -- towards(-) away(+)
    Segments = 1    ;Number of segments -- more segments give smoother curve (but more joints) Current max: 20
    SegmentOverlapRatio = 0    ;This value overlaps(+) or separates(-) the segments by ratio
    TilingScalar = 1    ;Stretches tiling if value > 1.0, otherwise shrinks it (1.0 is natural)
    FanWidth = 0        ;Causes the 'away' end of the laser to spread wider than emitter end

    Envelope InitialOpacity = 0.0 PeakOpacity = 1.00 SustainOpacity    = 1.00 InitialDelay = 7000 AttackTime = 5000    DecayTime =    1000    SustainTime = 50 ReleaseTime =    20000    

    MaxIntensityLifetime = 2000 ;Laser stays at max intensity for specified time in ms.
    FadeLifetime = 0 ;Laser will fade and delete.
End


-W3DQuadrupedDraw-User imageUser imageUser image
This Draw is the same as W3DScriptedModelDraw, But this one is used for big (4 legged) creatures such as mumakil.
              
Code

Draw = W3DQuadrupedDraw ModuleTag_W3DQuadrupedDraw
    ;; Same as W3DScriptedModelDraw, But this one is used for big (4 legged) creatures such as mumakil.
    ExtraPublicBone = e_FrontLeft    ;;Defines the "sides"
    ExtraPublicBone = e_FrontRight    ;;Defines the "sides"
    ExtraPublicBone = e_BackLeft        ;;Defines the "sides"
    ExtraPublicBone = e_BackRight    ;;Defines the "sides"
    ;; .........

    ;; Used by FOUR_LEGS_HUGE locomotor type to balance on the ground
    LeftFrontFootBone = e_FrontLeft
    RightFrontFootBone = e_FrontRight
    LeftRearFootBone = e_BackLeft
    RightRearFootBone = e_BackRight
End


-W3DRopeDraw-User imageUser imageUser image
This one supposedly creates ropes?
In the BFME series this Draw is never used.

              
Code

Draw = W3DRopeDraw ModuleTag_W3DRopeDraw
    ;; Nothing... Never used in BFME (1,2 & ROTWK), C&C Generals uses it once...
    ;; In C&C its an empty Module!
    ;; This Draw MAY work with BFME, It exists in Game.dat, so it most likely will work.
End


-W3DSupplyDraw-User imageUser imageUser image
This Draw "draws" supply crates for in a supply warehouse in C&C.
In the BFME series this Draw is never used.

              
Code

Draw = W3DSupplyDraw ModuleTag_W3DSupplyDraw; Dedicated draw module that talks with SupplyWarehouseDockUpdate to show/hide % of bones
    ;; Never used in BFME (1,2 & ROTWK), C&C Generals uses it a few times...
    ;; This Draw MAY work with BFME, It exists in Game.dat, so it most likely will work.
    ExtraPublicBone = SUP
    ConditionState = NONE
        Model = ZBSupplyWH_B
    End
    SupplyBonePrefix = SUP ; Show n of these based on SupplyWarehouseDockUpdate
End


-W3DTruckDraw-User imageUser imageUser image
This Draw is the same as W3DScriptedModelDraw, But this one is used for wheeled objects such as porters or catapults.
              
Code

Draw = W3DTruckDraw ModuleTag_W3DTruckDraw
    ;; Same as W3DScriptedModelDraw, But this one is used for wheeled objects such as porters or catapults.

    TrackMarks = EXTireTrack2_Temp.tga    ;; Texture used for tracks.
    TrackMarksLeftBone = B_Cat_WheelFrtLt    ;; Bone to create track at.
    TrackMarksRightBone = B_Cat_WheelFrtRt    ;; Bone to create track at.


    LeftFrontTireBone = WheelL01    ;; Left-Front Tire.
    RightFrontTireBone = WheelR01    ;; Right-Front Tire.
    LeftRearTireBone = WheelL02    ;; Left-Back Tire.
    RightRearTireBone = WheelR02    ;; Right-Back Tire.
    TireRotationMultiplier = 0.1    ;; this * speed = rotation.
    PowerslideRotationAddition = 1.5    ;; This speed is added to the rotation speed when powersliding.

    ParticlesAttachedToAnimatedBones = Yes
End


-W3DTankDraw-User imageUser image
This Draw module should draw tanks with turrets. BFME 2 and ROTWK "supports" this type, but its never used.
              
Code

Draw = W3DTankDraw ModuleTag_W3DTankDraw
    ;; Never used in BFME (1,2 & ROTWK), C&C Generals uses it a few times...

    ;; NOT USABLE IN BMFE 1!!!

    ProjectileBoneFeedbackEnabledSlots = PRIMARY ;; WeaponLaunchBone will be shown/hidden, not just used for firing offset

    InitialRecoilSpeed = 120    ;; The speed with which this object can recoil.
    MaxRecoilDistance = 8    ;; The max distance it can travel whilst recoiling
    RecoilSettleSpeed = 6    ;; When settling down this is the speed.

    DefaultModelConditionState
        Model        = CVTank    ;; Model
        Turret        = Turret01    ;; Turret object name
        TurretPitch    = TURRETEL    ;; The Turret's Pitch bone
        TurretArtAngle = 180    ;; this turret has art pointed 180 degrees backward
        TurretArtPitch = 180    ;; this turret has art pointed at a 180 degrees pitch = upwards

        WeaponFireFXBone    = PRIMARY MuzzleFX    ;; Bone at which an FX Played when turret fires Primary weapon.
        WeaponRecoilBone    = PRIMARY Barrel    ;; Bone at which an FX Played when turret recoils from Primary weapon.
        WeaponMuzzleFlash    = PRIMARY MuzzleFX    ;; Bone at which an FX Played when turret Primary weapon muzzles.
        WeaponLaunchBone    = PRIMARY MuzzleFX    ;; Bone at which an Primary weapon gets fired.

        WeaponFireFXBone = SECONDARY WeaponA    ;;Secondary Weapon bones...
        WeaponLaunchBone = SECONDARY WeaponA
        WeaponMuzzleFlash = SECONDARY WeaponA
        WeaponLaunchBone = SECONDARY WeaponA
    End

    TrackMarks    = EXTnkTrack.tga    ;; The tracks left by this vehicle
    TreadAnimationRate = 2.0    ;; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3    ;; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6    ;; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
End


-W3DTreeDraw-User imageUser imageUser image
This Draw module draws trees!
              
Code

Draw = W3DTreeDraw ModuleTag_W3DTreeDraw
    ; *** ART Parameters ***
    ; The W3DTreeDraw handles normal drawing and sway, and knock over behavior.
    ; Normally this happens in the W3DTreeBuffer, and there is no corresponding drawable or
    ; object.
    ModelName = PTree01        ;; Model of tree
    TextureName = PTreeShare.tga    ;; Texture of tree

    DoTopple    = Yes    ;; Can this tree topple?
    ToppleFX    = FX_ToppleTree    ;; FX to play when toppling.
    BounceFX    = FX_TreeBounce    ;; FX to play when the tree bounces.
    KillWhenFinishedToppling = No    ;; You can still harvest from a toppled tree, so it will stay in optimized form... for-evuh
    SinkDistance = 9        ;; How far into the ground will this tree sink?
    SinkTime = 10000 ;=10 seconds ;; Time it takes for this tree to sink into the ground in MS.
End


-W3DFloorDraw-User imageUser imageUser image
This Draw module draws the floor/bib under structures.
              
Code

Draw = W3DFloorDraw ModuleTag_W3DFloorDraw
    StaticModelLODMode = Yes    ;; THIS NEEDS TO BE COMMENTED OUT WHEN ENGINEERING ENABLES LOD'S IN THE FLOOR DRAW
    ModelName    = NBWargLair_Bib        ;; Model
    WeatherTexture    = SNOWY NBWargLairBib_SNOW.tga    ;; Use this texture when its snowy
    HideIfModelConditions    = AWAITING_CONSTRUCTION    ;; Hide if this condition is true
    HideIfModelConditions    = PARTIALLY_CONSTRUCTED    ;; Hide if this condition is true
    ForceToBack = Yes    ;; Force the floor to the back of the object?
End


-W3DPropDraw-User imageUser imageUser image
This Draw module draws props.
              
Code

Draw = W3DPropDraw ModuleTag_W3DPropDraw
    ModelName = GBTorch2
End


-W3DLightDraw-User imageUser imageUser image
This Draw module draws light.
              
Code

Draw = W3DLightDraw ModuleTag_W3DLightDraw
    Ambient = R:0 G:0 B:0        ;; Ambient Color...
    Diffuse = R:240 G:240 B:100    ;; Diffusive Color...
    Radius = 40            ;; Radius of Light.
    Intensity = 1.2            ;; Intensity of light.
    FlickerAmplitude = 0.5        ;; How strong it "flickers".
    FlickerFrequency = 10        ;; How often it "flickers".    
    AttachToBoneInAnotherModule = E_Fire_SM    ;; Bone to attach it to.
End


-W3DBuffDraw-User imageUser imageUser image
This Draw module draws Buffs (Leadership things and such).
              
Code

Draw = W3DBuffDraw ModuleTag_W3DBuffDraw
    ; *** ART Parameters ***
    ; The W3DBuffDraw handles normal drawing -- this happens in the
    ; W3DBuffBuffer, and there is no corresponding drawable or object.
    ModelName = EXLeaderbuff ;; Model
    PreDraw = Yes
End


-W3DStreakDraw-User imageUser imageUser image
This Draw module draws light.
              
Code

Draw = W3DStreakDraw ModuleTag_W3DStreakDraw
    Length        = 15        ;; Length of Streak.
    Width        = 2        ;; Width of Streak.
    NumSegments    = 1        ;; Number of segements in the streak, increase for smoother line.
    Color        = R:255 G:255 B:255    ;; Color of Streak.
    Additive    = No        ;; Yes by default.
    Texture        = EXArrowStreak01.tga    ;; Texture of streak.
    WeatherTexture = SNOWY EXArrowStreak_Snow.tga    ;; Texture of streak in snowy weather.
End


-W3DSailModelDraw-User imageUser image
This Draw module draws the sails on a ship.
              
Code

Draw = W3DSailModelDraw ModuleTag_W3DSailModelDraw
    ;; NOT USABLE IN BMFE 1!!!
    AttachToBoneInAnotherModule = SAIL_BONE01 ;; Bone to attach to.
    MaxRotationDegrees        = 45    ;; How far may it rotate at max?
    BlowingThresholdDegrees        = 15    ;; How far may it be blown?
    AboutDamping            = 0.1    ;; ?

    DefaultModelConditionState
        Model = AUCrShp_S3_SKN
    End

    ;----- Standard Sail Model States -----

    ModelConditionState = REALLYDAMAGED        
    End

    ModelConditionState = DYING        
    End
                
    ModelConditionState = JUST_BUILT
    End

    AnimationState = JUST_BUILT
    End

    IdleAnimationState
    End

    AnimationState                = MOVING SAIL_BLOWN_LEFT
    End

    AnimationState                = MOVING SAIL_BLOWN_RIGHT
    End

    AnimationState                = MOVING
    End
End


-W3DBoatWakeModelDraw-User imageUser image
This Draw module draws... a Wake FX?
              
Code

Draw = W3DBoatWakeModelDraw ModuleTag_W3DBoatWakeModelDraw
    ;; Nothing... Never REALLY used in BFME (1,2 & ROTWK)
    ;; Its in the corsairship.ini but its commented...
    ;; NOT USABLE IN BMFE 1!!!
    ModelName = CorsairWakeFX    ;; Model
    Offset = X:73.76 Y:2.35 Z:1    ;; Offset from center of object.
End


-W3DProjectileStreamDraw-User imageUser image
This Draw module draws a fire, or similar animated textures.
              
Code

Draw = W3DProjectileStreamDraw ModuleTag_W3DProjectileStreamDraw
    ;; Used by one object in BFME, the Fire Drake's FlamethrowerProjectileStream!
    ;; NOT USABLE IN BMFE 1!!!
    Texture = EXFireProjectile03.tga    ;; Texture?
    Width = 1.5        ;; Width of texture/projectile stream.
    TileFactor = 3.0    ;; put the texture on the line segment this many times
    ScrollRate = 2.0    ;; scroll the texture offset this fast
    MaxSegments = 4        ;; only play the first X if there are a ton of them. 0 means play all
End


-W3DTornadoDraw-User imageUser image
This Draw module draws rotating decals for tornados.
              
Code

Draw = W3DTornadoDraw ModuleTag_W3DTornadoDraw
    ;; NOT USABLE IN BMFE 1!!!
    DecalTemplate
        Texture = EXTornadoGround    ;; Which texture to use?
        Style = SHADOW_ALPHA_DECAL    ;; What kind of decal is it?
        OpacityMin = 5%             ;; Decal Opacity (Min)
        OpacityMax = 20%            ;; Decal Opacity (Max)
        MaxRadius     = 300.0        ;; Max Radius of Decal
        Color    = R:200 G:200 B:200 A:255    ;; Color of Decal
        OnlyVisibleToOwningPlayer = Yes        ;; Visible only to owning player?
        RotationsPerMinute = 0.4 ;; Rotates how much per minute (RPM)?
        SpiralAcceleration = 1.0 ;; How much does it increase its RPM every minute?
    End
    DecalCount    = 7    ;; How many decals are drawn?
    DecalMaxRadius    = 300.0    ;; Max radius of all decals?
End

Comments

Display order: Newest first

GothmogtheOrc (Team Chamber Member) - Monday July 20, 2009 - 11:07

wow, very good idea for a tutorial. Very useful.

Ridder Geel (Staff) - Sunday May 24, 2009 - 10:56

Ill do that later ;) (additional modules) ;)

Sulherokhh (Team Chamber Member) - Thursday May 21, 2009 - 6:44

Most, if not all, AI update modules work with additional modules (which they need) exclusively. It might be sensible to make a reference to those modules and/or define them in the same way right below the AI module.
---------------------
In adddition, work on the formatting. It's bothersome to read different sections with entirely different formats. Remove all TAB characters, replace with a single SPACE. Comment (';') lines that don't help explain should be removed as well.
Keep it up.

Lurtzy - Thursday May 14, 2009 - 18:08

Looking really cool so far, can't wait to see more!

Yarrum - Monday May 11, 2009 - 4:23

Cool tutorial. With this, I might be able to get Boromir's Last Stand power to work properly. I know they did it in Elvenstar but it never seemed to work in my game.

Go to top

 

"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."

 
4:26:01