Reformatted Script Files

Download here.

Abbreviations for Race Names

r1 = Kushan
r2 = Taiidan
p1 = Turanic Raiders
p2 = Kadeshi
p3 = T-MAT
traders = Bentusi and miscellaneous ships

There are six SCRIPT files in this download, each named after one of the six races.

Script File Contents

Inside each SCRIPT file is a huge list of effects and the EBG files assigned to those effects. At the top are the DeathEvents, formatted like this:

setDeathEvent           race,CLASS_Fighter,damage,AssignedFile.ebg
setDeathEvent           race,CLASS_Fighter,projectile,AssignedFile.ebg
setDeathEvent           race,CLASS_Fighter,beam,AssignedFile.ebg

This calls AssignedFile.ebg whenever a Fighter-class ship from race 'race' is destroyed by damage, projectile weapons, or beam weapons.

Then come the weapons. Each weapon is actually three effects: the muzzle flash, the bullet, and the impact. Here is a sample weapon

setFireEvent            R1,GS_LargeEnergyCannon,FireEnergyLarge.ebg
setFireEvent            R1,GS_LargeEnergyCannon,FireEnergyLarge.ebg
setFireEvent            R1,GS_LargeEnergyCannon,FireEnergyLarge01.ebg
setFireEvent            R1,GS_LargeEnergyCannon,FireEnergyLarge01.ebg
setBulletEffect         R1,GS_LargeEnergyCannon,BulletCannonLarge.ebg
setBulletEffect         R1,GS_LargeEnergyCannon,BulletCannonLarge.ebg
setBulletEffect         R1,GS_LargeEnergyCannon,BulletCannonLarge02.ebg
setBulletEffect         R1,GS_LargeEnergyCannon,BulletCannonLarge03.ebg
setHitEvent             R1,GS_LargeEnergyCannon,HitCannon.ebg
setHitEvent             R1,GS_LargeEnergyCannon,HitCannon.ebg
setHitEvent             R1,GS_LargeEnergyCannon,HitCannon.ebg
setHitEvent             R1,GS_LargeEnergyCannon,HitCannon.ebg

There are four copies of each line because effects have levels of detail just like the ship models themselves. The four lines assign an effect to LOD0 through LOD3. setFireEvent assigns the muzzle flash, BulletEffects are bullets, obviously, and HitEvents define the weapon's impact. The R1 indicates that the effects are for Kushan ships. GS_LargeEnergyCannon, like in the SHP files, indicates the weapon slot; in this case, frigate class guns.

At the end of the file are effects for resource harvesting and salvaging. Also, Homeworld will sometimes reduce faraway bullets to simple lines, instead of drawing in a more complicated effect. There is a section that will let you control the color of those lines.

At the very end of the file is a very important heading. Effects loading is where you warn Homeworld of subroutine EBGs that other EBG files may call. Without this section, Homeworld would not know to load the subroutine, and would crash when the EBG file asked for it.

Changing Weapon Slots

The webpage for each effect shows you show to put the effect into a certain weapon slot for a certain race. You may want to put the effect elsewhere. No problem!

If you want to give a weapon to, say, the Turanic Raiders instead of the Kushan, the procedure is simple. Copy the block of text that normally goes in your script file into Wordpad. (Notepad works too, but it has only search, not search-and-replace.) Search and replace "R1" with "P1" and replace all. Then copy the block of text into p1.script instead of r1.script.

If you want to change a weapon from, for example, smallEnergyCannon to VeryLargePlasmaBomb, the procedure is pretty much the same. Search for smallEnergyCannon in the readme, replace it with VeryLargePlasmaBomb, then copy the modified block of text over the old veryLargePlasmaBomb information in the script file. If you're feeling especially adventurous, you can even switch slots and race.

One final word of warning. Be very careful when changing weapons in a Large slot. If you hit "replace all" when searching for "LargeWhateverGun," you'll not only change "Large WhateverGun," but also "VeryLargeWhateverGun," which is almost sure to crash Homeworld.