I would like to request a script that I can assign to the Screen Flag "General Use 1 (Scripts)"
If Link has Item 51 (Flippers), any onscreen Combo with Flag 99 is advanced to the next Combo in the Combo list.
Thank you for your help.
Posted 12 August 2016 - 01:54 PM
I would like to request a script that I can assign to the Screen Flag "General Use 1 (Scripts)"
If Link has Item 51 (Flippers), any onscreen Combo with Flag 99 is advanced to the next Combo in the Combo list.
Thank you for your help.
Posted 12 August 2016 - 02:02 PM
ffc script FlipperAdvance { void run() { if ((Screen->Flags[SF_MISC] & 100b) != 0 && Link->Item[51]) { for (int i = 0; i < 176; i++) { if (ComboFI(i, CF_SCRIPT2)) { Screen->ComboD[i]++; } } } } }Best to check the Run Script at Screen Init flag so the combo change won't be seen by the player.
Edited by Lejes, 12 August 2016 - 02:58 PM.
Posted 12 August 2016 - 02:03 PM
Edited by cavthena, 12 August 2016 - 02:03 PM.
Posted 12 August 2016 - 02:39 PM
ffc script FlipperAdvance { void run() { if ((Screen->Flags[SF_MISC] & 100b) != 0 && Link->Item[51]) { for (int i = 0; i < 176; i++) { if (ComboFI(i, CF_SCRIPT2)) { ComboD[i]++; } } } } }Best to check the Run Script at Screen Init flag so the combo change won't be seen by the player.
compiling error (variable comboD is undeclared)
Posted 12 August 2016 - 02:58 PM
Posted 12 August 2016 - 03:06 PM
It compiles, but I'm not understanding the implementation.
I thought that by checking the screen flag, the script would run. That's not how the screen flag works?
Posted 12 August 2016 - 03:10 PM
You also have to create a new FFC (Freeform combo) and attach this script to it (after compiling the script and assigning it a FFC script slot of course)
Posted 12 August 2016 - 03:13 PM
Posted 12 August 2016 - 03:16 PM
I would like to request a global then, sorry.
Now I'm curious what good screen flags are.
Posted 12 August 2016 - 03:33 PM
int FlipperAdvance(int prevScreen) { if ((Screen->Flags[SF_MISC] & 100b) != 0 && Link->Item[51] && Game->GetCurScreen() != prevScreen) { { for (int i = 0; i < 176; i++) { if (ComboFI(i, CF_SCRIPT2)) { Screen->ComboD[i]++; } } } } prevScreen = Game->GetCurScreen(); return prevScreen; } global script ActiveFlippers { void run() { int prevScreen = Game->GetCurScreen(); while (true) { Waitdraw(); prevScreen = FlipperAdvance(prevScreen); Waitframe(); } } }This only works on layer 0. That can be changed, though. Screen flags are useful any time you need a script to check a per-room flag. If you wanted to use flag 99 for other purposes on other screens, for example.
Edited by Lejes, 12 August 2016 - 03:51 PM.
Posted 12 August 2016 - 03:47 PM
line: "prevScreen = Game->GetCurScreen();"
(not the global part)
unexpected identifier, expeting $end, on token prevscreen
Edited by Cukeman, 12 August 2016 - 03:47 PM.
Posted 12 August 2016 - 03:51 PM
Posted 12 August 2016 - 04:21 PM
Works better than I imagined! Thank you!
0 members, 1 guests, 0 anonymous users