Post tutorial Report RSS Palii Tutorials for everything Dow part 1

All of Palii's Dow tutorials restored for Moddb. All credit goes to him. Part 1

Posted by on - Basic Starting a mod

Tutorial Overview:

Forums:
- Age of Squat Team Database

General:
- About .events Files
- Hardpoints
- Simvis Attributes
3dsMax:
- Animated Texture
- Simple Multi-Material
- Detach Animated Objects
FX Editor:
- Mesh in FX
Object Editor:
- Object Editor Overview
- Random Motion Groups
- Combined Vis Groups
- Idle and Move
- Tracking and Firing
- Melee Actions
- Jump
- Add Simple FX to Motions
- Idle and Move Water Ripple FX
- Create Sound Events
Workaround:
- Research Dependent Animations

Night Shift Modding:
- Hide Everything For Screenshots
- Define Night Hotkeys
- Create Night Maps
- Mod Support Whitepaper
- Mod Public Source
- Night Races - Coding Night Rules
- Night Races - Searchlight
- Night Races - Nightvision

General:
How to create ".events" files and some possible lua usage.

1. Create Events:
Events are created in Object Editor, they contain fx, sound and whatever you add to them. Check the Add Simple FX to Motions tutorial for adding fx and the Create Sound Event tutorial for adding sound.
If you want to create new events for a unit without any source files, then open any other one, and create your fx event without a marker parameter. The fx will appear on the floor (zero coordinates), facing upwards.

2. Export .events Files:
Events files contain multiple events. (comes with the "s"...funny) Open the entity containing your events, preferably the one you want to create the .events file for. You can multiple-select events either by dragging, shift+click or ctrl+click. Then hit Export Events to create the file.

- The exporting process doesn't care about default mod directories and such, you can save the file anywhere.
- To recall an .events file in Lua you have to save it to: Data\Art\events\
- Creating your own dir and placing your events files there is recommended for full mod compatibility.
- You can also import events files if you wish to reedit or see existing ones.

3. Lua Usage Examples:
Here are some examples that the game uses for various triggers and effects.

(ebps) Entity Event Manager:
GameData["event_manager_ext"]["event_08"]["event_entry_01"]["event_name"] = "Data:Art/Events/Unit_Upgrade_Morale_FX/ork_boyz_Morale_Break.events"
GameData["event_manager_ext"]["event_08"]["modifier_name"] = "morale_break_event_ork"
This is how Fx appears in case or morale break.
(ebps) Infiltration Event:
GameData["infiltration_ext"]["infiltration_event_name"] = "data:Art\\Events\\Order_Confirm_Events/infiltrate_orks.events"
The triggered event upon activating infiltration or cloak.
(ebps) Death Event:
GameData["health_ext"]["death_event"] = "unit_death_events/sink_into_ground"
If you want to change this, then your new .events file should contain the sink_into_ground. You can import it and reedit easily.
(ebps) Deepstrike Events:
GameData["deep_strike_ext"]["click_event"] = "order_confirm_events/deep_strike_chaos"
GameData["deep_strike_ext"]["spawn_entity_event"] = "Data:Art/Events/unit_ability_FX/deep_strike_UNIT.events"
GameData["deep_strike_ext"]["spawn_ground_event"] = "Data:Art/Events/unit_ability_fx/deep_strike_spawn_ground.events"
This is applied to buildings, which are able to deepstrike squads.
- click_event is a sound event.
- spawn_entity_event is applied to all entities in the squad upon spawning.
- spawn_ground_event is the icon that appears on the ground.
(ebps) Spawn Event:
GameData["spawn_ext"]["oncreate_event_name"] = "Data:Art/Events/unit_ability_FX/deep_strike_UNIT.events"
Used when the entity is created.
(sbps) Reinforce Events:
GameData["squad_reinforce_ext"]["leader_event"] = "Data:Art/Events/Unit_Upgrade_Morale_FX/reinforce_trooper.events"
GameData["squad_reinforce_ext"]["trooper_event"] = "Data:Art/Events/Unit_Upgrade_Morale_FX/reinforce_marine_trooper.events"
GameData["squad_reinforce_ext"]["weapon_event"] = "Data:Art/Events/Unit_Upgrade_Morale_FX/Weapon_Upgrade.events"
Speaks for itself...
(weapon) Weapon Events:
GameData["area_effect"]["weapon_damage"]["hit_events"]["tp_flesh"] = "Projectile_FX/Krak_Missile_Impact"
GameData["area_effect"]["weapon_damage"]["hit_events"]["tp_heavy_metal_armour"] = "Projectile_FX/Krak_Missile_Impact_hvy"
GameData["area_effect"]["weapon_damage"]["hit_events"]["tp_light_metal_armour"] = "Projectile_FX/Krak_Missile_Impact"
GameData["area_effect"]["weapon_damage"]["hit_events"]["tp_stone"] = "Projectile_FX/Krak_Missile_Impact"
GameData["weapon_spawned_event_name"] = ""
Wonder why Relic didn't use this weapon_spawned_event_name...
(ability) Ability Events:
GameData["area_effect"]["weapon_damage"]["hit_events"]["tp_flesh"] = "unit_ability_fx/doombolt_impact_unit"
GameData["area_effect"]["weapon_damage"]["hit_events"]["tp_heavy_metal_armour"] = "unit_ability_fx/doombolt_impact_unit"
GameData["area_effect"]["weapon_damage"]["hit_events"]["tp_light_metal_armour"] = "unit_ability_fx/doombolt_impact_unit"
GameData["area_effect"]["weapon_damage"]["hit_events"]["tp_stone"] = "unit_ability_fx/doombolt_impact_unit"
GameData["ability_ordered_event_name"] = "Data:Art/Events/Marine_Weapon_FX/orbital_bombardment_marker.events"
GameData["anticipation_event_name"] = "Data:Art/Events/Marine_Weapon_FX/orbital_bombardment_pre_explosion.events"
- ability_ordered_event_name is used upon activtion of the ability.
- anticipation_event_name is activated before the projectile lands...? huh.
- hit_events are the effect of the ability on the target unit(s).

I hope the tutorial cleared things up for you.


There is only coincidence!

Hardpoints

General:
The tutorial explains everything about hardpoints, their options and how to set it up for your unit.
- An entity can have up to 4 hardpoints.
- You can add up to 5 weapons to each hardpoint, the first weapon is the default_weapon, which can be upgraded to higher weapon entries.
- Hardpoints can have both ranged and close combat weapons, you can include mixed weapon types for the same hardpoint.
- There can only be one active weapon slot on a hardpoint at the time.
- All entities attack with all hardpoints at the same time. (they use them depending on weapon ranges)
- Entities can play different animations for different weapons.

Create Hardpoints:
You have to declare all your hardpoints and their weapons in your entity's ebps. (Data/Attrib/ebps)
All possible options are found in ebpextensions. (Data/Attrib/ebpextension/combat_ext.lua)

Hardpoint Reference:
GameData["combat_ext"] = Reference("combat_ext")
- Without this, no hardpoint options will work.

Hardpoint Options:
You have to set different variables for the hardpoint, so that Object Editor knows what's going on.
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["attack_motion_variable_name"] = "Weapon_Range_Tracking_Right"
- This is the variable for Tracking. (ranged weapons)
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["shoot_motion_variable_name"] = "Weapon_Range_Firing_Right"
- Variable for firing. (ranged weapons)
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["horizontal_aim_motion_variable_name"] = "Aim_Horizontal_Right"
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["vertical_aim_motion_variable_name"] = "Aim_Vertical_Right"
- Variables for horizontal and vertical tracking movement.
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["hardpoint_weapon_variant_motion_name"] = "Weapon_Range_Upgrade_Right"
- Variable to determine the active weapon slot on the hardpoint.

Weapon Options:
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["weapon_table"]["weapon_01"]["weapon"] = "space_marine_bolter_tactical"
This is the name of the weapon lua file. (Data/Attrib/Weapon)
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["weapon_table"]["weapon_01"]["name_for_this_weapon_choice"] = "space_marines_bolter"
This is the name of this weapon slot for the hardpoint variables above. For example in Object Editor you create a clause that checks if Weapon_Range_Firing_Right is equal to space_marine_bolter...if yes, then it play the bolter shooting animation.

Melee Hardpoints:
If the hardpoint is strictly melee only, then the following hardpoint variables aren't needed: attack_motion, shoot_motion, horizontal_aim_motion, vertical_aim_motion.
They should have a empty value, like this:
GameData["combat_ext"]["hardpoints"]["hardpoint_01"]["vertical_aim_motion_variable_name"] = ""

Simvis Attributes


1. The Simvis File:

It is a lua right next to your whm and whe files, you should create one for every building, unit and vehicle. It needs the same name as your whm/whe so that the engine finds it. If it can't find it, then it will try to load the defaultsimvisattributes.lua in the same folder. (either structures or troops)
Note that simvis lua files are never burned, the engine reads them on the fly.

2. Simvis Attributes List:

- Vis:
vis_scale_min
vis_scale_max
- Shadow:
shadow_type
shadow_scale
shadow_force_update_bbox
- Infantry:
infantry_physics
infantry_sway_update_time
infantry_sway_random_radius
- Melee:
melee_size
melee_block_ratio
melee_unsynced_damage_ratio
- Selection:
selection_volume
selection_child
selection_ground
- Vehicle:
vehicle_physics
vehicle_width
vehicle_length
vehicle_nr_wheels
vehicle_spring_constant
vehicle_damper_constant
vehicle_wheel_travel
vehicle_acceleration_factor
vehicle_gravity
vehicle_debug_render
vehicle_height_offset
vehicle_float_on_water
vehicle_render_offset
vehicle_max_angle
- Other:
persistent_body
distance_game_mesh_lod
occludee
occluder

3. Simvis Attributes Help:

All simvis attributes are placed inside the simvis_attributes function.
simvis_attributes = {-in here-}
One per line, a comma defines the end of the line.
attribute_name = attribute_value,

vis scale_min: Minimum rendered unit scale. Fx included in OE will be scaled with the entity.
vis_scale_max: Maximum rendered scale. If the maximum scale is larger than the minimum, then size of squad members will be randomised.
shadow_type: Five shadow types shown below.
shadow_type = 0 - None. Shadow disabled. Default value.
shadow_type = 1 - Blob 1. Blob is a simple internal shadow for small units. This shadow type is rotated by the light direction settings of the map itself. Shadow map possible.
shadow_type = 2 - Blob 2. Same as blob 1, but this is rotated by the direction of the entity. Shadow map possible.
shadow_type = 3 - Shadow Map. Specify a tga file, which defines the rendered zone for the shadow. The shadow will be dynamically calculated in accordance with the animated mesh and projected using the shadow map.
shadow_type = 4 - Stencil shadow volume. Used only for buildings. It renders dynamic, hard edged shadows in accordance with the mesh without a shadow map. This is only shadow type that does not use the shadow_scale variable. Buildings using stencil shadows must have "closed" geometry or stencil shadows will crash or produce strange results. Skin modifiers will disable stencil shadows.
shadow_scale: Defines the shadow size. For unit blobs it is usually less than 0.03, for large units with shadow map less than 0.1.
infantry_physics: Must have for all squads with more than one members! The squad will move very incoherently if this is not set to 1. Default is 0. The two attributes below are perfect and neccessary to randomize squad movement, even if just a little.
infantry_sway_random_radius: This is the max distance around the unit, within this distance will the unit choose new random positions. Only while moving. Default is 0.
infantry_sway_random_radius = 0.4 - Space marine default.
infantry_sway_update_time: Time in seconds, before choosing a new random position within the sway radius. Only while moving. Default is 0.
infantry_sway_update_time = 4 - Space marine default.
melee_size: The size of the melee entity for positioning in combat.
melee_size = 0 - Small. Default value, for all infantry.
melee_size = 1 - Medium. Dreadnought, Ogryn size.
melee_size = 2 - Large. Bloodthirster, Avatar, Defiler size.
melee_block_ratio, melee_unsynced_damage_ratio: These two variables are interdependent and more than just intuitive. Special attacks dont seem to be influenced. Units which use these options all have special attacks, but not the obliterator. Here are examples.
melee_block_ratio = 0, melee_unsynced_damage_ratio = 0 - Only the melee_attack action.
melee_block_ratio = 100, melee_unsynced_damage_ratio = 100 - Only the melee_damage action, when the entity recieves damage.
melee_block_ratio = 50, melee_unsynced_damage_ratio = 15 - Chaos Lord, Sorcerer, Farseer, Librarian.
melee_block_ratio = 50, melee_unsynced_damage_ratio = 10 - Dreadnought, Killa Kan, Wraithlord.
melee_block_ratio = 25, melee_unsynced_damage_ratio = 10 - Defiler.
melee_block_ratio = 50, melee_unsynced_damage_ratio = 30 - Obliterator.
selection_ground: Internal option needed for everything, even for unselectable environment objects. Give it value of 1. Default is 0.
selection_volume, selection_child: Set the type of selection detection. Use either selection_volume or selection_child, but not at the same time. Default is 0 for both.
selection_volume = 1 - Enable for all infantry, characters, monsters and tall units like wraithlord. Not needed for buildings.
selection_child = 1 - Enable for flat units like tanks and entities with small height. Not needed for buildings.
Warning: Vehicle attributes can only be used with the following turning_behavior_templates (moving_ext in ebps): tank, hovercraft
vehicle_physics: Value of 1 is needed to enable the vehicle attributes.
vehicle_width: Length of the vehicle. Use the selection volume in OE to measure it, or place markers in 3dsmax and calculate their position difference.
vehicle_length: Width of the vehicle. Calculate it as above.
vehicle_nr_wheels: Number of points along tread used to average its vector along the terrain.
vehicle_nr_wheels = 2 - Hovercraft.
vehicle_nr_wheels = 3 - Tank.
vehicle_spring_constant: Reaction of the vehicle to acceleration and impact physics.
vehicle_spring_c - Hovercraft.
vehicle_spring_c. - Tank.
vehicle_spring_c. - Trukk.
vehicle_damper_constant: This parameter influences and dampens the spring_contant parameter.
vehicle_damper_c - Hovercraft.
vehicle_damper_c.3 - Tank, Trukk..
vehicle_wheel_travel: Range of travel on the entire tread with respect to the body of vehicle (shock absorption measured in distance) This was CLR's comment. For example, wheel_travel for the Leman Russ is 0.3, which is 16 times smaller than its length.
vehicle_acceleration_factor: ???
vehicle_gravity: Gravity settings for your unit, Relic only used the two values below.
vehicle_gravity = 1 - Normal earth gravity. Use this value for ground vehicles.
vehicle_gravity = 0.6 - Weaker gravity, recommended vaule for skimmers, hoverers.
vehicle_debug_render: Value of 1.0 will turn on visual representation in game.
vehicle_height_offset: Distance of the entity aboveground. Default is 0.
vehicle_height_offset = 3.5 - Recommended for hovercrafts.
vehicle_render_offset: Only used for hovercrafts, and only with a value of -0.7.
vehicle_float_on_water: Value of 1 for hovercrafts.
[1.4 only] vehicle_max_angle: ???
[1.4 only] persistent_body: Used to disable fading out of the corpse. Default is 1. (all corpses stay)
[1.4 only] persistent_body = 0 - The dead entity will fade out. If you disable it, then you also need to set the "keep_persistent_body" to false in your ebps!
[1.4 only] distance_game_mesh_lod: Atribute that defines the level of detail switching. Doesn't seem to work.
[1.4 only] distance_game_mesh_lod = 80 - Default value for all imperial guard buildings.
occludee: Used for small units to enable visual occludance. Default is 0.
occludee = 1 - Show its outlines behind occluder entities.
occluder: For buildings and large units to enable visual occludance. Default is 0.
occluder = 1 - Occludee entities show their outlines behind it.

4. Simvis Attributes Strings:

All simvis attribute strings are placed inside the simvis_attributes_strings function, that comes after the simvis_attributes function.
simvis_attributes_strings = {-in here-}
The only string encountered is the one that defines the tga used for shadows with a shadow map. You can look at existing shadow maps under ..\Data\Art\decals\shadows. The variable uses the decals folder as root. Since this is the only variable in your file, no comma needed in the end.
shadow_texture = "Shadows/my_shadow.tga"

Let the community Be!

ShinGouki & Palii

Animated Texture


What are animated textures used for?
Only your creativity sets the limits. The most common use is track animation for tanks.

1. Preparation
Few things:
- Texture animation can use considerable computer power, so watch out.
- Make your tga as small as possible (64x, 128x)
- All animation max files need at least one bone, even the ones with only texture animation. Make sure it has a bone, even if its not related.
- You animate the texture, not the uvw map, so every mesh inside your entity will be affected that uses the animated texture.

2. Animation
Create your animation max file and save it as you always do. Switch on autokey, it is needed to assign animated UV values. Select an object that uses the animated texture map. Note that you dont need to select it, since you are animating the texture, not the object, but only this way will you see the assigned keyframes on the timeline.

Open material editor and go into your Bitmap diffuse map. (the panel where you target your tga image)
Here, two values can be animated: "U Offset" and "V Offset".

To assign a new value to your active keyframe, just enter the value into the field or drag the roller. In order to add zero offset value to the frame, just change the value, then set it back to zero.
The roller will be highlighted with red corners which show that the property is being animated.

You can set up your animation on the timeline as normal.

You only need to wish!

Palii

Simple Multi-Material


What are Multi Materials?
When you want to assign more than one texture maps to the same mesh, then you get into the multi-material situation.

Simple as a Squig...
Note that there is more than one way of assigning multiple textures to the same mesh, this tutorial only covers this simple way.

I guess you have two or more maps in Material Editor, each of them using a different source tga.

Normally you assign materials to objects using the "assign Material to Selection" button. Use it to assign the first material to your object. The whole mesh is using this material for now, but that will change soon.

Select your object and go into Face, Polygon or Element sub-selection mode inside the Editable Mesh modifier.

Select the faces or elements that you want to assign a different texture to. Now simply drag the other material from material editor onto the object. 3dsmax will automatically add the material, but only to the selected faces. Thats it! Its so easy. No need for materal IDs, no need for multi-materials, no need for vertex coloring.

If your object is selected, you can see in material editor that now both of your maps have the little white triangles in the corner, showing that both textures have been assigned to that object.

Although Relic used a different technique to make multi-maps for the Predator, this is much easier and it exports into the game just as fine. There is one drawback with this technique, if you use the assign material to selection button again, it will overwrite the sub-materials that you added to the object before.

The world is on a money diet.

Detach Animated Objects


For what animations can this be used for?
Used when an object detaches from a bone in the middle of an animation.
Few examples:
- Soldier drops his weapon
- Limb dismembering
- Commissar taking the cigar out of his mouth
- Blown off tank turrets

1. Preparation
Things to know:
- Nothing can actually be detached from bones, we will be applying a commonly used trick.
- The object that will be detached should be an independent object, it cannot be merged as part of another mesh.
- You need the detachable object two times. One is linked to the bone you want to detach it from. The other doesnt need to be linked, but if you want to animate it, then it must be a bone-object or linked to a free bone.

2. Animation
Create your animation max file and save it, as it should be.
Whatever animation you create, you need to overlay the two objects precisely at the moment of detachment. Still, both the attached and the detached objects can be animated before and after the moment of detachment.
- The attached object will be shown before and hidden after.
- The detached object will be hidden before, then unhidden after.

First lets hide the detached object. Go to the frame just before the moment of detachment, select the detachee, then right-click and properties. Here you can change "Visibility" to 0.

Note that the DOW engine only supports 1 bit visibility, so this value can only be 1 or 0.

If all is good and well, then your object becomes transparent in the viewport.

Go to the next frame and set the visibiliy to 1 for the detachee. It is important to make the visibility animation between two consecutive frames, otherwise it wont occur precisely on the desired frame.

Now do the the opposite for the attachee, it should be visible in the frame where the detachee is hidden and it should be hidden where the detachee becomes visible.

Are you sure you want this? Making that animation wont be easy! ;)

Mesh in FX


Overview:
This is how it goes: Create and export a model with texture, import into FX Editor, import into Object Editor.

1. Exporting the Mesh:
Setting up models to be used in FX is very similar to the regular export setup.
Some facts:
- No bones needed, the model can not be animated from 3dsmax.
- No animation max files needed for the same reasons.
- No ebp file and no whe file is needed to succesfully make a Mesh FX.
- The exported whm file will not be under the ebps folder as usual, but under the fx folder.
- Mesh FX can not use teamcoloured textures.
- Mesh FX can use up considerable computer power, so make sure your texture is as small as possible. (64x, 128x, 256x)

Create your ref.max file and save it in this structure:
..\DOW\ModTools\DataSrc\your_mod\Art\EBPs\Races\your_race\Mesh_FX\your_mesh_fx\Reference\ref.max
You dont have to save it under the Mesh_FX folder its just an example, you can save it in the Troops folder too or any other. It is recommended to keep your mesh fx files under the same folder like Troops, because this way you can delete all the exported whm files at once, when you release a public build.
Now save the texture in the reference folder right next to the ref.max! This way the texture will be burned into the whm, no rsh, nor wtp will be created. Export it.

2. Importing into FX Editor:
First recopy your whm file into the Fx folder. Your whm is here:
..\Dawn of War\your_mod\Data\Art\EBPs\Races\your_race\Mesh_FX\your_mesh_fx.whm
Notice the size of your whm file, it shows that it has a texture embedded inside. Recopy the whm, somewhere under the FX directory, where you keep your fx luas. Under here:
..\Dawn of War\your_mod\Data\Art\FX\

Create a new Ring FX or open an existing one in FX Editor. Meshes can only be embedded into the Ring FX type. If you create a new fx, dont forget to save it before you do anything, it may crash. (just click somewhere, then the save option is unlocked)
You can target your whm under the Mesh option.

The editor asks for sgm, but dont believe him, he actually wants to say whm! Sgm files will crash the editor.
Just use browse, and make sure it shows all file types. Dont forget to apply. Your mesh wont show up just yet, select the UseMesh option, and tick it.

Note that the Texture option is unusable now, since the mesh has to use his own texture.

Now if you play the FX, your model will be there.

I know your model is transparent, but dont worry, it wont be in Object Editor, neither in the game. If you want to see it solid anyway, then turn on SelfIlluminated.
If the model is screwed up, or the normals of the mesh are not rendered properly then switch on UseDepthTest.

3. Mesh FX Possibilities:
There are many things that cant be done with Mesh FX, that would otherwise be possible with normal fx. Here is the list of all the Ring FX options and their situtation.
Billboard: Yes
Birthspawn_Fx: Yes
Blending: No
Colour: No
DepthOffset: No
Detail_From: Yes
Detail_To: Yes
Duration: Yes
Loop: Yes
Offset: Yes
Radius: Yes
RadiusEpsilon: Yes
RateEpsilon: Yes
SelfIlluminated: Yes, but no final use for it.
SortOrder: No
Spawn_Fx: Yes
SpinEpsilonX: Yes
SpinEpsilonY: Yes
SpinEpsilonZ: Yes
SpinRandom: Yes
SpinX: Yes
SpinY: Yes
SpinZ: Yes
Texture: No
UseDepthSort: No
UseDepthTest: Yes
UseMesh: Yes, needed

Consider the facts shown in the beginning of this tutorial as well, before you decide to use Mesh FX.

4. Mesh FX in Object Editor:
Your mesh wont show up in Object Editor yet, but go ahead and try it, if you want to see a new kind of "purple box of death".
You need to copy the sgm right next to the recopied whm, so that OE can show the Mesh FX. Note that you do NOT need an sgm file, in order to see the Mesh FX in the game. Your sgm is here:
..\DOW\ModTools\DataGeneric\your_mod\Art\EBPs\Races\your_race\Mesh_FX\your_mesh_fx.sgm

You should hook up your fx lua into an event as you do with regular fx. If you are unfamiliar with adding fx to motions, then you shouldnt be reading this tutorial. Please go here first: Add Simple FX to Motions

5. Public Release:
Some final cleaning up. These files dont mess around with anything, just occupy space.
- Delete the exported whm files that you recopied. (ebps)
- Delete the sgm files which are needed only for Object Editor. (fx)

Ignorance creates time!

Palii & ShinGouki

Object Editor Overview


Model Properties:
Here you can see information on the content exported from 3dsmax. The bones in the skeleton. Unused bones mean that those bones aren't used in any animations of the entity. Markers, that are used to link fx to bones. Meshes are the different objects and shaders are the different source textures recognised by the exporter.
Selected UI:
The in-game selector and the selection volume is here. Circle or rectangle, size is set manually. The selection volume doesn't appear physically in-game, it determines collision. For buildings the deployment blueprint has to be set in its ebps lua file.
Animations:
All the max files in the Animations directory of your entity show up here. Animation in themselves do nothing, only contain the animation coordinates exported from 3dsmax. You have to link these animations to motions to get them in-game.
Motions:
Motions are crucial. You add animations to motions, also you can add events to them. Imagine a motion is a 'dow animation', it has the 3d animation in it, plus fx and sounds linked to it. There are two kinds of motions: simple motions and random motions. Simple motions are as mentioned above, random motions are motion groups that contain multiple motions. Inside such motion group each sub-motion has it's defined "chance" of being played.
Actions:
Action are commands recognised by the game engine. You link motions to action so that the game will know what motion is has to be played and when. Also you can link actions to actions. There are two kinds of actions: game actions and internal actions. Game actions are named in accord to the built in commands of the engine. For example if you make an action named "build" and link a motion to it, the unit will play that animation ingame when building. Conditions come in here too. If you link more actions to another action, conditions will determine which action is launched. For example the engine recognises the action called "default", you add two sub-actions to it: "idle" and "move" and tell it with a condition to play "idle" if standing and "move" if moving. When two actions or two motions are played at the same time inside an action, we could call it Combined Vis Group. A combined vis groups can be made up of either motions or actions. A space marine can have both bolter and flamer. A condition determines if it's moving, another determines if it has a flamer or bolter. This is the "vis files" issue, when two separate 3dsmax animations are merged by the engine real-time.
Events:
Events define fx and sounds. You link fx to markers placed into the max file of your entity. Also, enemy markers can be attached to your own markers, for sync_kill animations. Footfall, impact and water-ripple. Fx lua file names can also be called dynamically according to the terrain the entity is standing on in the game. Events then are linked to motions to show up in-game. There are many built-in event options that are undocumented.
Clauses:
Clauses are like if commands that check variables. There are built in clause names recognised by the engine. You could make a clause that checks if the entity is standing, moving or jumping. Clauses come in 3 types: Float, Boolean and String. These types only define the nature of their value. Float is a number, boolean is true or false, string is anything, a character sequence. For example the 'is_moving' clause checks if the velocity of the entity is greater than zero. Clauses are then linked to conditions. Often you ony link one clause to one condition, but you can add more.
Conditions:
Conditions only serve one puprose: it adds the possibility of grouping clauses. So for example you could make a condition that checks if the unit is getting damage and jumping at the same time. Often only one clause will be in the condition, but it needs to be added, since only conditions can be used in actions. In actions, conditions determine which sub-action or sub-motion is played.
Modifiers:
Modifiers change the actual keyframe in a motion according to a variable. For example you create the construction animation of your building, make a motion for it and link a build_progress modifier to this motion. The engine will recognise this when the building is constructed and play the animation according to the build-percent until it is finished. There are other modifier types recognised by the engine like research_progress, turning, horizontal and vertical aiming, thrown_progress, possession_progress. Also such modifiers can be displayed on the bottom "variable bar". The velocity modifier is needed to make your move aniamtion properly.
Variable Bar:
This is the horizontal panel in the bottom, that cannot be switched off. It is not only handy, but absolute. You can display modifier and terrain variables on it, 8 slots are avalaible. For example you can display the velocity variable on this panel, this permits modders to see how the entity reacts in object editor without launching the game. With default action selected and playing, the enity will stand still if velocity is set to 0 (on the bottom variable bar), and move if it is greater than 0. Also with events you can call fx lua file names dynamically. Lets say you have 4 splash fx: dirt, sand, grass and water. Your fx files are named as splash_dirt..splash_water. In your event you call the fx like this: splash_%terrain%, AND if you set the terrain variable on the variable bar to water and play your motion that has the event linked to it, it will make a water splash in object editor.

Palii

Random Motion Groups


What you need for this tutorial:
You will need at least two random animations exported from 3dsmax. Also run though the Idle and Move tutorial, if you haven't yet.

What are Random Animations?
If you make five different idle animation in 3dsmax you can link them together into a motion group and the engine will choose between them randomly. This way the entities in the squad don't simply stand still but play various animations. A good use for random animations can be during moving, you can make the same animation scaled to four different timelines, the squad won't run synchronically.

A Rule for Random Animations!
Remember transition out? Well it is ignored by random animation groups. They snap to the next chosen random animation without regard. So my suggestion is when you animate in 3dsmax, first make a sample file that contains the first and the last frame of your animation. From this file you can make various max files with their anims. The important is this: ALL animations linked together must have the SAME first and last frame. But if you make all move animations have a transition out value it will still make a transition between idle and move for example, but not between the grouped animations.

1. Create Motions for Animations
Please read the Idle and Move tutorial on how to do this exactly. Set up your motions named: idle1, idle2 or move1, move2 and add the appropriate anims to them. Give a transition out value to all them anyway. 0.20 is usually enough.

2. Attach Random Motions to Motion Group
Now those motions you've created will be linked to a new motion. Create a new motion called: move_group or idle_group.

Motions that have anims linked to them have a "green film tape" icon, motions containing random motions have "blue film tape" icon. Make sure the new motion is selected and open the motion properties panel on the right.
You can find the Random Motions box in the very bottom of the motion properties panel. Add your motions one-by-one by selecting them from the dropdown list and clicking add.

Make sure you tick randomize each loop. It means every time a motion is finished, it chooses/loops again.

Now you can weight each random motion. This determines the chance of it being played. Make sure, that if you add all the weight values together, you get 1.0.

3. Test in Object Editor
Select your motion group from the Anims/Motions/Action panel on the left and hit the play button in the bottom right. Every time the animation is finished a new random loop starts. And it's really random! You can look at it for a long time :D

4. Adding Random Motion Groups to Game Actions
If you created a random idle_group, move_group, jump_group, simply add this motion group to your action. If you followed the Idle and Move tutorial, then simply replace the move motion with move_group and idle motion with idle_group. It will just as show up in-game.

Remember to randomize chaos!

Palii

Combined Vis Groups


What are Vis Groups?
If your motions or actions are played at the same time, that is a combined animation. Weapon upgrades, tracking, firing, random looks are some examples. Let's say you have a move motion and 3 different weapon vis motions which contain your weapon upgrades. You unite them under one action and clauses will determine which weapon vis motion is played TOGETHER with the move motion.

A Rule for Combined Animations!
If two motions/actions are played at the same time, the topmost one is king..always. This applies when two motions are not interdependent.
On the image below, if the idle_group and the move_group aren't handled with an if...else condition, so the idle_group motion will always be played instead of the move_group motion.

In 3dsmax, you can set user properties for all objects. Use Stale=Yes to disable any bone or mesh.
- Rightclick after selecting your objects. (You can set user properties for more objects at the same time)
- Properties

- Select the User Defined Tab, and type it in.


Watch Out!
If two bones are animated at the same time, one has to be disabled. (animated means it has keyframes assigned in that max file) Relic applied this to meshes in some cases as well.

Combined Vis Group Example:
- This is the move action in the default action.
- It contains the move motion and two weapon upgrade vis motions.
- The move motion is independent of the vis motions.

Make more weapons!

Palii

Idle and Move


What you need for this tutorial:
The tutorial explains how to setup your idle and move animations in object editor, so that they work in-game. I assume you already have the ref.max, idle.max and move.max files finished and animated. If you want to xref animations check relic's tutorial on the RDN-wiki. Export your model and create a new EPB for your SGM in the object editor. Check the used and unused bones on the model properties panel to make sure your animation is exported correctly. Select the idle or move animation on the Anims/Motions/Actions panel, under Animations and click the play button in the bottom right. Your animation should be playing properly in the middle window. If everything is good and nice, then the entity is ready be set up.

1. Creating Motions for the Animations:
The 3d animations exported from 3dsmax won't show up by themselves. Create a new Motion on the Anims/Motions/Actions Panel. If you can't find the new motion button then drag the left panel up and up and up until it shows up.

I was on low screen resolution and I didn't find those buttons for two weeks :P But they are there.
So create two motions named idle and move. They will show up with a red icon, it means that they have no anims added to them. Also their name is in bold, meaning that they haven't been linked to an action or to another motion. Also the 3d animations of the entity have bold names which mean they haven't been linked to a motion yet.
Select the idle motion and then open the motion properties panel on the right. There is a box called animations, there you can select your the idle anim from a dropdown list for the idle motion, and the move anim for the move motion.

Transition Out (Sec):
This is seems little but it's always little things that matter. The engine can create transitions between two motions of the enitity. Setting the transition out to 0.20 for both the move and idle motion is wise, this way the enitity won't snap to idle position when it stops, put make a brief and smooth transition. Such settings will be ignored by random motions later. There is the possibility to tick the Ignore Transitions box, but it is not needed now.

If you press refresh on the Anims/Motions/Actions panel you will see that the motions don't have red icon anymore.

2. Creating Clauses and Conditions:
I hope you read the Object Editor Overview. Now we have to create conditions that are like questions that are asked to the entity: are you moving? are you standing?

Clause:
Create a new Clause on the Clause List Panel (left). Make it a float and name it: is_moving.

Float means that this clause will check a variable that containts a number. Make sure the new clause is selected and open the clause properties panel on the right.
Set variable to Velocity and comparison to Greater Than (>). Value to 0, default to 0. This clause will check if velocity is greater than zero or not.

Condition:
Conditions serve one purpose, they add the possibility of grouping clauses. So we could check if the entity is moving and taking damage at the same time for example. Most of the time, like right now, you add one clause to one condition. But it is needed to be done, since clauses cannot be used by the engine by without being embedded into a condition.
Create a new condition on the Condition List panel.

This is the condition that will decide of the entity plays its move or its idle animation. Make sure the new condition is selected and open the Condition Properties panel on the right side. Select the is_moving clause from the drop down list and add it.

Nice and done ready so create the game action that will decide between the move and the idle actions.

3. Creating Game Action for the Motions
On the Anims/Motions/Actions panel there are two kinds of actions: internal and game actions. If you create a new action and the name of the action is recognised by the engine it will be put under game actions otherwise it appears under internal actions. Make a new actions called default.
It will appear under game actions, it is recognised by the engine.

You can see on the image above that action have two kind of icons, the "blue film tape" and the "blue film tape coming out of a red casette". The tape means it has a motion linked to it, and the casette means it has sub-actions or nothing yet.
Make sure the new action is selected and open the action properties panel on the right. This panel has two parts: Sub Actions and Attached Motions. An action either contains other actions or motions, not both.
- The default action will contain both idle and move motions and the moving condition will determine which is played.
So add both motions to this action, by selecting them from the drop down list and adding them.

After adding both idle and move motions make sure move is on top, select it and set compare type to if and condition to moving.

Then select the idle motion in here and set compare type to else.

4. Testing Entity in Object Editor
Select one of the variable boxes on the variable bar. Set it to velocity <Action Float>. You can find more info on the variable bar in the Object Editor Overview tutorial.

Now select the default action on the Anims/Motions/Actions panel and hit the play button in the bottom right. If the velocity variable is set to 0 on the variable bar it will play idle otherwise the move motion. Also notice that the Transition Out time works between the animations. The engine smoothes the transition between the two motions when you switch velocity back and forth.

You got it! Nice work! Check it in-game right away!

Palii

Tracking and Firing


What's coming?
Your entity will bring death onto his enemies.
Tracking is when your unit follows the enemy with his weapon, but doesn't fire for personal reasons.
Prepare 3dsmax anims, create motions, clauses, aiming modifiers, then merge all this into the default action.

1. 3dsmax Tips:
We are talking about 6 max files:
- Move: What ever he does, the bones that are needed for aiming shouldn't have keyframes.
- Idle: The unit should stand still.
- Horizontal Aim (move): Only the hip bone animates. Aiming from -180 to 180 (backwards-right-foward-left-backwards) (the unit's right and left, not yours!)
- Horizontal Aim (idle): The entity master animates, so the whole unit turns around from -180 to 180. (same as above)
- Vertical Aim: The unit should use different bones than in the horizontal aims. He is aiming from -180 to 180. (backwards-down-foward-up-backwards) Use the two arm bones and the head bone to make this animation.
- Firing: The anim of the gun shaking etc. It shouldn't use bones that are used in move, idle, aim horizontal, aim vertical. If you set the arm bones (except upperarm, since it is needed for vertical aim) to Stale=Yes in all the anims, then you can use them here in the firing anim.

Notes:
- All 3 aim max files, should be 37 (0-36) frames long. It is Relic's default and is smooth enough.
- Set Stale=Yes for user properties in 3dsmax for all bones that are animated in another max file. (read this line again)
- Check through please the Combined Vis Groups tutorial if you haven't, it explains how and why.
- If you have downloaded the modtools with artsource, then it is strongly recommended that you study the supplied space marine max files.

First create motions for the animations. (how many times I have written this...)

2. Clause, Condition, Little Lua:
Create two clauses: is_firing and is_tracking (both boolean)

You also need an is_idle and is_moving clauses, check the Idle and Move tutorial for details.

Now, depending on your lua code, these clauses have to ask which hardpoint is doing what. This is where the Lua and the OE meet. In your ebps you need to define 4 variables for your hardpoint, this OE can recognise. So there are variables and values. If you haven't set up your hardpoint yet, then add the variables and values below to your hardpoint.

The 4 variables in your ebps:
- attack_motion_variable_name: This corresponds to the is_tracking clause.
- shoot_motion_variable_name: Buddy of the is_firing clause.
- horizontal_aim_motion_variable_name: This will be for a modifier.
- vertical_aim_motion_variable_name: Also modifier.
Check the Hardpoints tutorial if you have trouble.

The 4 values in ebps:
Each hardpoint has its own values for the above variables. That is how the game knows which hardpoint is firing at the moment. (weapon upgrades are not explained here) Relic has made his own set of variables, which you can use.
Example values for the above variables:
-
Weapon_Range_Tracking_Right
- Weapon_Range_Firing_Right
- Aim_Horizontal_Right
- Aim_Vertical_Right

Custom Variables and Values for OE:
It is easy. If don't want to use relic's names, then you can add your own.
Variables: DOW/ModTools/Data/ConditionVariables.lua
Values: DOW/ModTools/Data/ConditionStringPresets.lua

Ok, back to the two clauses. If you have added custom variables or values to the OE luas, then restart OE. They will appear in the dropdown list.
Select your variable names for tracking and firing accoring to your lua settings.

Conditions:
You need 5 conditions...

Add the clauses to them, don't hesitate to add more than one. ;)

3. The Modifiers:
Two modifiers will handle vertical and horizontal aiming, they ensure that the keyframes are controlled by the engine.

The verical and horizontal variable names have to be same as in the lua.

Modifiers have a range from 0 to100. A default vaule of 50 means 50%, so facing foward.
Add the aim_horizontal modifier to the idle_aim_horizontal and the move_aim_horizontal motions. Do this on the motion properties panel.

4. Creating the Combined Vis Groups:
If youre unfamilar with vis groups, then check the Combined Vis Groups tutorial.
You need to have 6 internal actions:

- The motions contained in the actions below are independent of each other, they are all set to "none".

Simple Idle_Firing Action:

Simple Idle_Tracking Action:

Simple Move_Firing Action:

Simple Move_Tracking Action:

5. Expanding the Default Action:
You got all the actions. Add them all to the default action.

Add the five conditions created earlier to make it work. Note that you don't need an idle condition.

6. Testing in OE:
You can test everything perfectly in OE

Tracking and Firing Booleans:

If you select the default action, hit play, the unit must shoot if the variable is ticked.

Horizontal and Vertical Modifers:

Changing value of these should have real-time effect in the viewport. (you need to tick tracking or firing first)
- Try to focusing the cursor with the mouse into the "value input box" and use the mouse wheel scroll up and down...sweeeet!

Good work, time to shoot some greenskins!

Palii

Melee Actions


General:
If your enitty has melee weapon(s), you will need to setup the default melee actions, so that the game recognises melee combat.
Facts:
- You will need 3dsmax animations for: Melee Attacks, Melee Blocks and being Damaged in Melee.
- Your entity can have more that one melee hardpoints at the time.
- In this case it will attack simultaneously in close combat with all his melee hardpoints.
- It is impossible to tell which melee hardpoint the entity is actually using.
- Melee actions play general (not weapon-specific) melee animations.

Example:
If there is an ork with two hardpoints, an axe in each hand. In terms of Lua Coding, the ork will attack with both weapons at the same time, so inflicting two times as much damage as with a single axe. In term of Object Editor, the ork will always play the same melee attack animations regardless of the number of close combat weapons. Such animations can be double hand attacks or simple one hand attacks as well, doesn't make any difference.

Overview:
- Prepare the animations. (3dsmax)
- Add hardpoint in your ebps and create the new weapon. (Lua)
- Create new motions for your melee animations. (OE)
- Create all the default melee actions and link the motions to them. (OE)

Tips for Animating Melee in 3dsmax:
- All Attack, Block and Damage animations are roughly 60 frames. (Relic's space marine)
- I recommend two attacks per attack animation.
- If your melee weapon is very slow then one attack may be sufficient.
- If the melee is very fast, then you could give it shorter duration.
- You can and should variate the animations, so create more than one attack anim.
- For damage animations I recommend making at least two: a damage left and damage right (check the space marine's "melee_damage_l" and "melee_damage_r"). The left and right deal looks very good in the game, even if your entity is attacked from the sides!
- For the block, a single anim can be enough.
- You will also need two extra animations: a move and an idle animation both in attacking position. This will be played when your entity is between attacking two enemies, so it is important that he stays in attacking position and he doesn't snap between attack anims and regular idle or move anims.

Lua: Ebps and Weapon:
If you haven't created your hardpoint and melee weapons for your entity, make sure you check out the Hardpoints tutorial.

Create Motions for the Animations:
Open your entity in OE. Open the Anims/Motions/Actions Panel and create a new motion for every attack, block and damage animation.
Naming them melee_attack1,2 and melee_block1,2 is wise.

Create something like melee_move and melee_idle for those two animations in attacking position.

Then add the corresponding animations to your motions one by one.

Select your anim from the dropdown list and click add. Make sure it is looping and a little transition out is needed is some cases. (most cases)

Create Random Motions Groups if needed:
If you have more than one Attack, Block or Damage motion then you'll need to create random motion groups for them. Please check the Random Motion Groups tutorial if you're unfamiliar with this procedure. Create a group for each animation type that has more than one variation. (melee_attack_group, melee_block_group, melee_damage_group)

Create the Defult Actions:
There are 4 default actions to consider:
- Melee_Charge: Here your unit perform his attacking move. Same as the default action.
Includes: move_firing, move_tracking, move, idle_firing, idle_tracking, idle
- Melee_Move: This when the entity performs moving or standing between attacking two different enemies. It needs to conain the melee_move and melee_idle motions.
Includes: melee_move, melee_idle
- Melee_Attack: The games uses this action when your entity is attacking.
Includes: melee_attack
- Melee_Damage: Used when he recieves damage. Note that block and attack motions come here as well, the unit shouldn't only play the damage animations all the time, since he is getting damage in combat...all the time.
Includes: melee_attack, melee_block, melee_damage

Ok, create the 4 default actions, they will all appear under Game Actions unless you mistyped the name.

1. Melee_Charge
This action should contain the exact same structure as your default action. (you can just copy the default action and rename it)

2. Melee_Move
Add your both melee_idle and melee_move motions to this action. A condition should determine if the entity is moving or not.

3. Melee_Attack
Open the action properties panel on the right and add your "melee_attack" motion or "melee_attack_group" motion to the action.

4. Melee_Damage
You have to make a random motion group that chooses randomly between all attack, all block and all damage motions. Create a new motion named something like melee_full_group...
Add all your "melee motion groups" or directly all your "melee motions".

Tick Randomize Each loop. The random weights are as follows: (Relic default)
- Attack Motions: 5.00
- Block Motions: 35.00
- Damage Motions: 25.00
Now select your Melee_Damage action and add your melee_full_group motion to it.
You can see that (in close combat) the only thing the engine can differentiate between is, if your entity is getting damage or not. But this is how Relic did it, and it looks good.

Don't wait anymore! Launch the game! Palii

Jump


Tutorial Overview:
Prepare all the needed jump animations. Modify your entity's ebps. Add the corresponding motions to the default game actions. Separate normal death anims from jumping death anims with a clause.

3dsmax Animations:
- Jump Preparation: From standing/running to "go up" position.
- Going up: This doesn't need to be animated. The entity is in "go up" position. (happens very fast, not much can happen in such short time)
- Jumping: Perhaps a looping animation. It is played while travelling mid-air.
- Going Down: "go down" position. (very fast as well)
- Landing: From "go down" position back to standing position.
- Jump Death: Played when the entity dies in the air. It has to be a falling animation or perhaps mid-air explosion.

The Lua Part, sbps:
GameData["squad_jump_ext"] = Reference("squad_jump_ext")
- You won't be jumping without this!
GameData["squad_jump_ext"]["setup_time"] = 2.666
GameData["squad_jump_ext"]["breakdown_time"] = 2.666
- Time in seconds reserved for those animations.
GameData["squad_jump_ext"]["charge_max"] = 90.000
GameData["squad_jump_ext"]["charge_regeneration"] = 1.000
- Maximum "Jump Points" and their regeneration rate.
GameData["squad_jump_ext"]["jump_distance_max"] = 70.000
- Maximum jump distance.
GameData["squad_jump_ext"]["jump_time_max"] = 12.000
GameData["squad_jump_ext"]["jump_time_min"] = 2.000
- Max is the time the entity takes to jump to maximum distance.
- Min is the absolute minimum jump time.
GameData["squad_jump_ext"]["charge_jump_cost_max"] = 45.000
- Cost of "Jump Points" to jump the distance specified by jump_distance_max.
GameData["squad_jump_ext"]["charge_jump_cost_min"] = 45.000
- Absolute minimum of "Jump Points" cost regardless of the distance.
GameData["requirements"] = Reference("requirement_table")
- Any requirements.
GameData["teleport"] = false
- Boolean...

Note: Other options are in tuning/jumping.lua. (I guess those will make changes to all the other races as well)

Create Motions, Default Actions:
Create a motion for each animation as you always do :D
Then you need these game actions: jump_setup, jump_goup, jump_flying, jump_godown, jump_breakdown

Add your motions to these action.

Dead In The Air:

The jump death animation has to be placed in the die default action. A clause determines if the entity is dead in the air or on the ground..
Create the is_jumping clause. (boolean, jumping = = true, default: false)

Don't forget to add this clause to a condition.

Modify your die action and separate your jump_death and other death motions/actions. (if...else)

Teleport:
If you use teleport, not jump, then you can discard the jump_goup, jump_flying, jump_godown actions. Also set "teleport" to true in sbps.

Shall the Emperor bless you for making a new race!

Palii


Post comment Comments
Tony233
Tony233 - - 37 comments

Thats very helpful :) But I cant see the attached images tho

Reply Good karma Bad karma+1 vote
Guest
Guest - - 689,200 comments

This comment is currently awaiting admin approval, join now to view.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: