Jump to content

Photo

Consecutive Monster Generator

FFC

  • This topic is locked This topic is locked
9 replies to this topic

#1 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Gender:Female
  • Location:Rainbow Factory

Posted 10 December 2013 - 09:17 PM

Consecutive Monster Generator

 
Description
 
Spawns monsters consecutively. Useful for Wizzrobes, Zoras, and other enemies that attack simutaneously. Just don't go using it with Windrobes.  :snide:
 
Code
 

//Include these once at the top of your script file
import "std.zh"
import "string.zh"
import "ghost.zh"

//Used to make enemies teleport in one at a time.
ffc script MonsterSpawner
{
    void run(int enemyID, int max, int frequency, int flags, bool continuous)
    {
        if(enemyID==0 || max==0 || frequency==0)
            Quit();
        Waitframes(4);
        while(true)
        {
            if(NumNPCsOf(enemyID)<max)
            {
                npc n = Screen->CreateNPC(enemyID);
                int spawnpoint = FindSpawnPoint(flags&1b, flags&10b, flags&100b, flags&1000b);
                n->X = ComboX(spawnpoint);
                n->Y = ComboY(spawnpoint);
            }
            else if(!continuous)
            {
                break;
            }
            Waitframes(frequency);
        }
        npc n = LoadNPCOfType(NPC_TRIGGER);
        if(n->isValid()) n->HP = -1000;
    }
}

 
Setup

 
Step 1: Play ffc on screen and attach script
Step 2: Set Attributes as follows
 
D0 ID of the Enemy you wish to create.
D1 Max number of enemies before it stops generating.
D2 How many frames to wait until spawning another.
D3 SpawnPoint Flags are 4 values ORed together as follows

  • 1 = Land
  • 2 = Solid Combos
  • 4 = Water
  • 8 = Pits (Direct Warps)

D4 The script quits if the max is reached, setting this to any value except zero prevents this.
 
Resources
 
You'll need both std.zh and string.zh which are included with Zelda Classic and also ghost.zh which can be found here.



#2 Three Pendants

Three Pendants

    Recipient of Ways

  • Members
  • Gender:Unspecified

Posted 10 December 2013 - 09:42 PM

Now that is cool! I am sure that this will get quite a bit of use.



#3 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Gender:Female
  • Location:Rainbow Factory

Posted 10 December 2013 - 09:43 PM

Now that is cool! I am sure that this will get quite a bit of use.

 

Thanks :)

Glad you like it.



#4 Jared

Jared

    Lost at sea

  • Members
  • Real Name:Jared
  • Gender:Male
  • Location:Massachusetts

Posted 10 December 2013 - 09:51 PM

Let's say you wanted to use this to kill enemies to trigger a secret. If you kill all of them on the screen, but then another enemy comes onto the screen after, does the secret wait to trigger until ALL the enemies are defeated?



#5 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Gender:Female
  • Location:Rainbow Factory

Posted 10 December 2013 - 10:00 PM

Let's say you wanted to use this to kill enemies to trigger a secret. If you kill all of them on the screen, but then another enemy comes onto the screen after, does the secret wait to trigger until ALL the enemies are defeated?

 
Actually no, for that to happen I'll need to edit the script which I will.

edit: Fixed. Enjoy my friend. Just place a trigger on the screen and it will be killed after the enemies all spawned.

Edited by Palpaleos, 10 December 2013 - 10:10 PM.


#6 Jared

Jared

    Lost at sea

  • Members
  • Real Name:Jared
  • Gender:Male
  • Location:Massachusetts

Posted 11 December 2013 - 08:54 AM

Ah, I'm glad it's been fixed! Well done!



#7 Alucard648

Alucard648

    Adept

  • Members
  • Gender:Male
  • Location:castle Dracula

Posted 16 December 2013 - 02:40 AM

Yes!!  :bounce: Let the Medusa Heads fly infinitely!  :twisted:

 

A simple suggestion: how about an option to have Monster Spawner stop working when the secrets are triggered. For instance: Grim Reaper (boss) and spawner spawning Reaper`s sickles. When the boss bites the dust, "Ring Leader" screen flag destroys all on-screen sickles and "Enemies -> Secret" triggers secrets (open passage further in the level) as well as stopping monster spawner to prevent "Kaizo traps".


Edited by Alucard648, 16 December 2013 - 02:59 AM.


#8 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Gender:Female
  • Location:Rainbow Factory

Posted 16 December 2013 - 03:14 AM

Yes!!  :bounce: Let the Medusa Heads fly infinitely!  :twisted:

 

A simple suggestion: how about an option to have Monster Spawner stop working when the secrets are triggered. For instance: Grim Reaper (boss) and spawner spawning Reaper`s sickles. When the boss bites the dust, "Ring Leader" screen flag destroys all on-screen sickles and "Enemies -> Secret" triggers secrets (open passage further in the level) as well as stopping monster spawner to prevent "Kaizo traps".

 

You can do that already lol.



#9 Alucard648

Alucard648

    Adept

  • Members
  • Gender:Male
  • Location:castle Dracula

Posted 16 December 2013 - 07:39 AM

You can do that already lol.

So how I can make Monster Spawner stop generating enemies when secrets are triggered?



#10 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Gender:Female
  • Location:Rainbow Factory

Posted 16 December 2013 - 08:08 AM

Actually I was mistaken you cannot do that yet. I'll twerk it for you.





Also tagged with one or more of these keywords: FFC

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users