Lelouche Vi Britannia
03-14-2016, 10:53 PM
Ok, so I think I finally figured out how the whole counters thing works. Someone stop me if I'm wrong...
While surfing PZC for interesting item and ffc scripts I came across an older weapon script called "Grenades" finding it at least a little interesting I took a closer look at it since it boasted of not needed a global function in order to do its job. Then I noted the counter comment... "By default, the grenade will use up bombs, but you can edit the CR_GRENADES constant to make it use another counter instead."
So I looked at the code. Low and behold, I see the line...
const int CR_GRENADES = 2;
Making a few assumptions I checked the order of the counters listed in ZQuest and saw the order of the first three being Life, Rupees, and Bombs respectively. Based on what I read, if I'm following this correctly... Counters follow as 0 = Life, 1 = Rupees, and 2 = Bombs... therefore 3 = Arrows, 4 = Magic, 5 = Keys, and 6 = Super Bombs. So counters 7+ then refer to scripts 1 through 25 (7 = S1, 8 = S2, etc up to 31 = S25).
So my new assumption is now that if I use the line...
const int CR_POTIONA = 7;
then I can create a unique counter reference for the item and it should in theory work like normal (counting up by the indicated amount in the item editor when an item is picked up, and reduced by 1 whenever the item is used).
Are my assumptions correct? Is there anything I'm missing?
While surfing PZC for interesting item and ffc scripts I came across an older weapon script called "Grenades" finding it at least a little interesting I took a closer look at it since it boasted of not needed a global function in order to do its job. Then I noted the counter comment... "By default, the grenade will use up bombs, but you can edit the CR_GRENADES constant to make it use another counter instead."
So I looked at the code. Low and behold, I see the line...
const int CR_GRENADES = 2;
Making a few assumptions I checked the order of the counters listed in ZQuest and saw the order of the first three being Life, Rupees, and Bombs respectively. Based on what I read, if I'm following this correctly... Counters follow as 0 = Life, 1 = Rupees, and 2 = Bombs... therefore 3 = Arrows, 4 = Magic, 5 = Keys, and 6 = Super Bombs. So counters 7+ then refer to scripts 1 through 25 (7 = S1, 8 = S2, etc up to 31 = S25).
So my new assumption is now that if I use the line...
const int CR_POTIONA = 7;
then I can create a unique counter reference for the item and it should in theory work like normal (counting up by the indicated amount in the item editor when an item is picked up, and reduced by 1 whenever the item is used).
Are my assumptions correct? Is there anything I'm missing?