This page is based on a Modcrafters wiki article of same name(Experiments in Modding)(some experiments are copied from the Experiments in Modding thread)
Buildings on CreepEdit
Test: I wanted to find out what limited placement on creep, as there was no apparent flag in units.dat. I compared the Hatchery, since it did not require creep yet could still be built upon it, and found no difference between it and other buildings. I deduced that the cause must be in the race flag, so I set the Terran Barracks to Zerg.
Outcome: Mixed. A building that does not require Creep cannot be built on creep unless set as Zerg. However, Zerg buildings will not construct units internally. The queue will appear along with the unit icon(s), but its construction bar will not progress and above the bar it will read: "Morphing".
Hypothesis: Unit building and morphing use the same offset.
Test: I was curious whether turret subunits could give or take supply, and whether that supply could be of different races. I gave the Terran Goliath's turret a cost of 1 Terran supply. I gave the Terran Tank turret +1 protoss supply. I also made the Siege Mode turret take 1 protoss supply. I did that to test what happens during the tank transition.
Outcome: Failure. Turret supply does not affect TBL readout. Goliath test failed. Tank/Siege test failed. No effect.
Hypothesis: Game does not recognize supply from turrets.
Resource Depot vs Requires Creep flagsEdit
Test: My initial test was to see whether it was possible to combine Resource Depot and Resource Container flags in Units.dat and prevent a building from being placed nearby the same building using the "red zone" effect. My first test was on the Creep Colony. The result of this caused me to test the same effect on the Protoss Photon Cannon, Pylon, Zerg Hatchery, and Spawning Pool.
Outcome: Mixed. The Creep Colony test failed. Drones could bring resources to them, showing that Resource Depot was functioning, but there was no "red zone". I could place the Creep Colonies as close to minerals and other Creep Colonies as I wanted. The Photon Cannon test succeeded. Photon Cannons could not be placed nearby one another, even while warping. The Pylon test also succeeded. The Hatchery test succeeded, but the Spawning Pool test failed.
Hypothesis: The Creep Colony test caused me to believe that either creep generation or creep dependency caused a conflict with the Resource Depot flag. The Hatchery showed that it was not creep generation, while the Spawning Pool showed that it was in fact the Requires Creep flag. The Pylon test showed that PSI ring generation was not affected, and the Photon Cannon showed that the Requires PSI flag is also not affected. It seems weird that Requires Creep does not work, while Requires PSI does. My guess is that Requires Creep uses the same offset as Resource Depot, but Requires Creep takes precedence.
Zerg Building MorphEdit
Test: In STF, I wanted to give the Sentrygun the ability to upgrade through three levels. The logical choice was to use Zerg Building Morph, such as that used by the Hatchery and Creep Colony. My first test involved the Terran Missile Turret morphing into the Protoss Photon Cannon, modified to be Terran and not require PSI. My next test involved the Missile Turret morphing into the Zerg Spore Colony, modified to be Terran and not to produce creep. My third test involved the Missile Turret still morphing into the Spore Colony, but rechecking the Zerg race flag.
Outcome: Mixed. The first test failed. I suspected it had to do with missing iscript animations, so my second test was to determine that possibility. However, the second test failed as well. On the third test, it succeeded. The morphing animation used the initial Terran construction graphic.
Hypothesis: The building that is to be the result of a Building Morph appears to require the Zerg race flag. The race of the parent unit does not seem to matter, as evident by the Missile Turret, but it does draw the morphing animation from the parent.
Example: Starcraft Team Fortress v2.4.4 (Requires Starcraft: Brood War v1.14). Begin a game as Human, select an Engineer, and build a Sentrygun Lvl1. Select the Sentrygun and press the Upgrade to Sentrygun Lvl2 button.
Secondary Resource DepotsEdit
Test: In my mod STF, I set the Resource Depot flag in Units.dat on the Floating Fortress building (Science Facility). In later versions, this was changed to a Floating Fortress add-on called the Processing Plant (Physics Lab).
Outcome: Success. Workers would mine and automatically bring their load to the Processing Plant. The oddity came when all (Command Centers, nexus, or hatchery's) were destroyed. Even if you had a Processing Plant, the workers ceased mining as if there were no Resource Depots. You could manually instruct them to return their cargo, but they would not auto-mine until another Hub was created.
Hypothesis: The micro AI must not recognize anything beyond the original Resource Depots as valid when it initializes its return trip and searches for the closest Resource Depot. I would imagine the code is broken into two parts, one that checks whether the player has certain building IDs, and a second that searches for the closest building marked with the Resource Depot flag. If the player does have those building IDs, the second step is initiated, but if not it ends up ignoring those buildings marked as Resource Depots.
Example: Starcraft Team Fortress v2.4.4 (Requires Starcraft: Brood War v1.14). Start up a game as Human and build a Floating Fortress using an Engineer. Construct the Processing Plant add-on near a mineral field. Engineers will automatically bring resources to it. Now destroy your Hub. The Engineers will cease auto-mining and must be manually instructed to return to the Processing Plant every trip.
Shield Battery TrainingEdit
Test: In STF, a race known as the Observers could capture a severly damaged Hub and build through the Human tech tree as a result. An additional bonus of the captured Hub was a new add-on called the Leyline. I had wanted an add-on that could both produce units and cast a spell, so I made the base unit of the Leyline the Protoss Shield Battery, and enabled it to construct Enslavers (Protoss Dragoon).
Outcome: Mixed. The Enslavers constructed fine, and Recharge Shields still worked as well. The problem arose when you tried to do both at the same time. If you recharged a unit's shields while an Enslaver was building, the construction bar halted indefinately until you cancelled the unit and began again.
Hypothesis: Unit construction and recharging shields are both prolonged processes, and the two seem to conflict.
Kookster - you can easily fix that problem by not allowing the spell to be used while the unit is constructing.
Example: Starcraft Team Fortress v2.4.4 (Requires Starcraft: Brood War v1.14). Begin a game as Observer with at least two Human AI opposed to one another. Build a Gray from the Mothership. You can either wait for one of the AI to kill the other and begin damaging their Hub, or use cheat codes to get the resources to morph the Gray into an Uber-Gray. If you wait, use the Gray to commandeer the Hub and build a Leyline. If you use cheats, use the Uber-Gray's mind control on one of the AI's Engineers and use the Mothership's Slipstream ability (Recall) to grab the Engineer quickly. (It is worthwhile to note that the use of Slipstream does not halt the construction of a Gray) Order the Engineer to construct a Hub. Once complete, damage the Hub until a Gray can commandeer it. Once you have a Commandeered Hub using either approach, build a Leyline on it. Now begin building an Enslaver and while that's working have a damaged unit attempt to recharge its shields. Then look at the Enslaver's construction bar.
By Hercanic and Lord_Agamemnon(MM)
Test: Hercanic - Discovered by accident in STF, it was found that while the Sentrygun Lvl1 (Terran Missile Turret) upgraded (Zerg Building Morph) to a Sentrygun Lvl2 (Zerg Spore Colony), you could assign an Engineer (Terran SCV) to it. Lord_Agamemnon(MM) - Can Protoss building warps be sped up by assigning SCVs to work on them? Actually, this was an accident, but hey, it's pretty neat.
Outcome: Success. Hercanic - Ordering an Engineer to work on an upgrading Sentrygun Lvl1 caused its upgrade speed to double. However, if the Engineer was left to work on it until completed, the Sentrygun upgraded back into a Lvl1 and you essentially lost the resources it had cost to upgrade. If you tell the Engineer to halt, the upgrading will continue on its own and it will successfully become a Sentrygun Lvl2. Lord_Agamemnon(MM) - If a building has "Terran" selected as its race and the order to build it is "Build building (Protoss)", the building will warp in normally. However, if an SCV is assigned to work on it, the building will warp faster. If it finishes while the SCV is working on it, it will skip the warp-in animation. This only works if the building race is Terran.
Hypothesis: Hercanic - The "Terran" race flag allows an Engineer to work on a building's construction animation, while the Zerg Building Morph automates its construction. The two effects are cumulative. Lord_Agamemnon(MM) - Terran buildings ca be constructed by SCVs, and the "build Protoss" order makes a building build itself. The effects do stack.
Example: Hercanic - Starcraft Team Fortress v2.4.4 (Requires Starcraft: Brood War v1.14). Start a game as Human and order an Engineer to construct a Sentrygun. Once complete, upgrade the Sentrygun and watch the progress bar's speed. Now select an Engineer and right-click on the upgrading Sentrygun. Observe the speed increase with the upgrade. This does not work on the upgrade of a Sentrygun Lvl2 to a Lvl3, as both buildings are marked as Zerg. Lord_Agamemnon(MM) - Ex Machina. Build any building as Beta Vector, watch it start building, and then assign an SCV to it.
Test: My initial goal was to test the purpose of the Cloakable flag. I suspected there was some correlation between the flag and the button group "Group (Cloakers)" in MemGraft. I edited the Group (Cloakers) button group to have Yamato Gun instead of Cloak. I then gave the High Templar and Dark Templar the Cloakable flag.
Outcome: Success. When a Dark Templar and High Templar was selected, the Yamato Gun button appeared, allowing them to cast Yamato Gun as a group. With selective animations, it is possible to have different effects. In one experiment I created a group-based Psionic Storm with High Templars and Dark Templars. The Templars cast Psionic Storm with an additional +50 initial damage for every Dark Templar.
Test: Can Zerg buildings create units normally? Lots of people have certainly done this, but I'll publish the results. I gave a Spawning Pool the button "Build unit" with req. and act. vars as Zerg Zergling
Outcome: Mixed Success. The unit icon appears in the queue if the requirements are correct. It will not build, however, but if the building is made a different race, it will. An interesting add-on to that is the following: The Spawning Pool can be made a Protoss building and will train units normally. However, they will not cancel. The icon disappears from the queue, but the unit completes its build normally.
Hypothesis: I don't know. Something to do with memory offsets for the Zerg part. I have no clue about the cancellation, though.
Kookster -Zerg buildings could build units in earlier patches but was patched out in 1.14.
Test: Can resources be built like normal buildlings? To test, I gave a unit a button for creating a mineral field (and a geyser,) edited the iscripts for the field and geyser, and gave them appropriate requirements.
Outcome: Mixed success. The unit builds, since it is, after all, a unit, but it is completely worthless; the resources contained is always 0.
Hypothesis: Hm. I suspect it has something to do with memory values needing to be set at the beginning of the map. There's nothing in the game that tells it to give a field x minerals automatically.
Units creating unitsEdit
Test: Can a unit create other units? To test, I gave the Carrier unit a button to build the Scout, added the appropriate iscript animation, and changed the reqs fof the Scout.
Outcome: Mixed success. Well, the Scout does build perfectly. There's a bit of jerkiness in the progress bar, but that's acceptable. The problem lies in the fact that the unit will always be built at the point where the parent unit was when it started the build. If the Carrier moves, the Scout that appears won't be at the Carrier's new position; it'll be at the original.
Hypothesis: Lord_Agamemnon(MM) - Quite frankly, I have no clue.
Kookster- Works for reavers too, there may be a hardcoded feature that allows these 2 units to create units. Vulture is unknown but may be possible since it has a count in it.
Lord_Jeremy - As I remember, the Vulture does not actually hold units, and their hanger system works very differently from the Reaver and Carrier. I doubt the Vulture would be able to produce units without some more drastic changes.
Test: Can building warps be sped up by assigning SCVs to work on them? Actually, this was an accident, but hey, it's pretty neat.
Outcome: Success. If a building has "Terran" selected as its race and the order to build it is "Build building (Protoss,)" the building will warp in normally. However, if an SCV is assigned to work on it, the building will warp faster. If it finishes while the SCV is working on it, it will skip the warp-in animation. This only works if the building race is Terran.
Hypothesis: Terran buildings can be constructed by SCVs, and the "build Protoss" order makes a building build itself. The effects do stack.
Example: Ex Machina. Build any building as Beta Vector, watch it start building, and then assign an SCV to it.
Test: This appears to have been attempted before, but I'm taking my shot at it.The test is to see if the larva can be directed to move to specific places by changing Units.Dat and Grafting.
Outcome: Mixed-Success The larva can move around freely, but I still have yet to attempt to see if can create a unit normally. It is also not creep-dominant, it can move around anywhere on the map freely.
Hypothesis: Well the larva moves around like it does because of its AI orders, and it doesn't have amove button(although I don't believe it needs one). By changing the AI orders and giving the Move button it moves freely.
The TRUE Syntax for trgtarccondjmpEdit
By BSTRhino, published by Lord_Agamemnon(MM)
Test: I was trying to make trgtarccondjmp work properly using the syntax stated in the ICECC manual. However, it was not working. So I messed around a bit and consulted BSTRhino's published Zerg Doom Ultralisk script, and I tried to piece together the actual syntax.
Outcome: Success. The manual gives the syntax for trgtarccondjmp as
trgtarccondjmp (codeblock) (number1) (number2)
Where number1 and number2 are in degrees from -45 (standard unit circle degrees, 0 is straight to the right) and the code will jump to codeblock if the target is between number1 and number2.
This is almost completely wrong.
Firstly, number1 and number2 are nor measured in degrees: they are measured in what I call Starcraft angular units. 256 SCangs = 360 degrees, so 1 SCang = 1.40625 degrees. Secondly, number2 is the number of SCangs either direction from number1 that will trigger the condition, in other words, the code's tolerance for error. Finally, number1 is not measured from -45 degrees, it's measued from +90 (Straight up!) I believe but am not sure that it measures SCangs counterclockwise from this reference point.
An example of the code's actual use follows:
trgtarccondjmp Foobar 128 32
This would make the script jump to Foobar if the target is between 96 angs from the reference point (225 standard unit circle degrees) and 160 angs (315 standard unit circle degrees).
Example: Aetherflame Lord - The scripts are available in the thread. Look at and try the Empyrean Starstorm special attack.
Making buildings attack like a bunkerEdit
Test: Is it possible to make other buildings attack like the bunker? What causes the bunker to be able to attack? Even after adding supply room and such to a building, it still crashed. I set out to determine the problem
Outcome: Success. I was able to make it so that a building attacked like a bunker by adding a .lo? file to overlay 1 in datedit. I based it off the .loa file that exists for the bunker. However, it acted just like the bunker, down to the overlays it used. Note, the building flag must be set, otherwise it doesn't work.
Buildable resources cont'dEdit
Test: Resources can be built by a player, but can a player-built geyser be built on to gather from?
Outcome: Resounding success! The geyser can be built on and successfully mined from. DoA's exe edit works perfectly, so I can get 8 Vespane every time However, the geyser can be built as close to the nexus as you want (I haven't tested for a way around this, it may exist) and the colours appear a little strange until you build an assimilator on it O.o And for some reason, it has a "cancel" button that causes it to explode. Cool.
Hypothesis: I guess geysers owned by any player can be built on. This could be an interesting addition to a mod, and could give a huge tactical advantage to any race.
Screenshot You can see the strange colours of the geyser, as well as the cancel button.
Note: Upon further research, this appears to be unstable. It is my presumption that I failed to add a "goto" in its iscript, and it crashes due to that. I am led to believe that this is the problem due to the fact that no puffs of gas are created. I find this odd because it is clearly in the iscript. I suggest if you wish to use this in the future, you look into making its iscript more stable.
Instant Vespane GatherEdit
Test: I am going to attempt to discover whether resources can be gathered to an Assimilator. The first part of the test will determine if an Assimilator with such properties can be built on a geyser, followed by determining if it can be gathered to. I will be using my .exe from the previous test to test this a) near minerals and b) away from minerals (if test a) fails).
Outcome: Resounding success! The Assimilator can be built on a Geyser near minerals. The probe then can gather Vespane straight to it. It pops out for a few moments to drop it off, so you'll still need two probes for optimal performance.
Hypothesis: The assimilator has special build properties so it can be built upon Vespane, and this probably cancels out the effect of the Resource Depot flag.
Nuclear Silo UnitsEdit
Test: Can a Nuclear Silo build units? To test, I gave the nuclear silo the ability to build an SCV and changed the reqs. Also, because of what I was trying to do at the time, it could build add-ons too.
Outcome: Mixed. Lord_Agamemnon(MM) - This is actually quite amusing. The Silo built the units perfectly, although its queue only showed one building at a time. The queue did work, however.
The amusing part is that every time a unit/add-on construction finished, the silo armed itself! I didn't test to see if this "artifical nuke" is usable by Nuclear Strike, but I would assume it is.
Hercanic - Actually, when you use Nuclear Strike, the unit you made from the Silo starts walking on its own toward the top of the map, as if it were the Nuclear Missile. It's hilarious.
Hypothesis: Lord_Agamemnon(MM) - The Nuclear Silos' memory structure only processes one unit build at a time and arms itself whenever construction finishes. Perhaps for this the game treats the nuke as a regular unit and uses a sort of "remove unit/modify hangar count" special trigger. DiscipleOfAdun - I would assume there's a check in the build routine that, upon completion of a unit in a nuke silo, places the pointer to that unit in the memory reserved for the nuke's poitner and sets the armed count to 1. I also assume the queue is ID coded also.
Test: Can a Nydus Canal be built independent of Creep? This was meant as a feature for HunterCraft, but...
Outcome: Failure. Well, the first Nydus Canal can be placed normally (that is, without creep if you uncheck the flag,) but the exit placement always requires creep.
Hypothesis: Something hardcoded. I would guess that one of the exploits Blizzard found allowed Nydus Canal exits to be built anywhere, so they hardcoded it to creep.
Lifted buildings building unitsEdit
Test: I wanted to see if it was possible for a building to build units while lifted off. I did a bit of grafting so that SCVs can be built in the air.
Outcome: Failure. When the button was clicked, the SCV queue came up, but stayed at a halted position. Due to the accessibility of the buttons, I was able to test the build goliath in the air glitch quite easily by building an SCV in the air(and having it halted), landing, then lifting off. The SCV builds at the point that the CC was when it lifted. It builds as many SCVs as I had in the queue when I landed, and placed them all at the location I had landed. If I cancel construction, the CC gets it's landed frames, yet the shadow it still a ways below it.
Hypothesis: I dunno, I'm too tired right now. I may update in the morning.
Test: Sigorder is one of those nasty ICECC opcodes that is relatively unknown. With a bit of testing and help, I set out to roughly determined what its values do. As far as I know, sigorder only comes as 1, 2, 4, and 16.
Outcome: Mixed, leaning toward success The results are listed as follows:
- Still not entirely sure. It's often used for things dying: the Infested Terran's attack animation and every missile use it.
- Toggle siege mode?
This one's been known for a while: End spell cast. This sends SC the signal to stop casting the spell and get on with whatever else it wants to do. Maybe someone can flesh this out a bit more.
This has two uses:
- Toggle burrow status. It's found in every burrow and unburrow animation.
- Complete morph. This is found in the Zerg Egg, Cocoon, and Building Morph graphics in the midst of the completion frames. Remove it and the morph never actually finishes.
Toggle lift-off/landed status. Found in all lift-off and landing animations. This is what tells the game when to actually shift the building's graphic and toggle the flyer flag.
Example: Decompile iscript.bin and look at it.
By Chronos Ouroboros
Test:"Can a non-cloaking unit be cloaked without plugins or hex editing?" This is a question I have in my mind since I started modding,that's why I actually tried it!
Outcome: Mixed,I edited all the required files and enabled the exe edits at firegraft and it cloaked,but it didn't uncloak,I may have forgotten something,and the exe edits are for 1.15.1 and the mod I tested this for is for 1.16.1,I may look into it to make it work.
Chronos Ouroboros-The FireGraft from BWAI has some updated EXE edits and has various new ones,the updated ones include Cloaking and the Siege Tank EXE Edit(the one that changes what unit it changes to)