Mesk's Starcraft Editing Bible


tipereth
Zerg Hydralisk Nail Stylist
Zerg Hydralisk Nail Stylist
Posts: 598
Joined: Tue Sep 19, 2006 7:37 pm
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby tipereth » Tue Apr 21, 2009 1:44 pm

For the record and because you still haven't noted it: If a unit has a condjump in it's attack, and that unit kills something, it will assume that  the conditions of the condjump are satisfied and preform the second attack. This works for at least two condjump commands.

IE:

A hydralisk is given a script as follows:

Code: Select all

HydraliskGndAttkRpt:
   __1e_condjmp      50 3spray
   wait              1
   playfram          0x44   # frame set 4
   playsnd           64   # Bullet\SpoogHit.wav
   sprol15           332 0   # NeedleSpines (thingy\spooge.grp)
   attack26          
   wait              1
   playfram          0x33   # frame set 3
   wait              1
   nobrkcodeend      
   gotorepeatattk    
   ignorerest        


In this case, the condjump script has the hydralisk attack 3 times in succession. What this means is: if the hydralisk kills a unit, it will then attack three times in succession. I am reasonably sure that these attacks are directed towards the sprite of the dying or dead unit, unless there is another target in the immediate vicinity. I tested this by giving the 3spray script a second condjump with a value of 1, which would use an AoE attack. If there was only the single enemy, it would die and the graphic for the AoE would go off. If there were multiple enemy units, sometimes the graphic would appear on the dying unit, and sometimes it would appear on the next targeted unit. Either way, all units in the AoE took the damage from the AoE effect.

Long story short: You can make attacks that cause the target to explode on death. More generally, you can have units that do something special when they strike the killing blow on another unit. (Practically, by using two low chance condjumps, the unit will have about a one in sixty five thousand chance of generating the effect on a regular attack. I think.)

I am also aware that this probably wont always work. I've only tested it on the hydralisk.

User avatar

Topic author
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8646
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby IskatuMesk » Tue Apr 21, 2009 2:57 pm

I don't believe that to be the case... 50 chance is very high, btw.

If this were the case, Mal`Ash would cast Eclipse every time he killed a unit and everything would die over and over again. But he doesn't... so eh.

I don't know. Bug? I haven't encountered this before.

Also, you have no "nobrkcodestart" at the beginning of your animation.

/edit

Okay, I've seen it ingame, and it's exactly as he describes. It's basically Incinerate from wc3 except in SC - in this example, the hydra creates a Plague graphic on a unit it gets a killing blow on. I have no idea how the hell this is happening. Beginning research.
Last edited by IskatuMesk on Tue Apr 21, 2009 3:37 pm, edited 1 time in total.
Image~[Gameproc]8===><===8[Blog]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.


tipereth
Zerg Hydralisk Nail Stylist
Zerg Hydralisk Nail Stylist
Posts: 598
Joined: Tue Sep 19, 2006 7:37 pm
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby tipereth » Tue Apr 21, 2009 6:34 pm

Okay, I have confirmed that this effect works on dragoons as well. I also think I know what is happening, at least to some extent. I gave the dragoon's normal attack really high damage, and a very long cooldown. The condjump attack was an AoE damage effect. What happened was, the dragoon would attack it's target, and then instantly the condjump effect graphic would appear on another nearby target, and that target and all enemies around it took the AoE damage. I believe that when a unit kills another unit, it acquires a new target almost instantly, and then for some reason cycles through it's repeat attack script, and follows any condjumps in the order it hits them. I also found that if there is a single enemy target, the effect may appear at it's location upon it's death, for reasons unknown. This effect seems not to work when units are directly issued orders to attack other units. I was also able to make the dragoon jump a bit when it killed something, in addition to the condjump attack effect.

User avatar

Topic author
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8646
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby IskatuMesk » Sun Aug 09, 2009 5:44 pm

Here's the two tutorial bits I made for TL a while ago.


IskatuMesk's Formal Introduction to Modding

Image

Hi, I'm IskatuMesk! I'm a veteran modder of Starcraft for ten years. I specialize primarily in creation of Total Conversions. I've created a variety of guides and video tutorials in the past, but no true down-to-earth introduction & tutorial.

Today I'm going to give you a shakedown on Starcraft modding, some of the tools you'll be working with, concepts to become acquainted with, and some of the possibilities of Starcraft modding. In this guide I will presume that you don't even know what modding is, much less how to start. By the end of the guide I hope you will have a basic idea of where to go, what to do, and how to best evolve your skills should you be interested in starting a mod. This guide is to be used as a primer for getting started and it doesn't cover intermediate or advanced topics due to the scale of such topics.

First, let's get an idea of what exactly we're going to be doing.

Introduction to Modding

Image

Mods are very different from maps. While a map may contain mod-like elements, it is ultimately still just a map. Mods work by temporarily "patching" the game's memory, not permanently modifying the game itself, but allowing you to play with new elements, such as voice acting, graphics, and computer AI. If you have a friend who possesses the same mod as you, it's perfectly possible to play multiplayer. You generally use Battle.LAN or Hamachi to play multiplayer mods, as they often do not support the most recent version of Starcraft. Downgrading is very easy and quick to do on the fly, however, so don't be discouraged.

However, I have a few words of advice before you begin.

Unless you are truly motivated to start a mod, it's best not to devote time to it. We get so many one-hit wonders that claim they have the greatest idea for a mod, then we never hear from them again. Modding is not a hobby, it's a dedication. There's a few extensive articles out there that get deeper into the subject of team management and dedication.

Here's one written by a good friend of mine, Magic from the Star Alliance.
http://samods.org/articles/tips_for_new_modders

Here's one I wrote a little while ago, geared towards people looking to form large teams, although for Starcraft it's really unnecessary to have a big team.
http://www.campaigncreations.org/forum/index.php?topic=1495.0

This guide will assume that you are motivated, dedicated, and actually ready to invest time into this subject.

Getting started

Perhaps you want to simply rebalance Starcraft. Maybe mutalisks aren't strong enough, and they should fire yamato guns instead of glave wurms. Perhaps you want Carrier interceptors to fly further from the Carrier and attack at a range, like bombers.

How do you begin? Where do you start?

Before you get in over your head, there's a lot of things to consider.

Starcraft is an old game. Really, modding SC is a lot like playing it. It's easy to jump into, but very difficult to master and a lot of that difficulty comes from the limitations of the game. Starcraft's limitations can sometimes work to your advantage, though, as you can do a lot in Starcraft that you can't do in, for example, Warcraft 3. It's that allure that has kept me going for ten years. SC, for example, doesn't allow new races or a larger resolution/color depth, but you can give units 10 different attacks linked to their animations that all occur randomly. You can make projectiles do randomized damage and spawn appropriate effects. You can't have a unit fire more than 2 types of projectiles, but you can spawn weapons at a target's position. You can't have new types of interceptors or scarabs. So on so forth.

There's a few concepts to understand when working with starcraft.

Starcraft functions through archives, called Mpqs. You'll work with these using Winmpq (explained in the next segment). The MPQ contains all of your mod's data. For your data to function, it must assume the name of the file it's replacing. For example, .dat files which contain attributes such as unit health, weapon damage, ect. are under the arr\ directory within stardat and broodat mpq files. In your mpq file, they'll also be under the arr\ directory. Weapons.dat will always be named arr\weapons.dat, units.dat will always be named arr\units.dat.

Because you cannot add new entries to dat files and for the most part cannot tell the game to "read" new units, you are essentially working with what is available and not much else. For most people this should be enough.

Starcraft's graphics are 256-color sprites contained within .grp files. You'll be using Shadowflare's GRP converter to handle these, but you can use Broodkiller's GRPEdit or Retrogrp to preview them. These use a starcraft-specific palette.

The sounds/music are PCM-format .wavs and can accept up to 48,000khz sampling rate, mono and stereo.

Resources, tools, & places of interest

One of the biggest responsibilities as a modder is using the resources and tools available to you to their fullest. The first place to start would be to learn where tools are located, what forums have useful information stowed away, and where's a good place to ask questions.

http://www.campaigncreations.org - The website I'm hosted at. Oriented mostly around old custom campaigns, I'll be working with the administration to update the website's modding section. My bible is also located in the Starcraft section of the forums and covers some intermediate to advanced topics.
http://www.samods.org - SA's long past its glory days, but digging deep into the starcraft section may yield some interesting information.
http://www.staredit.net - The redheaded stepchild of the modding community, SEN is a relatively young website but remains the most active. A good place to look around for simple to intermediate topics, and probably the best place to ask your questions at.
http://www.broodwarai.com - Possesses an up to date list of modding tools and managed by two friends of mine, Bajadulce and poiuy_qwert. Here is where you'll get the latest tools, and it's also the place to go if you're looking to customize Starcraft's computer AI. Here you can also grab Baja's downgrader, which is not only useful for modding but also for watching old replays.

As with all forums, the Search function is your best friend when dealing with a game that is as old as SC.

"There's so many tools, what do I need!?"

Let's start with the basics. Head on over to broodwarai and grab the following tools. Use your browser's search function.

Datedit
Winmpq
Mpqdraft


Note - If Winmpq doesn't work for you, you'll need to download some runtime files. You can find them here, http://shadowflare.samods.org/dwnload.html#WinMPQ

Okay, let's get started!

Your first mod

In this mod we're going to cause the Mutalisk to shoot yamato gun blasts and do increased damage. Maybe we'll give it some shields and stuff, too.

First thing's first. Create a folder somewhere you have easy access to. I've created a folder called TL Mod Guide on my desktop. Run Winmpq, and click on "new". Navigate to that folder and create a new mpq. I've just called mine TL. So professional! You may note that the mpq isn't actually created yet. Once you start putting files into the mpq, it'll appear. If you close winmpq before you do that, you'll need to make another one.

Now, run Datedit.

Image

Oh sweet mary poppins and tap-dancing christ there's buttons everywhere!

Well, actually, it isn't so bad. I helped design datedit's layout with Broodkiller and we made it as efficient and user-friendly as possible. There's also helpful tooltips that will guide you around, and most of the functions are user-friendly.

Find the Mutalisk in the unit list. Don't touch any of the tabs, yet!

With the Mutalisk selected, let's take a look at his basic attributes.

Image

1.) The Mutalisk's health, shields, and armor. We can enable the Mutalisk to have shields. Click on the box to enable shields and give him 4269 shields.
2.) Build costs and construction time. Note that for units with a lot of health, an extremely short construction time may cause them to appear with reduced health and armor. This is because that just like with buildings, SC will create the unit from 1/* health and raise it until it's max. If it's too fast, like .25 a second, it may not fill the health fast enough. Let's make the Mutalisk take 2 seconds to build, and cost 42/42 minerals/gas.
3.) Weapons. Unlike Warcraft 3, unit weapons are not built into the unit, which is really handy and helps us out. "Max hits" is just for Staredit display and isn't really that useful. We're going to leave this part alone for now. You can use it to make the Mutalisk call upon, say, the Battlecruiser's weapon entries.
4.) Supply. Here you can make the Mutalisk cost 0 supply, or 42 supply. For the moment, let's make him cost 0 supply. There's also the race selector. You can make the Mutalisk cost Terran supply if you wanted to. This area is also important for computer AI. If you had set the Mutalisk to cost Terran supply, even though it costed 0 supply, the AI wouldn't build it.
5.) Space required for transports. As the Mutalisk is an air unit, it costs 255 supply - nothing can transport it. It's perfectly possible to have the Overlord capable of transporting it, though. This doesn't resize wireframes and in some rare cases might cause instability, so be warned.
6.) Scorepoints, for the end-game score board. There was some speculation that AI will target high-point units over low ones, but I've yet to see anything that indicates such behavior.
7.) Size. This determines how much damage weapons that are concussive and explosion will do to the unit. The Mutalisk, being small, takes max damage from Ghosts and reduced damage from Dragoons.
8.) Sight range & Acquisition range. Sight range caps at 11 unless you like crashing Starcraft, but Acquisition range can go on for quite a distance. If you went to the Carrier entry and set this to something like 69 or 42, it'd cause the Interceptors to engage targets at a far larger radius than they currently do.

Feel free to look at the other tabs for the Mutalisk, such as Advanced and Graphics. Clicking on boxes or stuff will display a tooltip explaining their function to you. For the moment, we're going to leave all of this stuff alone.

Go back to the Basic tab and click on one of the arrows next to the Mutalisk's weapons called Jump. This will cause Datedit to swing over to the Weapons.dat editor, selecting the appropriate weapon for you.

Image

I'll explain what you're seeing once more, though the tooltips will probably go more in-depth.

1.) Damage and cooldown. "Factor" determines the amount of projectiles that spawn, but caps out at 2 then resets to 1 when used higher. Set the damage to 42.
2.) Damage types. Setting effect to spell and giving it damage is typically a good way to crash the game as spells are serious voodoo and quite hardcoded. Many spells cannot be used outside of their existing entry, like Mind Control and cannot be used as weapons. So much for my randomly mind-controlling flying larva, huh?
3.) Ranges. See the Siege Tank and such units for an idea of how long the ranges are.
4.) Splash radius. Only works with certain damage types.
5.) Labels. Refers to stat_txt.tbl entries which we'll worry about later.
6.) Behavior and graphic. Let's set the graphic to Yamato Gun and set the behavior to Fly & Follow Target (homing). We could use the Bounce for the Yamato Gun, but it doesn't have animations for it and typically it's not a good idea.
7.) Targeting parameters. Note that if the Mutalisk's projectile is set to only hit air but it has the weapon in both slots in units.dat, it will still attack ground but just not do any damage. Some of these won't work very well, so it's up to you to experiment with them and see how they work. Some spells use the more exotic flags.


Okay, we're ready to try out our new, perfectly balanced Mutalisk! July will thank us for helping him demolish unsuspecting Protoss and Terrans.

If you hit control+S to save, Datedit will ask you if you want to overwrite the default files. The answer is no, obvious. So to go to Save As, and create a new folder called arr\ instead your mod's directory. Go back to the Units tab, and do the same, placing the new units.dat inside your arr directory.

Close Datedit. The reason we close datedit is that if it's loading from the mpq, which you usually do when you have custom graphics and you want to see them in the previews, it takes ownership of the mpq and any changes you make won't be applied to it. The same thing happens when you use Firegraft, or are currently running the mod mpq through Starcraft.

Browse to your new arr directory, and select your two dat files. Slide them into Winmpq. It'll ask you for a directory. Type in arr\ . They should now look like this.

Image

Alright! We're almost ready to give the six Dragons a hernia. We have one last step to do. Once you get used to this, you'll be able to do all of these steps in under a minute.

Find and run Mpqdraft. Go to Load MPQ. Select starcraft in both of the selecting thingies. Click Next. Locate your mpq and make sure the box is ticked. Click next once more. In this window, you can select plugins if you have any that are applicable. Since you don't for the time being, just click finish. It should run Starcraft and when you create a mutalisk in a melee, tvb, or whatever, it'll be horrendously overpowered. If you made any other changes, like Carrier interceptor range, feel free to try them out, too!

Contratulations! You've just made your first amazing mod. You now understand the basics of Starcraft modding and you're in a good position to extend your abilities with the resources provided.

Intermediate topics - the Iscript

Very few modders out there limit their mods to .dat changes and kitbashed graphics. The real fun is creating entirely new effects and utilizing the Iscript to your advantage.

In this section I'm going to briefly introduce you to the iscript. The iscript is a topic that far exceeds the scale of any single guide or article, so I'll make it brief. This assumes you are fairly confident in your abilities with data editing.

First off, what is the iscript? The iscript.bin located under scripts\ is the single most powerful file in all of Starcraft. It controls animations of units through an extremely simple scripting language. With the iscript comes all of the magic of Starcraft. You can do things like spawn effects, trigger attacks in sync with animations, sequence randomized animations, all sorts of stuff like that. It's a really advanced subject when you get into it, so I'll keep it short and sweet.

Perhaps you gave the Vulture an air attack, and it crashed!? Or, maybe you gave the Corsair a ground attack, and it crashed, too!

Why?

They don't have animation entries for those attacks. This is a pretty simple process, so I'll cover it. To do that, we're going to turn our Mutalisk into a sewpah battal croozah.

Go ahead and download icecc from Shadowflare.samods.org. You'll need the Java runtime environment for this. Grab it from here. http://java.com/getjava/

Also, download the Grp pack that I released, here:

http://www.doack.campaigncreations.org/waxdough.rar

A brief preview of what this pack contains -
Image

Of course if you release a mod with any of these, you'll need to credit me/WarGiant appropriately.

For the purpose of this mod, I'll use the Keeper.

Once everything's set up, let's run the IceCCUI.jar file.

Image

Oh goodness! A first glance, this may look as confusing as hell. But, in fact, it's really simple.

The lists of units and such are listed by .dat entries (unrelated to your mod's dat files). Images.dat will contain the most entries, including explosions and stuff. Sprites.dat will contain fewer, as explosions are usually spawned as Image Overlays and don't need sprites, but trails do. Flingy will contain even less - anything that moves, like a missile or a marine, will need a Flingy entry. And, finally, units contains everything listed in units.dat.

Make note that most Heroes, like the hero vulture, share the exact same iscript entry as the Normal vulture. You can confirm this by looking at them in units.dat and images.dat.

Navigate down the list until you find the ZergMutalisk. Select it. Then go down to the "Save to" section and click Browse. Save it as something in your mod directory. Make sure to add a .txt extension to it.
Image

Click "Decompile".

As long as you aren't decompiling from an iscript newer than the default (which can cause problems for icecc, though the game doesn't care), it should never give you an error when you decompile. So, for the moment, you're safe.

If you have any previous scripting or programming experience, iscripting will be painfully simple. If you don't, iscripting will be a little bit of a hurdle, but understanding starcraft's limitations will be more problematic. Really, there is no comprehensive source for anything in regards to Starcraft modding. A lot of it just comes from experience, and as there are so few modders who have ever toyed with the iscript, there isn't exactly a heap of people to attack with questions.

For the purpose of this guide, we'll just worry about our Super Mutalisk.

Open up that txt in your favorite text editor.

I'll now explain what you're looking at.

# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 038 Mutalisk (zerg\mutalid.grp)
.headerstart
IsId          23
Type          12
Init          MutaliskInit
Death          MutaliskDeath
GndAttkInit    MutaliskGndAttkInit
AirAttkInit    MutaliskGndAttkInit
Unused1        [NONE]
GndAttkRpt    MutaliskGndAttkInit
AirAttkRpt    MutaliskGndAttkInit
CastSpell      [NONE]
GndAttkToIdle  MutaliskGndAttkToIdle
AirAttkToIdle  MutaliskGndAttkToIdle
Unused2        [NONE]
Walking        MutaliskWalking
WalkingToIdle  MutaliskGndAttkToIdle
SpecialState1  [NONE]
.headerend


These are Headers. The IsID is referred inside images.dat. You could have your Mutalisk call a custom id of 420 if you wanted, and this is handy if you are working on a very large project like Armageddon Onslaught and you run out of default ids. The Type refers to how many entries there are. Refer to other units, especially ones with burrowing animations, to see how that works.

The actual headers are ridiculously simple. The first words, like Init and Death, are refering to a Thread, located further down the file. These threads are called when the unit initiates certain orders or actions. When the unit is first spawned, it'll trigger the Init thread. When it dies, it'll trigger the Death thread. These threads can and often will interrupt each other when the game demands it.

IceCC comes with several files that will help you understand the opcodes that we're about to deal with. It'd be rather redundant to go through them all, so I'll just summarize the ones we're going to deal with.

MutaliskInit:
imgul          39 0 42 # MutaliskShad (zerg\mutalid.grp)
playfram      0x00 # frame set 0
waitrand      1 4
MutaliskGndAttkToIdle:
playfram      0x00 # frame set 0
wait          2
playfram      0x11 # frame set 1
wait          2
playfram      0x22 # frame set 2
wait          2
playfram      0x33 # frame set 3
wait          2
playfram      0x44 # frame set 4
wait          2
goto          MutaliskGndAttkToIdle


Here we have the Init and To-idle animations.

playfram tells the game to play a Frameset. In the grp, every 17 frames is a frameset, starting from north to south facing right (east). Each frameset is a single frame of animation in the game when used this way. Starcraft mirrors the left direction on its own.

As the Mutalisk has an animation, it has 5 framesets. Each frameset is a single frame of the wing's movement, containing the appropriate direction data. Feel free to grab Shadowflare's grp editor from broodwarai.com and jack the mutalid grp from unit\zerg\mutalid.grp in stardat.mpq to have a look. (Note, winmpq may show a bunch of unknowns. I'll show you how to fix that in a bit)

Anyways, our keeper graphic doesn't have those extra framesets. If we just renamed it to unit\zerg\mutalid.grp in our mpq, it'd just crash because starcraft throws a temper tantrum when units don't have the frames it wants. So, to fix that, let's purge those extra framesets out of the Mutalisk txt file.

Remember when deleting the framesets to remove their accompanying waits as well.

MutaliskInit:
imgul          39 0 42 # MutaliskShad (zerg\mutalid.grp)
playfram      0x00 # frame set 0
waitrand      1 4
MutaliskGndAttkToIdle:
wait          2
goto          MutaliskGndAttkToIdle

MutaliskDeath:
playsnd        942 # Zerg\Mutalid\ZMuDth00.WAV
imgol          41 0 0 # MutaliskDeath (zerg\zmuDeath.grp)
wait          1
end           

MutaliskGndAttkInit:
playsnd        113 # Bullet\zmuFir00.wav
wait          1
attackwith    1
gotorepeatattk
goto          MutaliskGndAttkToIdle

MutaliskWalking:
wait          1
goto          MutaliskWalking


This is what we should end up with.

Note the imgols are Image Overlays, the game is effectively spawning these effects in the animation. If we wanted our giant black keeper to have pretty explosions, we'd probably want to spawn a ton of terran explosions with different offsets.

Imgol calls upon an images.dat id, and then has two offsets. We can create a chain of these with some waits. Look up the terran building explosions (probably just called "explosion", see if they use the ofire (orange) palette to be sure) and spawn them with -40 0, 40 0, 0 -40, and 0 40 offsets. Now when the unit dies, it'll create a massive explosion. Horray for explosions!

This is what my script looks like, now.

MutaliskInit:
imgul          39 0 42 # MutaliskShad (zerg\mutalid.grp)
playfram      0x00 # frame set 0
waitrand      1 4
MutaliskGndAttkToIdle:
wait          2
goto          MutaliskGndAttkToIdle

MutaliskDeath:
playsnd        942 # Zerg\Mutalid\ZMuDth00.WAV
imgol          334 0 0 # MutaliskDeath (zerg\zmuDeath.grp)
imgol          334 40 0 # MutaliskDeath (zerg\zmuDeath.grp)
imgol          334 0 40 # MutaliskDeath (zerg\zmuDeath.grp)
imgol          334 -40 0 # MutaliskDeath (zerg\zmuDeath.grp)
imgol          334 40 -40 # MutaliskDeath (zerg\zmuDeath.grp)
wait          3
imgol          334 0 0 # MutaliskDeath (zerg\zmuDeath.grp)
imgol          334 80 0 # MutaliskDeath (zerg\zmuDeath.grp)
imgol          334 0 80 # MutaliskDeath (zerg\zmuDeath.grp)
imgol          334 -80 0 # MutaliskDeath (zerg\zmuDeath.grp)
imgol          334 80 -80 # MutaliskDeath (zerg\zmuDeath.grp)
wait          3
end           

MutaliskGndAttkInit:
playsnd        113 # Bullet\zmuFir00.wav
wait          1
attackwith    1
gotorepeatattk
goto          MutaliskGndAttkToIdle

MutaliskWalking:
wait          1
goto          MutaliskWalking


Okay, so we're ready to test. Control+S to save the txt file, and jump back into icecc. Go to the Compiler tab, and find our iscript. For the moment, we want to leave "Merge with default" check on. This will cause our new iscript to be a combined of our mutaloli script and the default, which is what we want. Create a scripts directory in your base folder and save the new file as "iscript.bin"

We don't need to turn off icecc to import our files. Sometimes it'll just turn itself off, though. Possibly because it hates life, or because it was programmed in java and java doesn't like life, either.

Anyways, import our file into our mpq, called scripts\iscript.bin. We also probably want that Keeper grp from the pack. Import it as unit\zerg\mutalid.grp. You'll probably need to rename it once it's imported.

Now our mpq should look like this.

Image

Now, feel free to run the mpq like you did before. The Mutalisk should be a huge black keeper from HW2 and fire a yamato gun.

Image

There you have it! A basic introduction to modding and even iscripting. If there's enough demand, I'll write out some more intermediate/advanced topics.


Extras

Q - Why does stardat ect show up as a ton of unknowns? How do I fix it?

A - You need a listfile. They're actually a bit hard to get now. The Maplantis backup on SEN has them.
http://www.maplantis.org/storage/files/listfiles.zip
To load them in winmpq, go to options, File lists, and Add List.

Q - How do I make selection circles larger/smaller?

A - Sprites.dat.

Q - Strings/names?

A - tblpad. Jack the stat_txt.tbl from patch_rt.mpq (Make sure it's the one with a local id of 0), edit appropriately, and stick into rez\ in your mpq.

Q - I want to learn how to do voice acting/convert graphics!

A - I made some video tutorials that cover these a little bit.

These videos are produced in 1920x1200 resolution.

http://www.doack.campaigncreations.org/Mesk_Soundediting_Ep00.avi
http://www.doack.campaigncreations.org/Mesk_Soundediting_Ep01.avi

http://www.doack.campaigncreations.org/Mesk_PSP_effectconversion.avi

Q - I have some questions...

A - Feel free to ask some! But please, please for the love of god check out those links in the beginning first and use their appropriate search functions. I won't answer anything I know has already been answered.
Image~[Gameproc]8===><===8[Blog]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.

User avatar

Topic author
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8646
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby IskatuMesk » Sun Aug 09, 2009 5:44 pm

Image

Hi, I'm IskatuMesk. In my previous guide 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.


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

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
Image
Image

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 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

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

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


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


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


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

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

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

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


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


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

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

I'll be creating video guides in the future that cover these subjects as well.
Image~[Gameproc]8===><===8[Blog]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.

User avatar

Topic author
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8646
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby IskatuMesk » Mon Apr 12, 2010 6:33 pm

is it scripts\iscript.bin? Are you compiling your changes correctly? Are you running the mpq as a secmpq..?
Image~[Gameproc]8===><===8[Blog]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.


bo12333
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 14
Joined: Sun Jun 21, 2009 8:57 am
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby bo12333 » Mon Apr 12, 2010 6:37 pm

omfg, the most MESSED up crap, ever!!, the S on my 'scripts' was caps OMFG!!

But, Can you put up an example where you display Kerrigan as a Keeper Unit from the WAXDOUGH collection?

showing what changes should be done to the Iscript and why please...

I will remove this posting as soon as i understand my problem.

Thank you!   

User avatar

Topic author
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8646
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby IskatuMesk » Mon Apr 12, 2010 6:52 pm

capitalization doesn't matter

just copy bc script and modify to your liking
Image~[Gameproc]8===><===8[Blog]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.


bo12333
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 14
Joined: Sun Jun 21, 2009 8:57 am
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby bo12333 » Thu Apr 15, 2010 5:28 pm

your muta-bc script or the actual BC script?

User avatar

Topic author
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8646
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby IskatuMesk » Thu Apr 15, 2010 6:53 pm

whichever
Image~[Gameproc]8===><===8[Blog]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.


bo12333
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 14
Joined: Sun Jun 21, 2009 8:57 am
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby bo12333 » Sat Apr 17, 2010 7:35 pm

ok so, the copying from the muta-BC thing is working, but the kerri can't move!!!  Then when i make some changes it crashes everytime saying "Access Violation"

What is the problem?

User avatar

Topic author
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8646
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby IskatuMesk » Sat Apr 17, 2010 8:20 pm

Did you change flingy.dat?
Image~[Gameproc]8===><===8[Blog]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.


bo12333
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 14
Joined: Sun Jun 21, 2009 8:57 am
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby bo12333 » Sun Apr 18, 2010 8:12 am

Oh, I get it... the flingy controls how a unit moves.... Kerri move moving after all... just very, very, very, very slowly ... because i didn't touch it....

Also, is there a way to make just Jim Raynor into different graphic; and not all other marines with it?

I tried to do the same thing as i did with Kerrigan and it did not work.
Last edited by bo12333 on Sun Apr 18, 2010 1:41 pm, edited 1 time in total.

User avatar

Topic author
IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8646
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby IskatuMesk » Sun Apr 18, 2010 2:08 pm

Raynor is using the marine's graphic. So you'll need to find something unique that you're not going to use, like a Beacon, and change it accordingly.

In Flingy.dat, make sure Kerrigan is set to Flingy.dat control. As for the numbers, check air units similar to the speeds you want and change accordingly.
Image~[Gameproc]8===><===8[Blog]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.


bo12333
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 14
Joined: Sun Jun 21, 2009 8:57 am
Status: Offline

Re: Mesk's Starcraft Editing Bible

Postby bo12333 » Mon Apr 19, 2010 5:44 pm

I made a lot of neccessary changes to the TerranBeacon iscript and the Jim raynor Iscript....

but when i start it up, the unit can move around, but cannot attack or turn. What else do i need to do? (i did the flingy.dat change already)

Also, is there a way to change buildings that spawn unit without Firegraft?


Return to “StarCraft Discussion”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests