User Tag List

Results 1 to 3 of 3

Thread: Custom Item Counters

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Octorok Lelouche Vi Britannia's Avatar
    Join Date
    Oct 2015
    Location
    Britannia - Area 11
    Posts
    173
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,113
    Level
    11
    vBActivity - Bars
    Lv. Percent
    46.68%

    Question Custom Item Counters

    So I'm currently looking to use the simple potion script provided in this thread... And I'm looking to implement counters to track the number of specific potions Link is currently carrying. The idea is that there will be 4 potions. Health Potions which restore 6 hearts, magic potions which restore 6 magic containers, restoration potions which restore 6 of each, and the elixir which will restore all and remove jinxes but is limited to 2 uses. I'm trying to create a counter for each of the first 3 potions since they are separate from the elixir (i.e. original in game potion item). This way I can also create a custom item that increases the max carried of these items as well.

    So far all my research into finding out how to make a counter script has failed. I've looked at scripts which seem to make new counters but I'm unable to figure out how it is done. The only script that appears to have this that I've located is "Bait Bag" on PZC. The only references was a rant referencing 2.6 and a much older question of a smiliar vein but this was back in the days of 2.1 ish.

    Bottom line, how do I write a counter script? This can't possibly be that hard.

    EDIT

    Maybe it really isn't. Someone please check my work (and my logic)

    The way I'm seeing it, I have to create an item family for the potion belt or belts. Also, I have to duplicate the potion script mentioned before 3 times to make the specialized potions. I believe I have to declare starting values in the code, or is there a way to do that where I can modify that value for balance purposes later like setting the initial values for starting bombs, etc...

    Code:
    //Initialize counters with intial start values and creates item family for potion belt item
    
    const int CR_HPOT = 2;
    const int CR_MPOT = 2;
    const int CR_RPOT = 2;
    const int IC_PBELT
    
    //Potion Item scripts follow
    
    item script HealthPot
    {
    Void run(int a,int b, int c)
    	{
    	If (a==0){Link->HP+=b;}
    	If (b==0){Link->MP+=c;}
    	If (c==0){Link->HP+=b;Link->MP+=c;}
    	}
    }
    
    
    item script ManaPot
    {
    Void run(int a,int b, int c)
    	{
    	If (a==0){Link->HP+=b;}
    	If (b==0){Link->MP+=c;}
    	If (c==0){Link->HP+=b;Link->MP+=c;}
    	}
    }
    
    item script RestoPot
    {
    Void run(int a,int b, int c)
    	{
    	If (a==0){Link->HP+=b;}
    	If (b==0){Link->MP+=c;}
    	If (c==0){Link->HP+=b;Link->MP+=c;}
    	}
    }
    Also confused on the last part... how do I get one item to affect all three counters?
    Last edited by Lelouche Vi Britannia; 03-06-2016 at 09:00 PM. Reason: Added initial attempt
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social