Ghost is a perfect example of why ZC needs modules. Ghosted enemies never saw widespread use for the simple reason that setting the whole thing up was just too complicated and too time-consuming for the average user or beginner user to figure out. So much so that Moosh and Avataro had to write the newbie boss script because scripted bosses were simply not being made by most quest-makers. Even that doesn't see much use because its so hard to setup.
Ghost and Liberation of Hyrule have been available since 2012. Liberation of Hyrule has ~500 downloads and Ghost has ~350. Even my most hated LoH quest has more downloads than the Mona Lisa of scripting. At least with Liberation of Hyrule you can actually start playing the game. With Ghost you're pretty much dead at the setup. I wish 2.55 all the best in its attempts to streamline scripting. I'll leave you with the setup instructions for ghost and you see what the problem is for players who are new and know nothing about scripting:
AutoGhost setup
First of all, extract ghost.zh and the ghost_zh folder from the zip file.
- Windows or Linux: These should go in the same folder as ZC itself.
- Mac: Right-click the ZQuest application and select Show Package Contents. The files should go in Contents/Resources. To be sure you're in the right place, look for std.zh and string.zh.
If you want to use ghost.zh in multiple quests with different settings, you can make copies of the file with a different filename or in a different folder. You only need to copy the file ghost.zh itself.
General setupThis part only needs done once per quest.
Blank tiles and comboFirst, you'll need to set aside a 4x4 block of tiles to leave blank.
Set up a combo that uses the top-left tile of that block and has its type and flag both set to (None). Remember the tile and combo numbers for later.
You should also modify the MISC: Spawn sprite in Quest > Graphics > Sprites > Weapons/Misc. It needs to have the animation speed and number of frames set; 3 frames at a speed of 5 will best match the built-in enemies.
ConstantsYou'll have to set some constants in ghost.zh. Open it in a text editor. Use a basic one, like Notepad; more advanced word processors sometimes modify punctuation marks, which can make scripts unusable.
The constants look similar to this:
const int CONSTANT_NAME = ###; // And sometimes there's a note here
The ### part is what you need to change. Be careful to leave the semicolon in place.
If you're making multiple quests at once that use different settings, you should use a different copy of ghost.zh for each one. You only need to copy ghost.zh itself, not the ghost_zh folder.
Loading the scriptsIn ZQuest, go to Quest > Scripts > Compile ZScript... > Edit. These three lines need to appear once each. Enter any line that isn't already there.
import "std.zh" import "string.zh" import "ghost.zh"
This assumes that all these files are in the default location. If you put ghost.zh in a different folder, you'll have to specify that, for instance:
import "MyQuest\Scripts\ghost.zh"
Close the window, save the changes, and click Compile. In the Global tab, load GhostZHActiveScript into the Active script slot. If you want to use clocks, in the Item tab, load GhostZHClockScript into any slot.
If your quest uses clocks, set the clock's pickup script to GhostZHClockScript and set D0 to the same number as the clock's duration.
Individual enemies Importing the scriptFirst, the script needs to be imported. In the script buffer, add another line to import the file. For instance:
import "GoriyaLttP.z"
Some scripts might require that you import additional files, but don't include any file more than once. Compile and load the FFC script into a slot.
Exactly what needs done varies from one enemy to the next, but a few things are common. Many scripted enemies need at least one combo set up, but some use the invisible one. Every enemy needs its type (usually Other), HP, damage, tile, and CSet set. The enemy must also have a script and combo set. There are a few different ways of doing this, described below.
Many enemies require more than one combo. In these cases, assume that all combos must be consecutive in the list and the enemy's combo set to the first one unless the instructions say otherwise. Also, some scripts require that multiple enemies be set up. Unless instructed otherwise, you only need to place the primary enemy on the screen.
Some enemies use the invisible combo (GH_INVISIBLE_COMBO). In these cases, you can set the combo to -1. A few enemies also specify -2, another special value.
Setting the script and comboIf __GH_ALWAYS_USE_NAME is 0:
Misc. attributes 11 and 12 are used to identify the enemy as scripted and set up an FFC to run the script. Attribute 11 indicates which combo the enemy should use, and attribute 12 determines what script it runs. If either of these is 0, the enemy will not be recognized as scripted and will not function. If attribute 12 is set to -1, the script name will be read from the enemy's name as described below.
If __GH_ALWAYS_USE_NAME is 1:
Misc. attributes 11 and 12 are not used. The script and combo will be always be read from the enemy's name. The combo can be omitted, in which case it will default to GH_INVISIBLE_COMBO.
When reading a script from the enemy's name, whether because misc. attribute 12 is -1 or __GH_ALWAYS_USE_NAME is enabled, the script name must go in the enemy's name immediately following the character @. The script name must appear exactly as shown after it is compiled, including capitalization.
For example, using the Armos_LttP script, these names will work:
- Armos (LttP) @Armos_LttP
- Armos (L1, @Armos_LttP)
These names will not work:
- Armos @armos_lttp
- Incorrect capitalization
- Armos @ Armos_LttP
- Space after @
When using __GH_ALWAYS_USE_NAME, the combo number is read in the same way. The order does not matter. Spaces or other characters between the two are not required, but they're allowed as long as they wouldn't be mistaken for part of the name or number.
Using the Goriya_LttP script with combo 5888, these names will work:
- Goriya (LttP) (@Goriya_LttP, @5888)
- Goriya (LttP) @5888@Goriya_LttP
These will not work:
- Goriya (LttP) @Goriya_LttP_@5888
- _ looks like part of the script name
- Goriya (LttP) @ 5888 @ Goriya_LttP
- Space after @ is not allowed