HELP - Checking if a Number is equal to an objects Spawn Order

Discussion in 'Halo and Forge Discussion' started by IC Entropy, Dec 20, 2016.

  1. IC Entropy

    IC Entropy Forerunner

    Messages:
    14
    Likes Received:
    1
    I have a bunch of gates (brains with an boundary) with different spawn orders, just like in the race gametype. I want to set a global channel, say Global:Golf to a value (3), and then have all the gates watching for Number:Change on Global:Golf. If they see that number now equals their Spawn Order, they do something. I could not figure out how to compare to their spawn order.

    As a test, I tried taking of my gates and setting it so when a player enters the boundary, it does: Number:Change > Object > Set > Game Value> Spawn Order> THIS. I thought this would set the Object:Number of my gate brain to the Spawn Order of my gate brain.
    I then set up a WHEN - Number:Check > Object > Equals > Constant > 10 DO - Play a sound.
    I set the Spawn Order to 10 in the properties.
    I then walked in to the boundary and didn't hear any sound.

    As a more general additional question, does Number:Change fire every time a number actually changes value, or every time its re-written? i.e. If I'm setting Global:alpha to 3 every 2 seconds, and I have some other action that is watching that channel, will that other action trigger every 2 seconds?
     
  2. ExTerrestr1al

    ExTerrestr1al Forerunner
    Senior Member

    Messages:
    2,387
    Likes Received:
    2,515
    You can number check for a different constant for each brain. it doesn't look for a match on spawn order num, but you can set each respective constant in each brain to match the num you want, which is the spawn order.

    Good luck!
     
  3. IC Entropy

    IC Entropy Forerunner

    Messages:
    14
    Likes Received:
    1
    I figured this out based on the KotH gametype. You can get your random number and then store it in the Object:Number of the brain. This field is basically a temp variable. You then use that same brain to send a Message and pass THIS. The gates all watch that Message channel and when they see a message come in they all despawn. Then they check their Spawn Order against the Activator (the brain that sent the Message) and spawn only if the number matches.

    I found the answer to my second question: Number:Change fires every time a number actually changes value, not every time its re-written. i.e. If I'm setting Global:alpha to 3 every 2 seconds, and I have some other action that is watching that channel, that other action will only trigger the first time alpha is set to 3 (assuming it wasn't already 3 from some other reason).
     

Share This Page