Jump to content

Photo

I am getting an error when trying to load item script


  • Please log in to reply
2 replies to this topic

#1 LikeLike888

LikeLike888

    Spicy food lover!!

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

Posted 18 January 2018 - 10:26 PM

Here is text for

Get Red Ring.txt

if ( Game->GetCurDMap() == 0 )
{
  ffc script SetInventory
  {
    void run(int 18, true)
    {
        Link->Item[18]=true;
    }
  }
}

^ What do I need to change and do (in specific order please, thank you such as File Save for example) to make Link have Red Ring in DMap 0?

 



#2 Anthus

Anthus

    Lord of Liquids

  • Members
  • Location:Ohio

Posted 19 January 2018 - 12:03 AM

The first line causes an error. I don't know the exact terminology to explain it, but I don't think you can have an 'if' statement first like that outside of the loop in a FFC. Either way, you don't need to worry about setting it for a specific d-map for this. Simply making a FFC that removes, or gives an item if you are on the screen should work just as well. Once Link is given an item, it will stay with him till it is removed by the other script. Just be sure to check the "Run at screen init." flag so it works the second you enter the screen.

 

If you want a script that sees what map Link is on at all times to determine what items he has, you'd need a global, but that seems overly complex for what you seem to be trying to do here.

 

Put this on the first screen where Link will have/ need/ get the Red Ring:

ffc script GiveRedRing
{
    void run()
    {
     Link->Item[18]=true;
    }
}

Put this on the first screen where you don't want Link to have the Red Ring.

ffc script RemoveRedRing
{
    void run()
    {
     Link->Item[18]=false;
    }
}

edit: This will also work with any item, just change the number, should you need something else like this. :)



#3 LikeLike888

LikeLike888

    Spicy food lover!!

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

Posted 19 January 2018 - 12:29 AM

Thank you so highly much :)


  • ShadowTiger and Anthus like this


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users