[TUTORIAL] [SCRIPTING] [HALO5] DECIMAL 0-9 COUNTER

Discussion in 'Halo and Forge Discussion' started by Yumudas Beegbut, Feb 29, 2016.

  1. Yumudas Beegbut

    Yumudas Beegbut Legendary
    Wiki Contributor Senior Member

    Messages:
    393
    Likes Received:
    352
    This tutorial shows how to make a decimal counter that starts at 0 and counts up to 9. You just toggle a power channel (zulu) to have it count. There's also info on how to set decals to display the counter.
    My previous rushed attempt at a counters tutorial was a mess, so I simplified things and made images to make it easier to absorb. Here's what it looks like (hope animated gifs work):
    Counters.gif
    This is Forge footage. Decals don't seem to move in matchmaking.
    There are tons of uses for counters. Time display, countdown timers, hit counts, pseudo scoring, activating game mechanisms (like raining down explosives on the other team's base when three of their pigs are knocked off their pedestals), etc.

    The Decimal (0-9) Counter
    This counter uses 5 scripts and 5 powers channels. More scripts will be needed to display the counter or have events that respond to it.
    0-9-counter-tutorial.png
    Note that you can activate the counter with a Message instead of a Power Channel Toggle. It's possible that two simultaneous toggles will cancel each other out. If you use the Message method instead, make sure you don't use that Channel's Power Settings (bug/feature that might get fixed).

    Display the Counter With Decal Objects
    The display just shows the current number using the decal object (Objects: Extras: Decals I think). Each decal needs 2 scripts, minimum. This sets you back 20 scripts. One script Despawns all the decals whenever the counter is toggled. The second script Spawns the decal that represents the new count.
    0-9-counter-decal-scripts1.png
    Here are Power Channel On/Off settings for the Script 2 for each decal. Hiding them in spoiler tags to avoid information overload.
    0-9-counter-decal-scripts2.png

    Chaining Counters
    To chain a second counter to increment every time the first counter resets to zero, add a script that looks for Counter 1's zero value to occur and respond by toggling its activation power channel (or sending its message). If Counter 1 is set up like above (zulu, delta, charlie, bravo, alpha), then check to see if delta, charlie, bravo & alpha are all turned off and respond by toggling Counter 2's toggle (we'll choose yankee).

    Condition: On Power/Message Multi:Minimum=4 (OnPower:delta:Off) (OnPower:charlie:Off) (OnPower:bravo:Off) (OnPower:alpha:Off)
    Action: {Power:yankee:Toggle}

    You can alternately use the same conditions that reset Counter 1:
    Condition: On Power/Message Multi:Minimum=3 (OnPower:zulu:Toggle) (OnPower:delta:On) (OnPower:alpha:On)
    Action: {Power:yankee:Toggle}

    That's it. Other than having to set up a second counter.

    Hope this one is more helpful. I'll try to update it if needed (0-5 counter for clock's tens digit, etc) or if I can create a nice demonstration course to display Counter uses. Grab a copy of my test maps "COUNTERS ##" (XBL: Yumudas Beegbut) if it'll help.
     
    #1 Yumudas Beegbut, Feb 29, 2016
    Last edited: Feb 29, 2016
    Yekkou, Charybdis, Nitro and 7 others like this.
  2. Xandrith

    Xandrith Promethean
    Forge Critic Senior Member

    Messages:
    4,034
    Likes Received:
    12,012
  3. THE SLAMMERSS

    THE SLAMMERSS Creative Force
    Forge Critic Creative Force Senior Member

    Messages:
    138
    Likes Received:
    253
    Wow....you put a ton of work into this post. Good work!
     
    Yumudas Beegbut likes this.
  4. Captain Punch

    Captain Punch Content Contributor
    Staff Member Administrator Wiki Contributor Senior Member The Scripter's Guild

    Messages:
    130
    Likes Received:
    228
    Didn't expect to find this when I was googling for the name of an electrical circuit to label some logic I was writing up. Well done dude.

    I used a very similar binary clock method to make some defendable territories for Invasion a few months back, but was missing a final piece to make it all work. Never thought to make a clock out of it though. I make have to add that functionality so that the territories have visible counters.

    Got a sneakret for you @Yumudas Beegbut, if you get on that discord I invited you to, that makes counter circuits a lot more channel efficient. It might not be as good for your display, but it definitely would ease behind the scenes counters.
     
    Yumudas Beegbut and Egggnog like this.
  5. PizzaMissile

    PizzaMissile Legendary

    Messages:
    9
    Likes Received:
    3
    Where can I find other great tutorials like this? I'm a beginner and I really want to make some cool stuff, but I'm having trouble with some of my scripts.

    Guides or help would be much appreciated. I've resorted to dissecting maps that do similar things to what I want to figure things out for now
     
    Yumudas Beegbut likes this.
  6. Egggnog

    Egggnog Game Crashers

    Messages:
    267
    Likes Received:
    331
    If you wait patiently for a day or two, Captain Punch and I will release something that might be exactly what you and the rest of the community wants.
     
  7. Captain Punch

    Captain Punch Content Contributor
    Staff Member Administrator Wiki Contributor Senior Member The Scripter's Guild

    Messages:
    130
    Likes Received:
    228
    Nail on the head there, save for the timeframe. You should be able to expect something by the end of this month, though hopefully a bit sooner.
     
    Yumudas Beegbut likes this.

Share This Page