Jump to content

Photo

Rupees will not go to maximum when I use Potion 3


  • Please log in to reply
4 replies to this topic

#1 LikeLike888

LikeLike888

    Spicy food lover!!

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

Posted 30 July 2018 - 03:24 AM

Here is my script:

 
import "std.zh"
int maximum_money_I_can_have = 255;
bool heal_rupees_in_action = false;
bool w = true;
bool ww = true;
bool www = true;
global script AllINeed
{
  void run()
  {
    while(true)
    {
      if (Link->Item[164] == GetEquipmentB())
      {
        if (Link->PressB)
        {
          while(Game->Counter[CR_RUPEES] < maximum_money_I_can_have)
          {
            Game->Counter[CR_RUPEES] += 1;
            Waitframe();
          }
        }
      }
      Waitframe();
    }
    while(true)
    {
      if (Game->Counter[CR_RUPEES] == maximum_money_I_can_have)
      {
        Link->Item[164] = false;
      }
      Waitframe();
    }
  }
}

in fullness but nothing happens when I use Potion 3 which is Item id 164



#2 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 30 July 2018 - 03:58 AM

"Link->Item[164]" is a boolean, its value will be true or false. "Try GetEquipmentB() == 164" instead.

 

Also note that you have two while(true) loops, the code will never reach the second one.



#3 LikeLike888

LikeLike888

    Spicy food lover!!

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

Posted 30 July 2018 - 04:25 AM

Thank you Jamian! I love you comment.



#4 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2018 - 10:59 AM

Why are you using a global script for that? You should use an active item script:

item script RupeePotion
{
    void run()
    {
        Game->DCounter[CR_RUPEES] = Game->MCounter[CR_RUPEES];   
    }
} 

 
Attach this to a custom item as an active script (in the last tab of the item editor, marked "Scripts", there are two drop-down menus, one that says "pickup script" and one that says "action script", choose this script under "action script".), and make sure that you have "remove item when used" under the "action" tab checked, so that the potion gets removed when you use it. It will always set the Rupee counter to whatever the maximum # of rupees you can carry is.


Edited by Binx, 30 July 2018 - 11:09 AM.


#5 LikeLike888

LikeLike888

    Spicy food lover!!

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

Posted 30 July 2018 - 06:41 PM

Thank ya ;)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users