User Tag List

Results 1 to 10 of 11

Thread: Max Item Increase

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    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,961
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.48%
    Quote Originally Posted by Lelouche Vi Britannia View Post
    I haven't tried this yet, but just a quick question if anyone knows the answer.

    I've set up a system were there are 4 types of potions, all with separate counters to keep track of amounts. I've been trying to figure out a way to use one item to increase the max counter size for all 4 of them.

    I'm not sure how to go about this since I don't script often enough to "get good" which means every time I go back to my project, I have to do a little bit of reorienting and relearning. I imagine the functions "Max" and "Max Increment" are used somehow.

    Sorry for being such a noob/pain, but am I anywhere close?

    Code:
    const int CR_POTA = 9;
    const int CR_POTB = 10;
    const int CR_POTC = 11;
    const int CR_POTD = 12;
    
    item script counterpickup
    {
         void run(int countermax, int pustring)
         {
              Game->Max[CR_POTA] == countermax;
              Game->Counter[CR_POTA] == countermax;
              Game->Max[CR_POTB] == countermax;
              Game->Counter[CR_POTB] == countermax;
              Game->Max[CR_POTC] == countermax;
              Game->Counter[CR_POTC] == countermax;
              Game->Max[CR_POTD] == countermax;
              Game->Counter[CR_POTD] == countermax;
              Screen->Message(pustring);
         }
    }
    Game->Counter[] looks correct, but I'm not sure what Game->Max[] does here. I think you meant: "Game->MCounter[]" (M = Max).

    Also you want to use"=" instead of "==" there. "=" to set a value, and "==" to test the values for equality (equals).

    That looks like it should get it working. :)
    Last edited by Gleeok; 02-18-2018 at 07:09 AM.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

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