![[image loading]](http://img150.imageshack.us/img150/9554/screen34uz6.jpg)
Hi, I'm IskatuMesk. In my previous guide for the sc2 beta key contest I showed you how to utilize the basic utilities involved in Starcraft modding. Now I'm going to show you a few intermediate techniques using those existing programs. In this guide I will introduce you to the concept of randomized sequence attacks, like those I use in Armageddon Onslaught.
The first guide - http://www.teamliquid.net/forum/viewmessage.php?topic_id=94535
Sequenced Attacks
I coin the term "Sequenced" attacks on the concept of a unit doing multiple actions during a single action. In the image above, the Undead Blood Tornado is initiating a sequenced attack that causes it to fire a volley of projectiles at varying angles. Things like this are extremely difficult if not impossible to do in most game engines, but Starcraft's iscript.bin makes this incredibly simple.
![[image loading]](http://img56.imageshack.us/img56/8922/screen10cd7.jpg)
To mod starcraft competently, you must understand that it's not so much you modding the game as it is you working your way around the game's limitations and being clever.
In Armageddon Onslaught and in ITAS, I give many units massive sequenced attacks. The Adjucator in AO has a script setup that causes it to "call" and "return" several attack scripts over and over again. This causes it to attack over 50 times in a single motion. In Vanilla starcraft, the Zealot uses an attack sequence that causes it to hit twice during its attack animation. This is something incredibly difficult to do inside Warcraft 3 and even then not inside a mod environment.
Establishing the Starcraft concept & the iscript
![[image loading]](http://img244.imageshack.us/img244/58/screen24gt2.jpg)
![[image loading]](http://img295.imageshack.us/img295/4148/13fz8.png)
![[image loading]](http://img510.imageshack.us/img510/7522/kalothdarksteelaa9.gif)
Starcraft's strong point, and its weak point, is that it's a sprite-based game. The iscript controls virtually everything animation and event-related when concerning sprites.
The sprites themselves typically (the missile turret and such are an exception) only have the east-facing directions. My gifs above are of models I created in Maya and 3ds max. The purple is Player Color. Before they're introduced into Starcraft, they must be given the Starcraft unit palette, a very limited 256-color palette. I detail about this process in one of my video tutorials I posted in the previous thread.
The 17 frames for each direction of the animation only need to be referred to as "framesets" most of the time. Inside our Mutalisk script from the previous guide, we see this code.
MutaliskInit:
imgul 39 0 42 # MutaliskShad (zerg\mutalid.grp)
playfram 0x00 # frame set 0
waitrand 1 4
MutaliskGndAttkToIdle:
imgul 39 0 42 # MutaliskShad (zerg\mutalid.grp)
playfram 0x00 # frame set 0
waitrand 1 4
MutaliskGndAttkToIdle:
imgul stands for Image Underlay. SC is not a 3d game - everything is completely 2d, but the isometric angle used in Blizzard's 3d renders give the illusion that it's 3d. This command is creating an "overlay", aka another sprite, that will always display beneath the current unit's animation level. If we jumped into Datedit real quick and looked at this tab...
![[image loading]](http://img192.imageshack.us/img192/6807/guidez0.jpg)
We can see that the game has different levels, or layers. These can also change how collision works, as well. See the Datedit tooltip.
Since the Mutalisk's shadow is being displayed at a lower level than it is, it won't ever clip past the Mutalisk. Thus, the illusion of height.
The numbers, 39 0 42, are "Images.dat id", "horizontal offset", and "vertical offset". Also, lol 42.
If you peaked into images.dat real quick, you'd see that the 39 id is just a Mutalisk given a special transparent palette setting - that of the shadow. Unlike most other palette settings, the Shadow palette doesn't need you to handle the graphic in a special way - you can give it to anything. But it has no color depth to it, it will always be a single shade.
The playfram command is what is calling the framesets I was talking about. 0x00 is hex, basically meaning frameset 1. 0x11 will call frameset 2, and 0x99 will call frameset 9, while 0xbb will call frameset 11.
Then there is waitrand, telling the game to wait 1-4 ticks (1/10 a second in Normal gametime). This is so that when the mutalisk is trained and it had its idle animation, a big stack of them would have varying animations and not be completely unified which may look odd.
You can imagine the fun things you can do with just waitrand and frame calls. In Armageddon Onslaught, I used waitrand to randomize Zeus' Eye of the Storm. Instead of all of his psionic storms appearing unified, they animated totally randomly of each other, giving a much more impressive storm-like effect. This also had the effect of causing them to "accelerate" their animations randomly. It helps add to the impressiveness of an otherwise simple ability.
Attack sequencing
![[image loading]](http://img258.imageshack.us/img258/4728/screen14qp2.jpg)
In this segment we're going to build an example Mutalisk attack sequence.
If we look at our Mutalisk attack script...
MutaliskGndAttkInit:
playsnd 113 # Bullet\zmuFir00.wav
wait 1
attackwith 1
gotorepeatattk
goto MutaliskGndAttkToIdle
playsnd 113 # Bullet\zmuFir00.wav
wait 1
attackwith 1
gotorepeatattk
goto MutaliskGndAttkToIdle
Not very exciting, yes?
Let's add some more attacks to it.
MutaliskGndAttkInit:
playsnd 113 # Bullet\zmuFir00.wav
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
gotorepeatattk
goto MutaliskGndAttkToIdle
playsnd 113 # Bullet\zmuFir00.wav
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
gotorepeatattk
goto MutaliskGndAttkToIdle
Contratulations, you've just done what you can't do inside wc3 without serious, serious hackjobbing. You've caused the Mutalisk to fire multiple times in a single animation. Feel free to compile this and see what happens Ingame - your Mutalisk ship of ultimate doom should instantly gib most units it attacks.
But perhaps we want something different. Perhaps we want the Mutalisk battalcroozah to fire torpedoes instead of yamato blasts, and we want them to fire from the ships sides in a volley like the Blood Tornado.
I'm going to introduce you to a fun little concept.
Between waits you can do all sorts of fun stuff. Attack 4-5 times instantly, or even physically turn the unit around, and attack, and then turn back. Since it happens between waits, the unit physically turning doesn't actually appear. We can turn the unit to spawn the projectile at an angle.
MutaliskGndAttkInit:
playsnd 113 # Bullet\zmuFir00.wav
wait 1
turncwise 8
attackwith 1
turnccwise 16
attackwith 1
turncwise 8
gotorepeatattk
goto MutaliskGndAttkToIdle
playsnd 113 # Bullet\zmuFir00.wav
wait 1
turncwise 8
attackwith 1
turnccwise 16
attackwith 1
turncwise 8
gotorepeatattk
goto MutaliskGndAttkToIdle
Cool, huh? This is how my Adjucator works, just a bit more fancy than this.
Now, pop into datedit again. Use open -> Directory, and load your arr directory inside of your mod folder from the last guide.
![[image loading]](http://img194.imageshack.us/img194/7577/guidez1.jpg)
Sweet! Datedit will load every arr located in a directory for our convenience. Quite handy, especially if you're changing a lot of values randomly and closing datedit to change your mpq.
Speaking of which, what's the benefit of having Datedit load from your mpq, and how can we do that?
Go to file -> Options.
![[image loading]](http://img196.imageshack.us/img196/5033/guidez2.jpg)
If you click on the button next to the sector I have highlighted in orgasm-inducing hot pink, you'll be able to select your Mpq. Now, if you hope over to your Mutalisk and check his Graphic subtab in the unit editor, you should see the black Keeper graphic. Cool! This is handy if you are dealing with a LOT of custom graphics or you're jerry rigging unused stuff into new graphics, like I did with AO.
Let's jump into Weapons.dat and find the Mutalisk's Glave Wurm. Remember, we can jump there directly from the Mutalisk weapon entries in units.dat.
Let's change the missile graphic to EMP Missile. Let's also change the X offset to something like 30. Go ahead and change the range to 16, as well - may as well make these feel like big honken' space torpedoes, after all!
For yucks, set the splash to 10,20,30, and the "Effect" to "Splash Enemy". Now we should have something like this.
![[image loading]](http://img25.imageshack.us/img25/5894/guidez3.jpg)
The next time Bisu tries to pull some Corsair dancing on us, he'll be quite shocked at what we have waiting for him.
Go ahead and save that, close Datedit, toss it into your mpq along with your new iscript changes, and test it. Your Mutalisk should fire two torpedoes from the front sides at a target and do considerable damage to it and anything immediately close-by.
Maybe we want something bigger. Beefier. More daring. Perhaps manly.
Now that we have a grasp of how to make the Mutalisk fire projectiles from the sides, we can have some fun with that.
MutaliskGndAttkInit:
playsnd 113 # Bullet\zmuFir00.wav
wait 1
turncwise 8
attackwith 1
turnccwise 16
attackwith 1
turncwise 8
wait 1
turncwise 12
attackwith 1
turnccwise 24
attackwith 1
turncwise 12
wait 1
turncwise 16
attackwith 1
turnccwise 32
attackwith 1
turncwise 16
wait 1
gotorepeatattk
goto MutaliskGndAttkToIdle
playsnd 113 # Bullet\zmuFir00.wav
wait 1
turncwise 8
attackwith 1
turnccwise 16
attackwith 1
turncwise 8
wait 1
turncwise 12
attackwith 1
turnccwise 24
attackwith 1
turncwise 12
wait 1
turncwise 16
attackwith 1
turnccwise 32
attackwith 1
turncwise 16
wait 1
gotorepeatattk
goto MutaliskGndAttkToIdle
Excellent. Now our Mutalisk will fire an actual volley.
But wait. I said randomized attack sequences, right? This isn't very random.
A random sequence is when a unit has a random change to do something else. In AO's case, almost every unit has a chance to do something unique, and often projectiles themselves have a chance to do something as well.
There is command called randcondjmp that is going to be your best friend should you desire functionality like this. randcondjmp functions by having a number (the chance out of 255 that it will jump) and then the thread it jumps to.
Let's try this.
MutaliskGndAttkInit:
playsnd 113 # Bullet\zmuFir00.wav
randcondjmp 100 MutaliskPelvicThrust
wait 1
turncwise 8
attackwith 1
turnccwise 16
attackwith 1
turncwise 8
wait 1
turncwise 12
attackwith 1
turnccwise 24
attackwith 1
turncwise 12
wait 1
turncwise 16
attackwith 1
turnccwise 32
attackwith 1
turncwise 16
wait 1
gotorepeatattk
goto MutaliskGndAttkToIdle
MutaliskPelvicThrust:
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
gotorepeatattk
goto MutaliskGndAttkToIdle
playsnd 113 # Bullet\zmuFir00.wav
randcondjmp 100 MutaliskPelvicThrust
wait 1
turncwise 8
attackwith 1
turnccwise 16
attackwith 1
turncwise 8
wait 1
turncwise 12
attackwith 1
turnccwise 24
attackwith 1
turncwise 12
wait 1
turncwise 16
attackwith 1
turnccwise 32
attackwith 1
turncwise 16
wait 1
gotorepeatattk
goto MutaliskGndAttkToIdle
MutaliskPelvicThrust:
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
wait 1
attackwith 1
gotorepeatattk
goto MutaliskGndAttkToIdle
Feel free to compile with those changes. Your mutalisk should randomly fire a stream of rape at its target, and at other times fire its volley attack.
![[image loading]](http://img188.imageshack.us/img188/2816/screen85.jpg)
Extas
Q: Halp, icecc gives me an error when I try to save over my old iscript!
A: You need to save as a new iscript. I bounce between iscript in my scripts\ directory and one in the base directory. A bit of a pain in the ass...
Q: What should IceCC compiler look like if I'm adding to an existing iscript and not the default?
A:
![[image loading]](http://img44.imageshack.us/img44/552/guidez4.jpg)
I'll be creating video guides in the future that cover these subjects as well.