hopefully this helps the rest of the modding community out...
I will be updating this as I go, little parts at a time (or big amounts if I have the time
)
Note: this tutorial is supposed to cover as much detail as possible, not as short as possible...
if you don't want to read something long, then this tutorial isn't for you How StarCraft displays Graphics Chapters:
- 1. Loading the grp
- 1a. loading the pallet and the graphic file (.pal and .grp)
- 1b. the .dat's effect on the graphic file
- 1c. how the Iscript sends orders to the graphic
- 2. the basic display of units
- 2a. how the grp's frames work
- 2b. effects you can add to the graphics
- 2c. how unit's Iscript(s) work
- 3. different ways to design your own weapon for a unit
- 3a. how most missile weapons work
- 3b. how most gun weapons work
- 3c. how to design a custom script for your weapons
The tutorial:
1. Loading the grp 1a. In StarCraft, all the graphic files used for animations are formatted to reduce space used up.
The encrypted graphic files
(.grp files), cannot be run without a pallet file
(.pal).
The way the encryption works is by limiting all graphics to 255 different colors, the grp's are stored with numbers telling starcraft which pallet Id# to read.
the pallet files store the 255 different colors that starcraft uses, however...there are multiple types of pallets.
The game engine uses multiple pallets to change colors of a graphic in-game (having the same images Id#, but using a different color pallet), or to make different types of objects so everything's not restricted to the same color.
1b. the .dat files can change many things in the graphic files, for example, it can change whether a object plays turning frames
(each frame is 17 grp frames, instead of 1), or it can change the colors the graphic appears as
(by changing the images pallet file).
(see more on this topic in chapters 2b and 3c)
1c. The Iscript.bin file issues orders to all graphic files
(that have unknown 1 checked in Images.dat, in DatEdit) telling it how to play the frames by sending different orders to it through a command code that Blizzard created, these orders include what frames to play for walking animations
(for units), what sounds to play and when to play them, and how to display any other orders that you can throw at them.
This file can even control such advanced things such as when to cast the attack, how many times to cast the attack, and how/when to cast spells.
2. the basic display of units 2a. In all unit graphics, they go into 1 of 2 categories, the first is the military type, in other words the ones with movement frames and turning frames, the second is the building type, this type has a regular frame, a almost finished frame, and other miscellaneous frames
(like lifting and during training troops/upgrading).
In all military frames, the units follow the same pattern, every frame military units have is multiplied by 17,
(turning directions, for the other 15 directions it mirrors frames 1-15, remember that 0-16 are the un-mirrored frames).
However, there is a exception to the military type frames, some units use special spells that have their own frames, and some of the last few frames in the grp are the death commands, these death frames are ordered specially from a image overlay by the Iscript file.
As for the building type frames, theres a just-built frame, lifting frames, idle frame, then the almost finished frame, however most of these frames usually depend on overlays to add some effects
(overlays are controlled by Iscript.bin, but can use images.dat for overlay positions) 2b. The special "graphic" effects can range from pretty much anything you can think of. There are 3 common ways to make a "graphic" effect, the first is by editing the pallet
(.pal) file in order to change the unit's colors/making the same color on a unit keep changing to something else. The second, is to create a new Iscript, when making your own Iscript try to be creative, don't just make a Drone attack then die, try something more unique like a zergling attacking its target then floating up with the shvertpos command and then playing the burrowing frames, just try to create something new with whatever effects you add. Some common effects that I've seen a bunch of people repeating are quite annoying, for example, I've seen a bunch of people with units suiciding when they attack, if your going to copy something like that at least make it suicide in a amusing and original way...another thing I've seen copied a bunch is adding spells to a unit which doesn't need to have them for example, kerrigan launching nuclear missiles. There's also another way to make special graphic effects, it's by editing the .dat files.
Though I may not remember all of the graphic effects that you can change by editing the .dat files, there isn't too many you need to know.
Pretty much you just need a good knowledge of Flingy.dat, Sprites.dat, and Images.dat for most of the changes will will want to make with this technique.
2c. The Iscript.bin file sends certain commands to the unit, these type of command fits into 2 categories, buildings, and military.
these types can differ on the Init command, and many other things which I won't cover here, sorry.
In building units, the Init command makes it start with the first frame (almost constructed frame), then go to the regular frame
in military units, the Init command orders units to play the first frame in the direction specified by units.dat (most units use random)
There is almost no limit on how a iscript can control a unit, but there are a few simple things you need to know about the Iscript in order to program your own version of it.
Headers - these go into 2 categories, the first one is the basic ones that come with the unit, these include the spawning (Init) header, ground attack start (GndAttkInit) header, etc. The second type of header, is the custom header.
Custom headers can be placed anywhere in the Iscript, and cannot by called by regular commands unless directly orderred to with a goto type command in the Iscript; Even though they're not in the main header section, they can still be called.
Also, beside every header (in IceCC), you can place a custom name for a header.
Remember when placing headers in any command, or in the name section, that it is Case-Sensitive.
There's also a common Iscripting trick that some modders use to save space for a header that's used by multiple commands, the way it works is by naming one main header the same as another header so it's called instead of 2 separate headers with the same function.
3. different ways to design your own weapon for a unit 3a. The way most missile graphics for weapons work is, in Flingy.dat, it informs the missile graphic how fast to move, and most of how to display it.
In the Iscript it uses the Init header when the missile is spawned, GndAttkInit for the missile trail, a local (custom header) for the missile's flying script, and the death header for when it hits the target.
3b. Not added yet
3c. Not added yet
some chapters incomplete, will add them later
If you have any comments/suggestions/notes you want me to add, feel free to post them