User Tag List

Results 1 to 3 of 3

Thread: Possible Epiphany!

  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,109
    Level
    11
    vBActivity - Bars
    Lv. Percent
    44.95%

    Lightbulb Possible Epiphany!

    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...
    Code:
    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...
    Code:
    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?
    Last edited by Lelouche Vi Britannia; 03-14-2016 at 10:54 PM. Reason: Math fail
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

  2. #2
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,958
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.09%
    Yep. Mostly. If I'm understanding you correctly.

    Game Counters starting at CR_SCRIPT1 just means that they aren't used internally for anything important and scripts are free to do whatever they want with them.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  3. #3
    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,109
    Level
    11
    vBActivity - Bars
    Lv. Percent
    44.95%
    It worked but as they are bare bones, I had to tell it how to use itself in the code for the item. I 've made a few custom counters since this thread opened. Still not an expert but definitely wiser now.
    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