Thank you and please give me a code example of A1: and A2: working as well as D0: through D7: working.
What is A1: and A2: and D0: through D7: In Freeform Combos please?
Started by
LikeLike888
, Aug 12 2018 07:56 PM
2 replies to this topic
#1
Posted 12 August 2018 - 07:56 PM
#2
Posted 12 August 2018 - 10:36 PM
ffc script Args{ void run(int d0, int d1){ // D0~D7 go here (in order) Trace(d0); Trace(d1); } }D0 through D7 are arguments that are passed to either a ffc or item script.
A0, A1 you should not use.
#3
Posted 19 August 2018 - 05:01 AM
Thank you and please give me a code example of A1: and A2: working as well as D0: through D7: working.
A0 and A1 were only used by ASM scripts. I hojestly don't recall if they were instruction args, or if they were intended for something else.
They date back to ZC 2.11, and I have never once seen anyone use them, including people who used ASM scripts.
As Gleeok said, D0 through D7 are your data args on the run() line.
ffc script foo { void run(int a, int b, int c, int d, int e, int f, int g, int h) { //Do stuff if ( Link->Item[a] ) { Game->PlaySound(b); Game->MCounter[c] = d; Game->Counter[c] += e; if ( f > 0 ) { for ( int q = 0; q < f; ++q ) { npc n = Screan->CreateNPC(g); n->X = this->X + Rand(0,h); n->Y = this->Y + Rand(0,h); } } } } }D0 would equate to 'int a', D1 to 'int b', up through D7, which would be 'int h'.
They're the first eight parameters of the run() function, in sequential order, so:
D0 (a) : The item to check. D1 (b) : The sound effect to play. D2 (c) : The counter type to increase. D3 (d) : The MCounter increase value. D4 (e) : The Counter value to give to Link. D5 (f) : The number of npcs to spawn. D6 (g) : The npc ID -- we will spawn (f) number of npc (g). D7 (h) : The number of pixels of distanc eto randomise their spawn from the ffc.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users