Holocaust
07-17-2006, 9:11 AM
This thread contains questions commonly asked by modders that concerns Ice and/or IceCC.
Q: "How do I give a unit a random attack?"
A: Random attacks/animations are all done by using the code known as __1e_condjmp <var> <label>. The var, stands for the chance out of 256 that __1e_condjmp will execute and label stands for which header the animation will "jump" to when executed, i.e __1e_condjmp 50 Plague
Now this code, will enable a unit to, 50/256, jump to a header named Plague. For this to work, you must create a new header named Plague because the label placed in the __1e_condjmp must match the header that it's specified to jump to. The header name can be anything you want, as long as it matches the label name you put in the __1e_condjmp code. i.e.
The placement of the __1e_condjmp code can be placed almost anywhere, but it's important to put it somewhere before the animation ends, i.e. somewhere before gotorepeatattk.
So let's try this out, in this example, we're going to make a marine randomly 50/256 use plague after finishes shooting it's rifle. Here's the Marine's original attack animation,
MarineGndAttkInit:
playfram 0x00 # frame set 0
wait 1
playfram 0x11 # frame set 1
wait 1
playfram 0x22 # frame set 2
MarineGndAttkRpt:
wait 1
nobrkcodestart
playsnd 69 # Bullet\TMaFir00.wav
attack25 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
nobrkcodeend
gotorepeatattk
ignorerest
MarineGndAttkToIdle:
playfram 0x11 # frame set 1
wait 1
playfram 0x00 # frame set 0
wait 1
goto MarineOther
Using what we've learned above, insert the __1e_condjmp code along with it's var and label. When you're done with that, it should look something like this,
MarineGndAttkInit:
playfram 0x00 # frame set 0
wait 1
playfram 0x11 # frame set 1
wait 1
playfram 0x22 # frame set 2
MarineGndAttkRpt:
wait 1
nobrkcodestart
playsnd 69 # Bullet\TMaFir00.wav
attack25 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
__1e_condjmp 50 Plague
nobrkcodeend
gotorepeatattk
ignorerest
MarineGndAttkToIdle:
playfram 0x11 # frame set 1
wait 1
playfram 0x00 # frame set 0
wait 1
goto MarineOther
Now we need to make a new header, because if we don't, then the animation won't be able to execute, and IceCC won't be able to compile your script. Every attack script needs to end with something that will force the attacking unit to loop back to it's normal attack animation, or else, the unit would just attack once and stand idle. An attack script also needs to contain attack/casting commands for obvious reasons, and in this script we want to make the marine use plague. The useweapon <id> command is what we would put in the header for the marine to use it's "special" attack. ID stands for the weapon identification, every weapon's ID can be found in the Weapons Editor in Arsenal III, at the bottom right hand corner. In this case, Plague's ID is 60, so the useweapon code we'll be using will look like this, useweapon 60. Let's create our new header, after you're finished, your marine attack script should look something like this,
MarineGndAttkInit:
playfram 0x00 # frame set 0
wait 1
playfram 0x11 # frame set 1
wait 1
playfram 0x22 # frame set 2
MarineGndAttkRpt:
wait 1
nobrkcodestart
playsnd 69 # Bullet\TMaFir00.wav
attack25 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
__1e_condjmp 50 Plague
nobrkcodeend
gotorepeatattk
ignorerest
MarineGndAttkToIdle:
playfram 0x11 # frame set 1
wait 1
playfram 0x00 # frame set 0
wait 1
goto MarineOther
Plague:
wait 1
useweapon 60
wait 1
gotorepeatattk
So now, just compile it with your mod folder and watch your marines burn up your opponent's health rapidly.
NOTE: If your IceCC gets an error about the __1e_condjmp, just replace the code with randcondjmp. The label and variable can stay the same.
There is also another way to do this, the alternative option shows the icon of your random weapon. An example of this, BSTRhino's Doom Terran Marine/Ghost.
We start the alternative option by going into Arsenal III's Unit Editor and switching the Marine's air attack to Plague. Then we save that to our mod folder.
Next, in IceCC, repeat the steps of creating the new header and inputting the __1e_condjmp in the attack animation. Here's the different part, in your plague animation, instead of using the useweapon code, put attack25 2. The attack 25 codes refer to which weapon slot the unit will use when attack. In the original Marine attack script, you should see the code attack25 1 somewhere near the middle. Attack25 1 makes a unit use whatever weapon is in it's ground weapon slot, the marine's being the gauss rifle, while attack25 2 forces the unit to use the weapon located in it's air weapon slot, both are found in Arsenal III as you should know by now. Let's put that in the script, after you're done, it should look something like this,
MarineGndAttkInit:
playfram 0x00 # frame set 0
wait 1
playfram 0x11 # frame set 1
wait 1
playfram 0x22 # frame set 2
MarineGndAttkRpt:
wait 1
nobrkcodestart
playsnd 69 # Bullet\TMaFir00.wav
attack25 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
__1e_condjmp 50 Plague
nobrkcodeend
gotorepeatattk
ignorerest
MarineGndAttkToIdle:
playfram 0x11 # frame set 1
wait 1
playfram 0x00 # frame set 0
wait 1
goto MarineOther
Plague:
wait 1
attack25 2
wait 1
gotorepeatattk
Now save and compile, when you run your mod, you should see the plague icon in your marine's stats.
Q: "How do I change move speeds of units like the Marine, Zealot and Zergling? When I try changing their speeds in Arsenal III, it just screws up"
A: When you try to change a unit that animates when it walks such as the infantry in Arsenal III's walk speed, you could get some unwanted results. To change a unit's walk speed, just decompile the unit of your choice, and in their walking animation, lower or heighten the numbers next to the move codes. The move codes determine how many graphical units the unit will move forward when ordered to, so when you heighten the move numbers, you're just making a unit take "bigger steps", therefore making it move faster.
In our example here, we're going to make a Marine walk twice as fast. In it's move animations, the move numbers are all 4, so let's just double that. Your Marine's move script should look something like this,
MarineWalking:
move 8
wait 1
playfram 0x55 # frame set 5
move 8
wait 1
playfram 0x66 # frame set 6
move 8
wait 1
playfram 0x77 # frame set 7
move 8
wait 1
playfram 0x88 # frame set 8
move 8
wait 1
playfram 0x99 # frame set 9
move 8
wait 1
playfram 0xaa # frame set 10
move 8
wait 1
playfram 0xbb # frame set 11
move 8
wait 1
playfram 0xcc # frame set 12
move 8
wait 1
playfram 0x44 # frame set 4
goto MarineWalking
Save, compile and your marine should walk twice as fast.
---------------------------------------------------------------------------------------------------------------
Q: "How do I give a unit that doesn't have an attack without crashing Starcraft?"
A: You would have to give it attack and returning to idle after attack animations. In this example, we're going to give the Dropship an air and ground attack. First off, at the top of the script, you should see a list that comprises of the Dropship's animations such as DropshipDeath. In the GndAttkInit/AirAttkInit/Gnd/AirAttkRpt replace the none with something like DropshipGndAttkInit and in the Gnd/AirAttkToIdle replace the none with something like DropshipGndAttkToIdle. Now the script will have something to work with when it attacks a unit, but we're not done yet. Now, create new headers that correspond with the headers listed in the list of animations.
First off, we want the Dropship to have an attack animation, so we create a new header that matches the header name in the animation list. We're going to keep it simple for now and use only one attack animation for the air and ground. We'll just use a couple of waits and an attack26, followed by a gotorepeatattk. Now here, we're using attack26 instead of attack25 1. Why you might ask? attack26 commands the unit to use the appropriate weapon when faced with each enemy (Ground attack for ground units etc.) This also shortens a script and doesn't allow seperate animations for the air and ground attacks, but since we're keeping it simple, that shouldn't matter. Since the GndAttkInit is placed in the RptAttk corresponding list and the attack animation ends with gotorepeatattk, the dropship's new animation will continuously loop back to the start until the enemy is gone.
Now for the Returning to idle animations. If you're not up to creating your own idle animations just yet, just replace whatever you put in the Dropship's AttkToIdle slots to DropshipOther. As you can see in the DropshipOther animation, it's just a bunch of shvertpos and wait codes. Shvertpos stands for Shift vertical position, so the Dropship, in this animation just hovers up and down like it does when idle.
When you're done all that, your script should look something like this,
# ----------------------------------------------------------------------------- #
# This is a decompile of the iscript.bin file 'data\scripts\iscript.bin'
# created on: Mon Jul 17 08:39:25 2006
# ----------------------------------------------------------------------------- #
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 223 Dropship (terran\dropship.grp)
.headerstart
IsId 68
Type 12
Init DropshipInit
Death DropshipDeath
GndAttkInit DropshipGndAttackInit
AirAttkInit DropshipGndAttackInit
SpAbility1 [NONE]
GndAttkRpt DropshipGndAttackInit
AirAttkRpt DropshipGndAttackInit
SpAbility2 [NONE]
GndAttkToIdle DropshipOther
AirAttkToIdle DropshipOther
SpAbility3 [NONE]
Walking DropshipWalking
Other DropshipOther
BurrowInit [NONE]
.headerend
# ----------------------------------------------------------------------------- #
DropshipInit:
imgul09 224 0 42 # DropshipShad (terran\dropship.grp)
playfram 0x00 # frame set 0
goto DropshipOther
DropshipOther:
shvertpos 1
waitrand 8 10
shvertpos 2
waitrand 8 10
shvertpos 1
waitrand 8 10
shvertpos 0
waitrand 8 10
goto DropshipOther
DropshipGndAttkInit:
wait 1
attack26
wait 1
gotorepeatattk
DropshipDeath:
playsnd 210 # Terran\DROPSHIP\TDrDth00.wav
imgol08 332 0 0 # TerranBuildingExplosionsmall (thingy\tBangS.grp)
wait 3
end
DropshipWalking:
imgol08 225 0 0 # DropshipGlow (thingy\tdrGlow.grp)
shvertpos 0
goto local00
local00:
wait 125
goto local00
---------------------------------------------------------------------------------------------------------------
Q: "How do I make a weapon do a different explosion?"
A: This is quite easy to do and very effective at making your unit attacks flashy. In this example, we'll make the Gemini Missiles explode like a nuke upon contact. First, let's decompile the Nuke's script and copy these 2 codes that are located in the Nuke's burrowinit,
imgol08 428 0 0 # Smallexplosion (thingy\small.grp)
sprol0f 267 0 214 # NuclearExplosion (thingy\NukeHit.grp)
These two codes are image overlays which make images appear, and in this case, makes the big nuclear explosion.
Now we decompile the Gemini Missile's script which is in the flingy section of IceCC. Since we want to make the nuke appear when the Missiles explode, we paste the two codes in the GeminiMissiles death, so it'll look something like this,
GeminiMisslesDeath:
playsnd 9 # Misc\ExploSm.wav
imgol08 428 0 0 # Smallexplosion (thingy\small.grp)
sprol0f 267 0 214 # NuclearExplosion (thingy\NukeHit.grp)
domissiledmg
wait 1
end
Save and compile, and voila, nukes for missiles.
---------------------------------------------------------------------
Basic overview of weapon image overlays
Weapon image overlays are commonly used by units when they're attacking, such as the Firebat, the Battlecruiser and Guardian.
An Image overlay is usually placed near the start of the unit's attacking animation , for example the Battlecruiser. When the Battlecruiser attacks, you see a small dome of orange erupt from the Battlecruiser's front. The image overlay in the BC's attack animation causes this, the image overlay which is this:
imgol08 446 0 0 # BCLaserFireOverlay (thingy\elbBat.grp)
If you were to ever remove that, you wouldn't be able to see the eruption before the BC fires it's weapon.
If you wanted, you could copy an image overlay from another unit and placing it in another unit's attack animation, giving it a distinct, unique attacking style. Example, Guardian using the Firebat's flame overlay to make it seem like it's breathing fire.
Image overlays are also used in death animations, like when you destroy a building, it shows the image of an explosion. Explosion overlays are usually in a unit/sprite's death animation. However, some units do not use image overlays in their death animations, and the image seen when they die, are simply frames part of their graphic file that play when the time is right.
--------------------------------------------------------------------------------------------------------------------------------
If you have any more questions you'd like to ask, PM any of the Modding Gurus. If you'd like to add something or comment, feel free to add. I hope this FAQ cleared up a few questions that many of you modders are frequently asking.
If you've learnt something from these posts that the Gurus took from their spare time to right time, please at least commend them by adding to their rep. This shows appreciation for people who take the time to teach you what you didn't know. This applies to every thread in the SC Tutorial Section, not just this one.
EVRY1 LIEKZ 2 B APRECIATED FOR THEIR EFFORTZ, M I RITE?
Q: "How do I give a unit a random attack?"
A: Random attacks/animations are all done by using the code known as __1e_condjmp <var> <label>. The var, stands for the chance out of 256 that __1e_condjmp will execute and label stands for which header the animation will "jump" to when executed, i.e __1e_condjmp 50 Plague
Now this code, will enable a unit to, 50/256, jump to a header named Plague. For this to work, you must create a new header named Plague because the label placed in the __1e_condjmp must match the header that it's specified to jump to. The header name can be anything you want, as long as it matches the label name you put in the __1e_condjmp code. i.e.
The placement of the __1e_condjmp code can be placed almost anywhere, but it's important to put it somewhere before the animation ends, i.e. somewhere before gotorepeatattk.
So let's try this out, in this example, we're going to make a marine randomly 50/256 use plague after finishes shooting it's rifle. Here's the Marine's original attack animation,
MarineGndAttkInit:
playfram 0x00 # frame set 0
wait 1
playfram 0x11 # frame set 1
wait 1
playfram 0x22 # frame set 2
MarineGndAttkRpt:
wait 1
nobrkcodestart
playsnd 69 # Bullet\TMaFir00.wav
attack25 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
nobrkcodeend
gotorepeatattk
ignorerest
MarineGndAttkToIdle:
playfram 0x11 # frame set 1
wait 1
playfram 0x00 # frame set 0
wait 1
goto MarineOther
Using what we've learned above, insert the __1e_condjmp code along with it's var and label. When you're done with that, it should look something like this,
MarineGndAttkInit:
playfram 0x00 # frame set 0
wait 1
playfram 0x11 # frame set 1
wait 1
playfram 0x22 # frame set 2
MarineGndAttkRpt:
wait 1
nobrkcodestart
playsnd 69 # Bullet\TMaFir00.wav
attack25 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
__1e_condjmp 50 Plague
nobrkcodeend
gotorepeatattk
ignorerest
MarineGndAttkToIdle:
playfram 0x11 # frame set 1
wait 1
playfram 0x00 # frame set 0
wait 1
goto MarineOther
Now we need to make a new header, because if we don't, then the animation won't be able to execute, and IceCC won't be able to compile your script. Every attack script needs to end with something that will force the attacking unit to loop back to it's normal attack animation, or else, the unit would just attack once and stand idle. An attack script also needs to contain attack/casting commands for obvious reasons, and in this script we want to make the marine use plague. The useweapon <id> command is what we would put in the header for the marine to use it's "special" attack. ID stands for the weapon identification, every weapon's ID can be found in the Weapons Editor in Arsenal III, at the bottom right hand corner. In this case, Plague's ID is 60, so the useweapon code we'll be using will look like this, useweapon 60. Let's create our new header, after you're finished, your marine attack script should look something like this,
MarineGndAttkInit:
playfram 0x00 # frame set 0
wait 1
playfram 0x11 # frame set 1
wait 1
playfram 0x22 # frame set 2
MarineGndAttkRpt:
wait 1
nobrkcodestart
playsnd 69 # Bullet\TMaFir00.wav
attack25 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
__1e_condjmp 50 Plague
nobrkcodeend
gotorepeatattk
ignorerest
MarineGndAttkToIdle:
playfram 0x11 # frame set 1
wait 1
playfram 0x00 # frame set 0
wait 1
goto MarineOther
Plague:
wait 1
useweapon 60
wait 1
gotorepeatattk
So now, just compile it with your mod folder and watch your marines burn up your opponent's health rapidly.
NOTE: If your IceCC gets an error about the __1e_condjmp, just replace the code with randcondjmp. The label and variable can stay the same.
There is also another way to do this, the alternative option shows the icon of your random weapon. An example of this, BSTRhino's Doom Terran Marine/Ghost.
We start the alternative option by going into Arsenal III's Unit Editor and switching the Marine's air attack to Plague. Then we save that to our mod folder.
Next, in IceCC, repeat the steps of creating the new header and inputting the __1e_condjmp in the attack animation. Here's the different part, in your plague animation, instead of using the useweapon code, put attack25 2. The attack 25 codes refer to which weapon slot the unit will use when attack. In the original Marine attack script, you should see the code attack25 1 somewhere near the middle. Attack25 1 makes a unit use whatever weapon is in it's ground weapon slot, the marine's being the gauss rifle, while attack25 2 forces the unit to use the weapon located in it's air weapon slot, both are found in Arsenal III as you should know by now. Let's put that in the script, after you're done, it should look something like this,
MarineGndAttkInit:
playfram 0x00 # frame set 0
wait 1
playfram 0x11 # frame set 1
wait 1
playfram 0x22 # frame set 2
MarineGndAttkRpt:
wait 1
nobrkcodestart
playsnd 69 # Bullet\TMaFir00.wav
attack25 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
playfram 0x33 # frame set 3
wait 1
playfram 0x22 # frame set 2
wait 1
__1e_condjmp 50 Plague
nobrkcodeend
gotorepeatattk
ignorerest
MarineGndAttkToIdle:
playfram 0x11 # frame set 1
wait 1
playfram 0x00 # frame set 0
wait 1
goto MarineOther
Plague:
wait 1
attack25 2
wait 1
gotorepeatattk
Now save and compile, when you run your mod, you should see the plague icon in your marine's stats.
Q: "How do I change move speeds of units like the Marine, Zealot and Zergling? When I try changing their speeds in Arsenal III, it just screws up"
A: When you try to change a unit that animates when it walks such as the infantry in Arsenal III's walk speed, you could get some unwanted results. To change a unit's walk speed, just decompile the unit of your choice, and in their walking animation, lower or heighten the numbers next to the move codes. The move codes determine how many graphical units the unit will move forward when ordered to, so when you heighten the move numbers, you're just making a unit take "bigger steps", therefore making it move faster.
In our example here, we're going to make a Marine walk twice as fast. In it's move animations, the move numbers are all 4, so let's just double that. Your Marine's move script should look something like this,
MarineWalking:
move 8
wait 1
playfram 0x55 # frame set 5
move 8
wait 1
playfram 0x66 # frame set 6
move 8
wait 1
playfram 0x77 # frame set 7
move 8
wait 1
playfram 0x88 # frame set 8
move 8
wait 1
playfram 0x99 # frame set 9
move 8
wait 1
playfram 0xaa # frame set 10
move 8
wait 1
playfram 0xbb # frame set 11
move 8
wait 1
playfram 0xcc # frame set 12
move 8
wait 1
playfram 0x44 # frame set 4
goto MarineWalking
Save, compile and your marine should walk twice as fast.
---------------------------------------------------------------------------------------------------------------
Q: "How do I give a unit that doesn't have an attack without crashing Starcraft?"
A: You would have to give it attack and returning to idle after attack animations. In this example, we're going to give the Dropship an air and ground attack. First off, at the top of the script, you should see a list that comprises of the Dropship's animations such as DropshipDeath. In the GndAttkInit/AirAttkInit/Gnd/AirAttkRpt replace the none with something like DropshipGndAttkInit and in the Gnd/AirAttkToIdle replace the none with something like DropshipGndAttkToIdle. Now the script will have something to work with when it attacks a unit, but we're not done yet. Now, create new headers that correspond with the headers listed in the list of animations.
First off, we want the Dropship to have an attack animation, so we create a new header that matches the header name in the animation list. We're going to keep it simple for now and use only one attack animation for the air and ground. We'll just use a couple of waits and an attack26, followed by a gotorepeatattk. Now here, we're using attack26 instead of attack25 1. Why you might ask? attack26 commands the unit to use the appropriate weapon when faced with each enemy (Ground attack for ground units etc.) This also shortens a script and doesn't allow seperate animations for the air and ground attacks, but since we're keeping it simple, that shouldn't matter. Since the GndAttkInit is placed in the RptAttk corresponding list and the attack animation ends with gotorepeatattk, the dropship's new animation will continuously loop back to the start until the enemy is gone.
Now for the Returning to idle animations. If you're not up to creating your own idle animations just yet, just replace whatever you put in the Dropship's AttkToIdle slots to DropshipOther. As you can see in the DropshipOther animation, it's just a bunch of shvertpos and wait codes. Shvertpos stands for Shift vertical position, so the Dropship, in this animation just hovers up and down like it does when idle.
When you're done all that, your script should look something like this,
# ----------------------------------------------------------------------------- #
# This is a decompile of the iscript.bin file 'data\scripts\iscript.bin'
# created on: Mon Jul 17 08:39:25 2006
# ----------------------------------------------------------------------------- #
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 223 Dropship (terran\dropship.grp)
.headerstart
IsId 68
Type 12
Init DropshipInit
Death DropshipDeath
GndAttkInit DropshipGndAttackInit
AirAttkInit DropshipGndAttackInit
SpAbility1 [NONE]
GndAttkRpt DropshipGndAttackInit
AirAttkRpt DropshipGndAttackInit
SpAbility2 [NONE]
GndAttkToIdle DropshipOther
AirAttkToIdle DropshipOther
SpAbility3 [NONE]
Walking DropshipWalking
Other DropshipOther
BurrowInit [NONE]
.headerend
# ----------------------------------------------------------------------------- #
DropshipInit:
imgul09 224 0 42 # DropshipShad (terran\dropship.grp)
playfram 0x00 # frame set 0
goto DropshipOther
DropshipOther:
shvertpos 1
waitrand 8 10
shvertpos 2
waitrand 8 10
shvertpos 1
waitrand 8 10
shvertpos 0
waitrand 8 10
goto DropshipOther
DropshipGndAttkInit:
wait 1
attack26
wait 1
gotorepeatattk
DropshipDeath:
playsnd 210 # Terran\DROPSHIP\TDrDth00.wav
imgol08 332 0 0 # TerranBuildingExplosionsmall (thingy\tBangS.grp)
wait 3
end
DropshipWalking:
imgol08 225 0 0 # DropshipGlow (thingy\tdrGlow.grp)
shvertpos 0
goto local00
local00:
wait 125
goto local00
---------------------------------------------------------------------------------------------------------------
Q: "How do I make a weapon do a different explosion?"
A: This is quite easy to do and very effective at making your unit attacks flashy. In this example, we'll make the Gemini Missiles explode like a nuke upon contact. First, let's decompile the Nuke's script and copy these 2 codes that are located in the Nuke's burrowinit,
imgol08 428 0 0 # Smallexplosion (thingy\small.grp)
sprol0f 267 0 214 # NuclearExplosion (thingy\NukeHit.grp)
These two codes are image overlays which make images appear, and in this case, makes the big nuclear explosion.
Now we decompile the Gemini Missile's script which is in the flingy section of IceCC. Since we want to make the nuke appear when the Missiles explode, we paste the two codes in the GeminiMissiles death, so it'll look something like this,
GeminiMisslesDeath:
playsnd 9 # Misc\ExploSm.wav
imgol08 428 0 0 # Smallexplosion (thingy\small.grp)
sprol0f 267 0 214 # NuclearExplosion (thingy\NukeHit.grp)
domissiledmg
wait 1
end
Save and compile, and voila, nukes for missiles.
---------------------------------------------------------------------
Basic overview of weapon image overlays
Weapon image overlays are commonly used by units when they're attacking, such as the Firebat, the Battlecruiser and Guardian.
An Image overlay is usually placed near the start of the unit's attacking animation , for example the Battlecruiser. When the Battlecruiser attacks, you see a small dome of orange erupt from the Battlecruiser's front. The image overlay in the BC's attack animation causes this, the image overlay which is this:
imgol08 446 0 0 # BCLaserFireOverlay (thingy\elbBat.grp)
If you were to ever remove that, you wouldn't be able to see the eruption before the BC fires it's weapon.
If you wanted, you could copy an image overlay from another unit and placing it in another unit's attack animation, giving it a distinct, unique attacking style. Example, Guardian using the Firebat's flame overlay to make it seem like it's breathing fire.
Image overlays are also used in death animations, like when you destroy a building, it shows the image of an explosion. Explosion overlays are usually in a unit/sprite's death animation. However, some units do not use image overlays in their death animations, and the image seen when they die, are simply frames part of their graphic file that play when the time is right.
--------------------------------------------------------------------------------------------------------------------------------
If you have any more questions you'd like to ask, PM any of the Modding Gurus. If you'd like to add something or comment, feel free to add. I hope this FAQ cleared up a few questions that many of you modders are frequently asking.
If you've learnt something from these posts that the Gurus took from their spare time to right time, please at least commend them by adding to their rep. This shows appreciation for people who take the time to teach you what you didn't know. This applies to every thread in the SC Tutorial Section, not just this one.
EVRY1 LIEKZ 2 B APRECIATED FOR THEIR EFFORTZ, M I RITE?