HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Cinematic general tricks

04-08-2006, 01:59 PM#1
iNfraNe
This "tutorial" illustrates alot of tricks cinematic makers can use to spice up their cinematic visually. I've collected alot of the older and newer tricks and placed them into 1 tutorial.

This tutorial currently holds:
  • Black Cinematic Borders
  • Basic Initialization Triggers
  • Lights (ambient light and omnilights)
  • Setting specific animations for units
  • Getting Model Data
  • Turning heads/torsos (Locking body part facing)
  • Timing

Black Cinematic Borders Thanks go to Hyarion

This requires no imported files. To make the borders black simply go to Advanced > Game Interface...
And change these things:
Table:
Value to be changed:Value to be given:
Image: Cinematic BorderUI\Widgets\EscMenu\Human\blank-background.blp
Image: Console BackgroundUI\Widgets\EscMenu\Human\blank-background.blp
Image: Game Menu BackgroundUI\Widgets\EscMenu\Human\blank-background.blp

Basic Initialization Triggers

I often see cinematics where the music is running trough the custom music played as a sound, simply because the maker didnt have music on and didnt notice. I also very often see a cinematic where there still are ambient sounds, which brings down the mood. Ambient sounds and music should both be triggered, not left to the game randomly.

This trigger will make the game start in a faded out cinematic mode with no sounds at all:
Trigger:
Example Init
Collapse Events
Map initialization
Conditions
Collapse Actions
Cinematic - Turn cinematic mode On for (All players)
Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
Sound - Stop music Immediately
Sound - Clear the music list
Sound - Stop music Immediately
Sound - Disable dawn and dusk sounds
Custom script: call StopSound(bj_nightAmbientSound, true, true)
Custom script: call StopSound(bj_dayAmbientSound, true, true)

The last 2 actions turn off the ambient sounds, be sure to copy them right, else you will get an error.

Lights (ambient light and omnilights)

An often overlooked feature warcraft brings are lights. Tho they seem not highly usable they are in fact quite usable.
Let's start with ambient lighting.
Ever noticed how the lighting goes a little blue when it gets to nighttime? That lighting is actually created by a model and it is changable by triggers!

The syntax is:
Collapse JASS:
call SetDayNightModels("TerrainLightModelHere","UnitLightModelHere")
Ofcourse, you should replace "TerrainLightModelHere" and "UnitLightModelHere" with paths to models. Simply giving them no, or a false path will lead to no light, so the screen will turn pitch black.
Collapse JASS:
call SetDayNightModels("","")
Does makes the terrain and units have no lighting at all.

To create a model, you should either get into some easy .mdl editing, or use any of these programs:
iNfraNe's Ambient Light Creator
ghEEd's LightModel Creator

Once you have created a model with any of these tools you should convert it to .mdx using this tool (or any other): Yobgul's Warcraft III File Converter
After this, import the file (as .mdx) and give it a name, for example my name will now be "Light.mdx".
If I want to use this model for lighting this is the syntax:
Collapse JASS:
call SetDayNightModels("Light.mdl","Light.mdl")
Notice .mdl, yes, you did import it as .mdx but wc3 converts it to .mdl again at mapinit and you should use .mdl as extention in the syntax.

Next you will think, why the **** would I want a pitch black surrounding? The answer is simple. You can now use omnilights to light the environment, like glowing torches. This will give a really nice effect, you can use ghEEd's program to create a lightmodel yourself.

Setting specific animations for units

Ever wanted to make a unit play a specific animation, like "Stand - 2" but then found out the unit still played a random animation?
There is a way out. You should be using the animation native:
Collapse JASS:
native SetUnitAnimationByIndex takes unit whichUnit, integer whichAnimation returns nothing

First, you should store the unit you want to play the animation in a variable, like... tempUnit. In jass, this variable is then called udg_tempUnit (jass is case sensitive, note).

After this, extract the sequences list from the model, and check which number is the animation you want to play (look under the chapter "Getting Model Data" on how to do this). When u have found the animation number, simply input it in the call:
Collapse JASS:
call SetUnitAnimationByIndex(udg_tempUnit, 2)

There, u've let the unit play a specific animation.

Getting Model Data

Often you will want to get something from a model. Like:
  • Attachment points
  • Animation sequences
  • Texturepaths
  • etc
Not much people actually know how easy it is to get this data. I will start with attachment points.

Attachment Points

First, get Yobgul's Warcraft III File Converter to convert the model to .mdl (also, get Prophet's Warcraft III Viewer or something similar to extract your model from the mpq).

Once you have extracted and converted the model, simply open it with notepad. Now search the file for "Attachment". You will find something like this first:
Code:
Attachment "Head Ref" {
	ObjectId 13,
	Parent 1,
}
This is an attachment point, to attach a special effect to it in the editor choose "head" as point, always ignore the Ref. You will find all the attachment points the model has under eachother in this section.
Most common attachment points are:
  • Overhead (over the unit, does not follow animations)
  • Origin (under the unit, does not follow animations)
  • Head (does follow animations)
  • Chest
  • hand left (or right)
  • foot left (or right)
  • Weapon
But I suggest taking a look at the model when you want something else.

Animation Sequences

This is quite easy to find. You can use this to play a specific animation (as I talked about before). Go to the top of the model file and you will see something like
Code:
Sequences 12 {
	Anim "Stand" {
		Interval { 167, 1167 },
		MinimumExtent { -25.0869, -29.3512, 5.52004 },
		MaximumExtent { 35.6949, 29.3513, 18.8083 },
		BoundsRadius 36.2281,
	}
...
This list is in order, the first animation you see (stand in this case, and most cases), is index 0. The second animation you see is index 1 etc.

For other usefull things you can get from the model visit the .mdl editing section.

Turning heads/torsos (Locking body part facing)

It is possible to lock a unit's head OR torso by triggers. You can find the action under "Animation":
Trigger:
Animation - Lock (Last created unit)'s Head to face (Last created unit), offset by (0.00, 0.00, 90.00)
You need to change the units ofcourse. If you let 1 unit look at another his head or chest will follow this unit untill you reset the body part facing.
It is possible to lock the facing to the unit itself, making only the offset factor matter (this way you can make a unit always look in the same direction).

Timing

Most cinematics time their events with WAITS. Tho it might seem handy to use this at the time it is VERY inaccurate and will differ on each computer.
Even gametime waits dont work well. You have two options in this case:

Use a periodic timer to run events (this is hard, and therefore Anitarf has created a system based on this, with ALOT of good stuff in it, I suggest taking a look at it Cinematic System)

or use timers. This will make your cinematic have ALOT of different triggers but the increase in accurate timing is definately worth it. Another possibility is the use of the event "elapsed game time" which is also accurate.

Last words

I hope you found usefull stuff in this tricks tutorial. If you have questions about a certain subject, just make a new thread, dont ask in this one. If you have got more tricks to share please share here (i will add them to this list of tricks).
04-08-2006, 02:43 PM#2
kaldoreielf
Great! I think this should have been in the "--Submit a Tutorial--" section though...
04-08-2006, 02:56 PM#3
iNfraNe
its not really a tutorial, more like general tips/tricks, so I dont think so.
04-08-2006, 03:46 PM#4
Whitehorn
Well my 'tips' topics got relocated there too :(. This is a tutorial AFAIK.
04-08-2006, 06:12 PM#5
Rao Dao Zao
That thing about the lighting models... I love you for it. You are a genius.
05-28-2006, 04:40 AM#6
Pheonix-IV
The light thing is awesome, but is it possible to change ONLY the Night ambient light or ONLY the day ambient light? Also, does anyone know what the default models are and where to find them?
05-28-2006, 09:44 AM#7
iNfraNe
Quote:
Originally Posted by Pheonix-IV
The light thing is awesome, but is it possible to change ONLY the Night ambient light or ONLY the day ambient light? Also, does anyone know what the default models are and where to find them?
The day night stuff is made with animations, it is changable, but the programs dont support it.

The normal models can be found in: Environment\DNC\
Each tileset has its own model.
05-28-2006, 10:02 PM#8
Waldbaer
This is really useful. I found some useful things that were new to me, too, although I think I'm a quiet experienced cinematic maker.
I think it's very nice of you Infrane, that you are so open with your technical secrets of cinematic-making and present them to anybody who wants to know something about them!
That's not the case with everybody if I think about this thing called map-protection...
05-29-2006, 07:29 AM#9
Pheonix-IV
Notice that he waited until after he won the cinematic contest to tell us this stuff :P

Anyway, cheers, now i can just alter the base one in MDL to make night combat a reality! Woo!
01-01-2007, 09:16 PM#10
Ammorth
I noticed the links for the Light model creators have perished... Can someone please post it somewhere else, or refer me to a place where I can get either of them?

Edit: Don't feel like posting again.

Merci Beacoup!
01-01-2007, 10:00 PM#11
iNfraNe
Quote:
Originally Posted by Ammorth
I noticed the links for the Light model creators have perished... Can someone please post it somewhere else, or refer me to a place where I can get either of them?
Sorry for that, my server has crashed so the site has been down for some time.
Here they are.
Attached Files
File type: rarWar3 Light Creator.rar (35.0 KB)
File type: rarLightModelCreator.rar (5.5 KB)
07-16-2007, 12:48 AM#12
player_72985
I know this is a 1+year post, however Infrane, the LightModelCreator is not working, and the error "Component 'comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid" - any ideas on fixes?
04-08-2008, 04:35 AM#13
Drazalon
hmmm. the jass specific animation is surprisingly simple. ill try this out. if all goes well..
08-18-2008, 02:51 PM#14
iNfraNe
Quote:
Originally Posted by player_72985
I know this is a 1+year post, however Infrane, the LightModelCreator is not working, and the error "Component 'comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid" - any ideas on fixes?
As the filedescription says, get frameworks.