Or you could place a combo/FFC with a "Freeze all movement" combo type.
Right?
Posted 04 December 2012 - 06:41 PM
Posted 04 December 2012 - 07:09 PM
Posted 01 May 2013 - 10:20 AM
Posted 13 July 2014 - 07:07 AM
cant seam to import this file do i need to compile it?
Posted 13 July 2014 - 08:58 AM
Posted 13 July 2014 - 12:11 PM
thankyou, it works now
Posted 19 August 2014 - 10:34 PM
Posted 20 August 2014 - 07:27 AM
I love you...
Posted 20 December 2016 - 02:43 PM
This is something that I noted was happening with one of my scripts whenever I used the functions RunFFCScript or RunFFCScriptOrQuit.
Whenever I used an item script to launch an ffc, if that ffc's script had settings to its TileHeight or TileWidth; there was a chance that the next item script to launch an ffc after the previous ffc no longer existed would retain those values.
The simplest solution that I found to fix this was to do the folllowing.
int RunFFCScript(int scriptNum, float args){ // Invalid script if(scriptNum<0 || scriptNum>511) return 0; ffc theFFC; // Find an FFC not already in use for(int i=FFCS_MIN_FFC; i<=FFCS_MAX_FFC; i++){ theFFC=Screen->LoadFFC(i); if(theFFC->Script!=0 || (theFFC->Data!=0 && theFFC->Data!=FFCS_INVISIBLE_COMBO) || theFFC->Flags[FFCF_CHANGER]) continue; // Found an unused one; set it up theFFC->Data=FFCS_INVISIBLE_COMBO; //Reset the ffc's tile width and height to prevent carryover from earlier scripts. theFFC->TileWidth = 1; theFFC->TileHeight = 1; theFFC->Script=scriptNum; if(args!=NULL){ for(int j=Min(SizeOfArray(args), 8)-1; j>=0; j--) theFFC->InitD[j]=args[j]; } return i; } // No FFCs available return 0; }
From what I can tell, making this change prevents the bug in question from happening.
Edited by ywkls, 20 December 2016 - 02:44 PM.
Posted 21 December 2016 - 01:55 PM
Posted 20 January 2018 - 07:42 AM
There is another issue, and this one is also subtle.
The *Running() functions do not check to see if the ffc is in a state where it can run script code. It returns if a script is assigned, but that is all.
A basic hypothetical situation:
You have a global script that assigns ffc running conditions, halting them by setting their data = 0, and resuming them by setting their data = 1;
You want to use CountFFCsRunning() to determine how many instances of that script are running.
You have three ffcs with that script assigned, with data set to 1; and 4 with data set to 0.
The desired result of CountFFCsRunning(), would be 3, but, it returns 7.
I do not know if anything relies on those functions to return NumFFCsWithScript(int s), but, this is what I would do for these checks:
Edit: A better alternative, is probably an extra definition with a boolean argument, such as CountFFCsRunning(int script, bool only_active), as that would not break any scripts that depend on this quirk.
Posted 23 January 2018 - 01:34 PM
0 members, 1 guests, 0 anonymous users