Jump to content

Photo

Kill enemies-> FFCS


  • Please log in to reply
33 replies to this topic

#1 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 03:33 PM

Hello. I'm looking for a script important in my game ... look something like this:

That the script I want to give this function is placed on the screen but you can not see until it kills all enemies on the screen

Could it be possible? icon_unsettled.gif

#2 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 03:36 PM

CODE
ffc script Cantseeme{
    void run(int combo){
        while(true){
            if(Screen->State[ST_SECRET] == true){
                this->Data = combo;
            }
            Waitframe();
        }
    }
}


Instructions: First, set the Enemies->Secret screen flag. Next, set the FFC you attack this script to a blank combo. Now go to the Arguments tab. Set D0 to be the combo number of the combo you want the FFC to look like after the enemies are killed.

#3 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 03:42 PM

Humm. you should have tried. Token While >_>

EDIT: Unexpected while, expecting lbrace, on token while

Edited by Cereal Guy, 03 January 2013 - 03:44 PM.


#4 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 03:51 PM

Whoops, I somehow forgot an L brace. Fixed, now it should work.

Although I don't exactly appreciate being told "You should have tried" and given that face when I went out of my way to script something for you the very same minute you asked for it. <_<

#5 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 03:56 PM

It worked!! icon_biggrin.gif

EDIT: It worked!! icon_biggrin.gif but the compilation, because when I kill all enemies the secret sounds sound but nothing appears.

Edited by Cereal Guy, 03 January 2013 - 03:59 PM.


#6 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 04:14 PM

Huh... that should have worked. Well, I fixed it, tested it, fixed another bug, and voila!

CODE

ffc script Cantseeme{
    void run(int combo, int cset){
        while(true){
        npc n = Screen->LoadNPC(1);
            if(n->HP == 0){
                this->Data = combo;
        this->CSet = cset;
            }
            Waitframe();
        }
    }
}


This time it has two arguments. D0 is the combo to turn into, D1 is the cset to use.

#7 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 04:20 PM

Great! but only works when he killed the first enemy of the list.

#8 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 04:31 PM

Dangit, that didn't work like I thought it would. How many enemies are going to be on the screen?

#9 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 04:33 PM

2. In the game will put maximum 4 per level.

#10 Soga

Soga

    Secretly Alive

  • Members

Posted 03 January 2013 - 04:50 PM

Try this:

CODE
ffc script EnemyToSecretFFC
{
    void run(int combo, int cset)
    {
        // Do nothing until all enemies are gone.
        while(Screen->NumNPCs()>0)
            Waitframe();
        
        // Change FFC combo and cset.
        this->Data = combo;
        this->CSet = cset;
    }
}


This script will scale with any number of enemies in any given room. As before:

Argument D0: Combo you want the FFC to change to.
Argument D1: CSet of the combo you want the FFC to change to.

Credit goes to Russ for his efforts to help you.

I recommend having Enemy -> Secret checked to play the secret sound when enemies are killed.

#11 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 05:00 PM

Yeah, I worked, thanks for the help icon_smile.gif

#12 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 05:02 PM

Damn, it may not be permanent? D:

Edited by Cereal Guy, 03 January 2013 - 05:02 PM.


#13 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 05:02 PM

QUOTE(Soga @ Jan 3 2013, 01:50 PM) View Post

while(Screen->NumNPCs()>0)

...
...
icon_doh.gif

Good lord I can't believe I forgot about that. Wow... just... wow...

#14 Soga

Soga

    Secretly Alive

  • Members

Posted 03 January 2013 - 05:04 PM

QUOTE(Cereal Guy @ Jan 3 2013, 04:02 PM) View Post

Damn, it may not be permanent? D:


Oh, you want it permanent? Meaning that when you kill the enemies in the room, the secret will be there every time you come back even if they respawn?

Right now, the script just shows the secret if there are 0 enemies in the room. I'm assuming you will only use the FFC in rooms which have enemies to begin with, and you're only going to be using this in circumstances where you'd otherwise have Enemies -> Secret checked.

#15 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 05:10 PM

CODE
ffc script EnemyToSecretFFC{
    void run(int combo, int cset){    
        while(true){
            if(Screen->D[0] == 1){
                 this->Data = combo;
                       this->CSet = cset;
            }
            if(Screen->NumNPCs()>0){
                Screen->D[0] = 1;
            }
            Waitframe();
        }
    }
}

This one should work and be permanent.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users