I just thought of another potential complication.
int ScreenCombos[176];//Array to store combos in.
int OldScreen;//Tracks what screen you're on.
const int FLOWER_UNDER_COMBO = 0;//Set to whatever combo is used by the flowers as an undercombo.
//Note: Does not currently support multiple undercombos for flowers that look different.
//While that can be done, it is significantly more complex.
global script Active{
void run(){
while(true){
UpdateFlowers();//Handles the flowers->Next stuff.
Waitdraw();
if(OldScreen != Game->GetCurScreen())OldScreen= Game->GetCurScreen();//Save what screen you're on if it changes.
Waitframe();
}
}
}
void UpdateFlowers(){
int i;//Iterative variable.
//The current screen has changed.
if(OldScreen!=Game->GetCurScreen()){
//Reset the array.
for (i = 0; i < 175; i++ ){
ScreenCombos[i]= 0;
if(Screen->ComboD[i]==CT_FLOWERS )ScreenCombos[i]= Screen->ComboD[i];
}
}
//Keep track of all combos.
//If they were flowers and changed, make them the right under combo.
for (i = 0; i < 175; i++ ){
if(ScreenCombos[i] !=0 && Screen->ComboD[i]!=CT_FLOWERS){
Screen->ComboD[i]= ScreenCombos[i]++;
ScreenCombos[i]=0;
}
}
}
The first version of this script wouldn't actually clear the array when the screen changed. So it would register combos from previous screens. This one should work as intended.
It compiled, and I set "const int FLOWER_UNDER_COMBO = 897;" but when I play the quest file and slash flowers I just get combo 0- even when I set the default undercombo to a non-0 number. Maybe I missed a step in setting it up?
Doing something globally means not having to set up an ffc on every screen. But it also means having to cover anything that can possibly happen anywhere in the game.
It sounds like a non-global is simpler. Would it perhaps be much easier if I made Flag 98 inherent to my flower combos, and Flag 98 was scripted to say that:
(Example 1A)
when this combo changes it becomes [next combo in the list]
or:
(Example 1B)
when this combo is slashed it becomes [next combo in the list]
another option would be:
(Example 2A)
if this is combo [insert combo number here] when it changes it becomes [insert combo number here]
if this is combo [insert combo number here] when it changes it becomes [insert combo number here]
if this is combo [insert combo number here] when it changes it becomes [insert combo number here]
or:
(Example 2B)
if this is combo [insert combo number here] when it's slashed it becomes [insert combo number here]
if this is combo [insert combo number here] when it's slashed it becomes [insert combo number here]
if this is combo [insert combo number here] when it's slashed it becomes [insert combo number here]
1A and 1B would be automated to find the right undercombo, but if we went with 2A or 2B I wouldn't mind if I had to keep adding and filling out cases in the script.
Edited by Cukeman, 17 April 2016 - 01:14 AM.