Requires Std.zh (included within your ZC folder), String.zh (included within your ZC folder) and
Ghost.zh (included within your ZC folder with versions 2.53 and newer).
How to set the script up:
- Make or rip the tiles that the Peahat and any larvae use. This uses the enemy tiles from the tile page directly, so set those up. Currently, directional sprites for the Peahat itself are not supported.
- Import Ghost.zh, std.zh and string.zh and set up the global script to run autoghosted enemies if you already haven't. The instructions on how to set up Ghost.zh and Autoghost is included in the text files packaged inside the Ghost.zh folder and in this video Saffith set up on Autoghost.
- Compile the script.
- Adjust the enemy's stats and misc attributes as necessary
- Enjoy!
Attributes:
Set up HP, Damage, Weapon Damage, Step, Random Rate, Homing and Animation speed as usual.
Animation speed refers to the animation speed of the Peahat when it is flying at full speed. This value is doubled when the Peahat is landing or rising and set to 255 when it is on land.
Misc Attributes:
Misc. Attr. 1: The Z Height, in pixels, at which the Peahat flies up to.
Misc. Attr. 2: Amount of time, in frames, the Peahat remains at its desired Z Height before flying down
Misc. Attr. 3: Amount of time, in frames, the Peahat remains on the ground before flying up
Misc. Attr. 4: By how much percent does the amount of frames that its flight time gets vary from its normal value, both above and below
Misc. Attr. 5: The enemy ID it spawns for its larvae.
Misc. Attr. 6: The number of larvae it spawns at a time.
Misc. Attr. 7: The frequency at which it spawns larvae, in frames. Pass a negative value into this to enable it to also summon while on the ground too.
Misc. Attr. 8: Distance, in pixels, where Link has to be within to cause the Peahat to start flying away. If grounded and Link is within this distance from the Peahat, it begins to fly away. If about to descend, it will postpone its descent if Link is within this distance from it. If in the process of landing, it will fly back up if Link is within this distance from it.
Misc. Attr. 9: The SFX used for spawning larvae. Set to -1 or below to use the default summon SFX (SFX_SUMMON, 56)
Misc. Attr. 11: Set this to -1. This is an Autoghost requirement.
Misc. Attr. 12: The number of the FFC script the Peahat uses. This is also an Autoghost requirement, which is waived if the appropriate settings are set in your Ghost.zh file.