Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Spot fx animations and effects

From TWC Wiki
Revision as of 06:28, 23 November 2021 by Makanyane (talk | contribs)
Jump to navigationJump to search

Effects such as smoke, or animated effects such as the gatehouse flags are added to RTW and Rome Remastered using the spot_fx system.

Spot_fx

The spot_fx is a .cas model which gives the location and rotation of the effect - the name of the mesh/es inside the .cas match the name of the effect to be called. If you need two versions of the same effect you'd use 'smoke00' and 'smoke01' etc.

The blacksmiths and armourers have examples of spot_fx using smoke. The .cas is added to the buildings dbb listing after the physical_info line:

barbarian_armourer
{
	stat_cat medium_wooden
	localised_name barbarian_armourer
	level
	{
		min_health 1
		battle_stats
		item		barbarian_armourer
		physical_info	info_barbarian_armourer.cas
		spot_fx		barbarian_armourer_spot_fx.CAS
	}

The gatehouse buildings have examples of spot_fx files which call animated 'models_spot' which give the animated flag effects.

The .cas files for spot_fx are placed in data/models_building/spot_fx.

Changing spot_fx cas files

Versions of IWTE from v21_11_c.exe onwards will correctly export and import the fx cas files to .dae for Blender/Max.

The important thing to note is the mesh naming and the transforms. The transforms tell the game where the effect should be moved to. To add a new mesh create a flat plane at 0,0,0 if you need to include a rotation change the shape in EDIT mode so you can tell which way you've turned the plane. Then in OBJECT mode move and rotate the plane so it is centered where you want the effect. DO NOT apply the transforms, the end result in Blender still needs to show the transform values, see pic below:

How the spot_fx file should look in object mode in Blender

Models_spot

Data/models_building/models_spot/flag_horizontal_large.cas is an example of an animated spot effect. The flag uses an armature and keyframes that are contained in the same file as the model, and does not use an external skeleton.

The models_spot need to be added to the game in the same way as building items. The existing ones are found in data/descr_items/di_spot_items.txt. The horizontal flag is coded as:

type					flag_horizontal_large
lod
max_distance				200
model_anim					models_spot/flag_horizontal_large.CAS
lod
max_distance				4000
model_rigid					models_spot/flag_horizontal_large_low.CAS

Note that the model_anim setting is needed for the high lod to use its animation. The model_rigid version is provided to stop the game having to animate the object when out of viewing distance.

In addition to being added as building items the models_spot need to be added to spot_items in descr_building_battle.txt, the vanilla entries just include:

spot_items
{
 flag_vertical_small
 {
  any			flag_vertical_small
 }
 flag_vertical_large
 {
  any			flag_vertical_small
 }
 flag_horizontal_large
 {
  any			flag_horizontal_large
 }
}

The part in italics is the spot_fx name which needs to be used in the _fx.cas as a mesh name, the part in bold is the models_spot item name.

YOU can help us improve this Wiki! ~ Look for ways to help and editing advice. ~ If you need further advice, please post here.