Lelouche Vi Britannia
03-06-2016, 06:12 PM
So I'm currently looking to use the simple potion script provided in this thread (http://armageddongames.net/showthread.php?95601-Duplicating-an-item-class&highlight=potion+script)... 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...
//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?
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...
//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?