Jump to content

Photo

Check to see if there's no more of x combo on screen...


  • Please log in to reply
2 replies to this topic

#1 idontknow8

idontknow8

    Senior

  • Members

Posted 20 February 2018 - 11:26 PM

What's the script for that?

 

I believe It starts with...

 

for(int i = 0; i < 176; i++){

 

 

I know this checks all combos on the screen but how do I get it to say that if all of these combos are no longer Screen->ComboD == x... then do blah blah blah?  (In this case, the blah blah blah happens to be trigger all secrets, which I know is simply:

Screen->TriggerSecrets( );

Screen->State[ST_SECRET] = true;
Game->PlaySound(27);
 
 


#2 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 21 February 2018 - 09:50 AM

bool ComboFound;

for(int i = 0; i < 176; i++){
if ( Screen->ComboD[i] == 10 )
ComboFound = true;
}

if ( !ComboFound ) {
Screen->TriggerSecrets( );
Screen->State[ST_SECRET] = true;
Game->PlaySound(27);
}

Here, not sure why I can't indent on PureZC though.


Edited by Avataro, 21 February 2018 - 09:50 AM.


#3 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 February 2018 - 04:10 AM

You probably want this in the form of a function:

bool ScreenHasCombo(int cmb_id)
{
    bool found;
    for (int q = 0; q < 176; ++q ) //++is faster
    {
        if ( Screen->ComboD[q] == cmb_id )
        {
            found = true; break;
        }
    }
    return found;
}

...Then, call that function however you desire:


if (!ScreenHasCombo(COMBO_ID))
{
    Screen->TriggerSecrets();
    Screen->State[ST_SECRET] = true;
    Game->PlaySound(SFX_SECRET);
}



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users