Chapter 3 – Learning modding fast, Memory editing.
The tools:
Firegraft v0.93, DatEdit 1.5, TBLPad, WinMPQ
The goal:
Making a couple of unbuildable units buildable. Eeeeasy!
The process:
1. So this is one of the most used and most basic things you’ll want to edit. But first things first, open up the latest firegraft version and under files click new. You’ll see that the list with all the units enables as well as all of the program tabs. There are 2 ways of working on a memory patch 1. You make a new one. 2. You load an existing one by selecting under “Open” a *.mpq with a *.fgp inside it (Firegraft Patch). Right now, click the button sets tab.
2. You can see the list of all the existing button sets and since firegraft is so awesome you get a button preview too. Since we are learning modding you’ll create a new button set instead of modifying an existing one (Pretty ironic, eh?). Right click and select “Add entry” Firegraft now asks you for a name type in: Civilian Set and select count and type in 0 then Accept. Now we have an empty buttonset for us to add things. If you noticed the name, this set it’s going to be used by civilian so we will need it to have the basic commands, Move, Stop, Patrol and Hold Position.
Note: in some cases “Attack” is included in the basic commands but since civilian doesn’t normally attack we won’t do attack.
3. So find a box that says “Add” and click it so the dropdown box comes down and select blank button and in the position type in “1”. Select that button and change the icon from “4 (Goliath turret)” to “228 (move)”. Leave the requirement string empty as it’s a move command and it should really require anything. In the action string find “664 (m<0><3>M<1>ove<0>).
The requirement string is the text that will be shown if the action cannot be fulfilled (not meeting requirements) and the action string is the string that when you put the mouse on the button is what will be shown when you can perform the action in this case the box will say “Move” but if we were building a ghost, for example, and we don’t have an academy it will say “Build ghost: Requires Academy”
4. In the command function find the requirement and set it as “Always” as we explained there should not be any requirements to move but you can always check the list to see what other requirements we have but you won’t have an explanation to them in this chapter.
In the action box find “Move” and set it as such so the action performed when you press the button move and when the “Always” requirement is met is going to be move. At this point you might want to select another button set like Ghost’s and compare your move button with the ghost’s premade one. One of the things we all do is watch how it is done in the existing units for example you can pretty much watch how the “Stop” command is done by looking at other unit’s button set which is EXACTLY what you will do right now.
5. Select the stop button from the ghost button set and learn all the stats it has or write them down. Now go back to your button set for civilian and create a new button, remember how? Find the add dropdown box and create a new blank button, change the Icon the requirement string if needed, action string and the other command’s functions.
Stop should be: Position 2, Icon 229 (Stop), no req string, 665 (s<0><3>S<1>top<0>) as action string, Requirement function “Always” and action “Stop”.
6. Repeat the process you did to do Stop to Patrol but this time I won’t be giving you the stats like I did for Stop.
7. If you’re done with Patrol we will now learn another firegraft feature. Erase everything you have (Move, Stop, Patrol) and in the add dropdown box instead of selecting blank now select “Basic commands”
You see, firegraft, has added you everything you just did in 15 minutes in 2 seconds or less PLUS an attack button and a hold position button that you’re missing. We won’t be using attack so delete it.
That’s basically how you add buttons, some of them, firegraft is gentle enough to provide them so you just do them in clicks but the rest you’ll have to look at other units and copy how it’s done.
Now we’re going to make those units buildable. We’re going to make that civilian we just did and a bear buildable, yes a bear.
8. Go to the units tab and find civilian in the list and change the button set used to the new button set we did. It should be in the very bottom of the list.
What’s so awesome about civilian anyway? It doesn’t attack or anything? That’s why, since you already know how to Datedit, you’re going to make it Detector, give it more HP and shields and getting all that into an mpq.
Open up datedit and find the civilian. Set the HP to 100 and shields to 50 and enable them of course. Now switch tabs (while on the units tab) and go to advanced. And there’s a couple of flags you can edit right now just check the “Detector” flag. You can play around with the rest of the flags after. So save your units.dat and create a new .mpq called fire.mpq and get the units.dat in it under arr\ of course.
9. You can close datedit and winmpq and go back to firegraft. So you know how supply depot is so boring, in the button sets tab find supply depot. I’ll give you 5 minutes to try and find it.
You didn’t find it right? That’s because it’s so boring that it doesn’t even deserve a button set so we’ll create a new button set called SD (or whatever name you want to give it)
Of course it will be a clear button set like always and add a new blank button.
10. The first icon will be civilian so that means that in position 1 we will have civilian’s icon leave the requirement string empty and in the action string find “Turn off shared vision for player 8<0>” a few lines above the last entry from the list. We will be changing this string after via tblpad.
In the requirement function we will set it as “Can create unit/building” and change the variable for it to the unit we want to build, in this case civilian. Next change the action function to Create unit and change the variable to civilian too.
11. We will edit the requirements for the civilian to be built. As you know civilian is nor normally built, moreover not even any unit is built from a supply depot so change tabs and go to “Dats requirements” find the civilian in the list and you’ll see that it is unused, check the little box so it is used and right click to create new arguments. Add two new arguments.
Now select the first one and set it as an op code and in the dropdown box select “Current unit is” and set the next argument to a parameter and find supply depot from the list.
This is telling starcraft’s memory that civilian can be built from a “Current unit” which “is” “Supply depot” in other words it is a dat unit requirement for civilians to be built from supply depots.
12. You’re pretty much done except for the fact that we haven’t added the bear. So go back to our SD button set. And in the add box select “Train unit” instead of a blank button. Firegraft should now ask you for a unit, find the bear (ursadon) and click it. You see now that firegraft has added you almost everything except for a right action string and a requirement string you’re going to change the action string to “Turn off shared vision for player 7<0” and the requirement string to “Turn off shared vision for player 6<0>”. Switch tabs to the dat requirements tab and find the ursadon and add three arguments one of them will be an op code “current unit is” and the next two will be parameters the first one will be supply depot and the next one will be barracks. You’re telling Starcraft that besides supply depot ursadon will also require you to have barracks
Switch to the units tab and change the supply depot’s button set to the SD button set we did and you’re pretty much done with the memory part. We just have a few more things to finish.
13. Open datedit again and you’re going to use the open feature to open the last units.dat you did.
Find the civilian again and edit the build costs and build time as desired (always keeping in mind the balance, remember balance is an important part of a fun mod). Next find the ursadon. Do any changes you wish for HP, costs and build time. And now find the supply depot, switch to advanced tab and check the “Produces units (?)” so it will be able to produce units.
14. Open up TBLPad. Get a copy of stat_txt.tbl from the patch_rt.mpq (it’s under rez\). Find the “Turn off shared vision” series (the ones we selected). If you remember correctly the player 8 was for civilian’s building action string and the other two were used by ursadon. Change the player 8 one to c<1>Train <3>C<1>ivilian<0> and the player 7 to u<1>Domesticate <3>U<1>rsadon<0> and change the player 6 to “Ursadon requires: (press enter for a new line) Barracks<0>” in the end it will look like “Ursadon requires: <10>Barracks<0>”
15. You just need to save your new units.dat file and your new stat_txt.tbl to your .mpq. when you’re done close both programs and go back to firegraft.
Click “File” and select save. It will now ask for a name of an executable give it whatever name you want. It will now ask you if you want to attach a file to it, click yes and select the mpq with the .tbl and the units.dat. It will then ask you for an icon but click no because we don’t want any icons right now
.
16. Find the executable and run it. SC will run and all changes will be applied. Try and build some bears and civilians also, watch the changes to the strings when you’re about to press the buttons. Have fun.