Jump to content

Photo

Enemie spawner


  • Please log in to reply
6 replies to this topic

#1 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 29 April 2011 - 06:43 AM

I know, this is a simple script. I tried it by myself, but I failed...

I want a script that spawns one enemie at the position of the FFC.

D0 should be the enemie ID of the enemies that should be spawned.
(for instance: when I set it to "28", it spawns a moblin Lv1)


Can anybody do this for me please? icon_smile.gif

By the way: I need the enemies->secret - function for the enemies. Does this Screenflag works with ffc-enemies too? If not, I don't need the script.


(sorry for my bad english)

#2 Joe123

Joe123

    Retired

  • Members

Posted 29 April 2011 - 11:08 AM

CODE
ffc script Spawner
{
    void run(int ID)
    {
        Waitframes(4);
        npc n = CreateNPCAt(ID, this->X, this->Y);
        n->Dir = DIR_DOWN;
    }
}


I believe it should work with that screen flag.

Edited by Joe123, 29 April 2011 - 11:09 AM.


#3 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 30 April 2011 - 04:25 AM

Thank you. icon_smile.gif

#4 XMSB

XMSB

    Furry Friends Furever

  • Members
  • Real Name:Joseph Watson
  • Location:San Antonio, Texas

Posted 17 August 2011 - 05:46 PM

Sorry to bring this up, but there is one issue with this script. Any trap type enemies spawned by this FFC script don't work properly.
In the case of Line-of-Sight Traps, if the trap moves down or right, then it would not return to its original position and would instead move off the screen, but if it moves up or left, it would get stuck in the top-left corner of the screen upon hitting a solid combo. And any constant trap spawned by this FFC Script would move vertically even if it is set to horizontal or 4-way movement.

#5 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 17 August 2011 - 07:17 PM

As long as this is bumped, what is the advantage to using this script versus the enemy placement flags?
Is it just so that they don't have to line up to the grid?

#6 XMSB

XMSB

    Furry Friends Furever

  • Members
  • Real Name:Joseph Watson
  • Location:San Antonio, Texas

Posted 17 August 2011 - 07:58 PM

Well, for one thing, it is capable of spawning enemies that normally cannot be spawned by the enemy placement dialog, such as traps (which seem to be buggy when spawned by this script) and Ganon type enemies (though the Ganon Room animation would not be used unless the room type is Ganon). It's also convenient for spawning 3 boulders instead of using the enemy placement dialog, seeing as the falling rocks flag spawns the lowest numbered enemy with the corresponding spawn flag checked. The disadvantage is that even if they have the Never Returns After Death flag checked, they always return if they are spawned by this script.
PS: As simple as this script may be, I'm just curious as to why it's not in the database.

Edited by XMuppetSB, 17 August 2011 - 07:59 PM.


#7 XMSB

XMSB

    Furry Friends Furever

  • Members
  • Real Name:Joseph Watson
  • Location:San Antonio, Texas

Posted 23 October 2011 - 10:23 AM

Sorry to bring this up, but:

CODE

ffc script Spawner
{
    void run(int ID)
    {
        Waitframes(4);
        npc n = CreateNPCAt(ID, this->X, this->Y);
        n->Dir = DIR_DOWN;
    }
}


The one variable in this script that's causing all constant traps to only move vertically regardless of what direction they're assigned to is as follows: n->Dir = DIR_DOWN;

Removing this variable should solve the problem.

So, the script should look like this instead:

CODE

ffc script Spawner
{
    void run(int ID)
    {
        Waitframes(4);
        npc n = CreateNPCAt(ID, this->X, this->Y);
    }
}



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users