Jump to content

Photo

What is A1: and A2: and D0: through D7: In Freeform Combos please?


  • Please log in to reply
2 replies to this topic

#1 LikeLike888

LikeLike888

    Spicy food lover!!

  • Members
  • Real Name:Jason
  • Location:North America

Posted 12 August 2018 - 07:56 PM

Thank you and please give me a code example of A1: and A2: working as well as D0: through D7: working.



#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

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 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

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. 



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users