Miscellaneous functions
- void SetEnemyProperty(npc enemy, int property, float newValue)
- float GetEnemyProperty(npc enemy, int property)
-
These functions allow some of the properties of ghost.zh scripts to be read and set from other scripts. property must be one of the following:
ENPROP_X
ENPROP_Y
ENPROP_Z
ENPROP_JUMP
ENPROP_DIR
ENPROP_HP
ENPROP_CSET
These work for all enemies, not just scripted ones, so there's no need to check that beforehand.
- int FindSpawnPoint(bool landOK, bool wallsOK, bool waterOK, bool pitsOK)
-
Finds a random combo position meeting the given criteria some distance away from Link and enemies. This can be useful if you want the enemy to spawn in a random position that ZC would not select itself. The result is undefined if no suitable location exists, but that will not happen unless there is almost no space abailable on the screen.
landOK
: Walkable, non-water, non-pit combos are okaywallsOK
: Unwalkable, non-water, non-pit combos are okaywaterOK
: All deep water combos are okaypitsOK
: Direct warps are okay - int FindSpawnPoint(int type, int flag)
- Like the above, but finds a combo with the given combo type or flag, regardless of solidity. Only layer 0 is checked. Use -1 for either argument to ignore it.
- npc SpawnNPC(int id)
- Spawns an npc with the given ID in a random location and returns a pointer to it.
- int FindUnusedFFC()
- int FindUnusedFFC(int startingFrom)
- Returns the ID number of an FFC that is not currently in use in the range
AUTOGHOST_MIN_FFC
toAUTOGHOST_MAX_FFC
. Returns 0 if no FFC is available in that range. IfstartingFrom
is given, the ID returned will be at leaststartingFrom+1
. - void Ghost_MarkAsInUse(npc ghost)
- Mark an enemy as being in use by a script. This allows you to create
additional enemies without
AutoGhost()
orGhost_InitWait2()
trying to use them. - bool Ghost_IsInUse(npc ghost)
- Returns true if the given enemy is in use by a ghost.zh script.
- bool ClockIsActive()
- Returns true if a clock is currently in effect.
- void SuspendGhostZHScripts()
- Suspends the execution of all ghost.zh scripts. Until scripts are resumed,
Ghost_Waitframe
functions will not return andUpdateEWeapon()
will not do anything. This also stopsAutoGhost()
from running, so any new enemies will not have scripts launched untilResumeGhostZHScripts()
is called. - void ResumeGhostZHScripts()
- Resumes execution of ghost.zh scripts.