Jump to content

Photo

Kill enemies-> FFCS


  • Please log in to reply
33 replies to this topic

#16 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 07:18 PM

QUOTE(Russ @ Jan 3 2013, 03:14 PM) View Post


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 script works well except me of when I killed the first enemy of the list .. those below this did not work correctly. I view the portal without having killed anyone



#17 Soga

Soga

    Secretly Alive

  • Members

Posted 03 January 2013 - 07:29 PM

QUOTE(Russ @ Jan 3 2013, 04:10 PM) View Post

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.


Ah... there's the problem.

CODE
if(Screen->NumNPCs()>0){


That should be a <= or == there. icon_razz.gif

Here, Cereal Guy, use this:

CODE
ffc script EnemyToSecretFFC
{
    void run(int combo, int cset)
    {
        // Do nothing until all enemies are gone.
        // This loop will be skipped if the FFC secret is already triggered.
        while(Screen->D[0]!=1 && Screen->NumNPCs()>0)
            Waitframe();
        
        // Set screen FFC secret and change FFC Combo and CSet.
        Screen->D[0]=1;
        this->Data = combo;
        this->CSet = cset;
    }
}

Edited by Soga, 03 January 2013 - 07:30 PM.


#18 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 07:40 PM

I try to see what is best for me .. but I think it is not permanent, because my game is able to return to all normal level as in the beginning

For not create other post: --------------> Not permanent, definitive answer icon_eek.gif

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


#19 Soga

Soga

    Secretly Alive

  • Members

Posted 03 January 2013 - 07:43 PM

Here's a new one.

CODE
ffc script EnemyToSecretFFC
{
    void run(int combo, int cset)
    {
        // Do nothing until all enemies are dead.
        // If the permanent secret is triggered, skips this loop.
        while(!Screen->D[0] && Screen->NumNPCs()>0)
            Waitframe();
        
        // Check if "Secrets are Temporary" flag is NOT ENABLED and
        // if "Enemies -> Secret is Permanent" is ENABLED, then the
        // secret is permanent.
        if (!Screen->Flags[SF_SECRETS]&2 && Screen->EFlags[SEF_LIST2]&8)
            Screen->D[0]=1; // Make the secret permanent.
        this->Data = combo;
        this->CSet = cset;
    }
}


Now, this time, if you WANT it to be permanent, enable "Enemies -> Secret is Permanent" under Screen Data's E. Flags. Note that this is overridden by "Secrets are Temporary" -- if you have that checked, then the secret will be temporary no matter what, even if you have "Enemies -> Secret is Permanent" enabled. Don't know why you would mix the 2 flags anyway, so just don't enable either of them if you don't want permanent secrets.

Now it's up to you if you want it a permanent secret or not on the screens you want this script for.

Edited by Soga, 03 January 2013 - 08:52 PM.


#20 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 08:49 PM

QUOTE(Soga @ Jan 3 2013, 06:43 PM) View Post

Here's a new one.

CODE
ffc script EnemyToSecretFFC
{
    void run(int combo, int cset)
    {
        // Do nothing until all enemies are dead.
        // If the permanent secret is triggered, skips this loop.
        while(!Screen->D[0] && Screen->NumNPCS()>0)
            Waitframe();
        
        // Check if "Secrets are Temporary" flag is NOT ENABLED and
        // if "Enemies -> Secret is Permanent" is ENABLED, then the
        // secret is permanent.
        if (!Screen->Flags[SF_SECRETS]&2 && Screen->EFlags[SEF_LIST2]&8)
            Screen->D[0]=1; // Make the secret permanent.
        this->Data = combo;
        this->CSet = cset;
    }
}


Now, this time, if you WANT it to be permanent, enable "Enemies -> Secret is Permanent" under Screen Data's E. Flags. Note that this is overridden by "Secrets are Temporary" -- if you have that checked, then the secret will be temporary no matter what, even if you have "Enemies -> Secret is Permanent" enabled. Don't know why you would mix the 2 flags anyway, so just don't enable either of them if you don't want permanent secrets.

Now it's up to you if you want it a permanent secret or not on the screens you want this script for.


What pointer type does not have a function NumNpcs.

icon_frown.gif


#21 Soga

Soga

    Secretly Alive

  • Members

Posted 03 January 2013 - 08:53 PM

Ffffffff...... I really need to compile my code before I post it. Fixed. Try it now.

It was supposed to be NumNPCs, not NumNPCS. I didn't release the shift key before typing the S there... my fail.

#22 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 09:10 PM

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHh

CODE
if (!Screen->Flags[SF_SECRETS]&2 && Screen->EFlags[SEF_LIST2]&8)



CANNOT CAST FROM BOOL TO FLOAT. FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

#23 Soga

Soga

    Secretly Alive

  • Members

Posted 03 January 2013 - 09:15 PM

QUOTE(Cereal Guy @ Jan 3 2013, 08:10 PM) View Post

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHh

CODE
if (!Screen->Flags[SF_SECRETS]&2 && Screen->EFlags[SEF_LIST2]&8)

CANNOT CAST FROM BOOL TO FLOAT. FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU


Aw, COME ON. That doesn't work in ZScript? Fine. Have to do it the long way, then.

CODE
ffc script EnemyToSecretFFC
{
    void run(int combo, int cset)
    {
        // Do nothing until all enemies are dead.
        // If the permanent secret is triggered, skips this loop.
        while(!Screen->D[0] && Screen->NumNPCs()>0)
            Waitframe();
        
        // Check if "Secrets are Temporary" flag is NOT ENABLED and
        // if "Enemies -> Secret is Permanent" is ENABLED, then the
        // secret is permanent.
        if (Screen->Flags[SF_SECRETS]&2==0 && Screen->EFlags[SEF_LIST2]&8!=0)
            Screen->D[0]=1; // Make the secret permanent.
        this->Data = combo;
        this->CSet = cset;
    }
}


This should work. It will work. Otherwise, I assure you, my wall will have a dent in it, and I may or may not have a head concussion.

#24 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 09:21 PM

.. damn, damn error, damn zc, damn all .. neh lie XD. I can use the other if I have this problem that when I kill the first enemy appears the portals

#25 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 09:50 PM

Can I ask a question? Does it NEED to be a FFC appearing? Couldn't you do this with secret flags and Enemies->Secret?

#26 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 09:54 PM

I can not. the sprite would be totally out of line and would be the black background

#27 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 10:03 PM

Then you just put it on a layer. Bam, no black background.

#28 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 03 January 2013 - 10:05 PM

w ... wh .. that? that's possible? .... ._.

#29 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 January 2013 - 10:07 PM

Yeah. How do you think people handled secrets with transparency before scripting? You just have to select the layer, lay down the flag combos, and set the secret combos. Each layer has its own set of secret combos.

#30 Cereal Guy

Cereal Guy

    Senior

  • Members
  • Location:Concepción, CHL

Posted 04 January 2013 - 12:05 PM

Yeah, I worked .. I have no idea because I did not. icon_frown.gif

Can make it work the Type that has the combo?

I'm working on the Layer 2 ..


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users