Jump to content

Photo

My short attempted ffc script will not compile


  • Please log in to reply
2 replies to this topic

#1 LikeLike888

LikeLike888

    Spicy food lover!!

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

Posted 23 February 2018 - 06:47 PM

But I can export it.

 

 

Here is its code that I typed up after I went to

Quest

Scripts

Compile ZScript...

Edit

import "std.zh"
ffc script GetRedRing
if ( Game->GetCurDMap() == 0 )
{
  if ( Game-> GetCurScreen() == 0x00 )
  {
    if ( Link->Item[18] == false )
    {
      Link->Item[18] = true;
    }
  }
}

 

 

 

How do I fix up above code so that my

ZScript will be able to be compiled please? Thanks.



#2 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 23 February 2018 - 07:03 PM

ffc script GetRedRing

A line with a script name always needs an opening curly brace ( { ) afterwards.

 

You'll also need a line below that and before the if statement with

void run(){


#3 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 24 February 2018 - 04:20 AM

As a side note, you can also get rid of the conditions:

 

There is no need to check for the current DMap and the current Screen, since it's an FFC script. Placing it on the screen you want is enough.

 

You can also simply set the item to true without checking if Link already has it, since the code only runs once. You'd only need to perform that check if it was done in a while loop (in order to avoid giving Link an item every frame, which would cause performance issues).


Edited by Jamian, 24 February 2018 - 04:23 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users