How do you guys work with On Timer scripts?

Discussion in 'Halo and Forge Discussion' started by Graybes, Jan 15, 2016.

  1. Graybes

    Graybes Forerunner
    Senior Member

    Messages:
    137
    Likes Received:
    6
    I have an on timer script going on my map that slowly moves my walls inward over the course of the match. Due to the nature of an On Timer script this movement starts automatically after a set period of time.

    My issue is that the script runs automatically in Forge as well. So every time I go into Forge my walls start moving. This messes up my walls starting positions as well when I go to save the map. What's the best way to deal with this so I don't have to keep fumbling with my walls and my script every time I want to make a change to my map?
     
  2. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    Use and gates to create additional required conditions which will not be met in forge mode. Instead of your timers sending messages to the walls and the walls acting on those messages, require multiple conditions to be met. This way, you could flip a switch in forge mode to activate them when necessary, but they will not do so on their own. I believe that turning a power channel on at round start would be an example of a condition which would not be met in forge, but would be met in custom games. Then, hide a switch outside your map which also turns that power channel on so that you may meet the conditions in forge at your own leisure.
     
  3. Graybes

    Graybes Forerunner
    Senior Member

    Messages:
    137
    Likes Received:
    6
    Wait I think I understand what you mean now based on what someone said in another post I asked about this. You two suggested the same things but it finally clicked when I was reading the other post.

    So what I do is this.
    On my walls set a multi condition that the walls only move when I get the message from my script brain that has the timer and when a power channel is set to on.

    On my script brain I have it sending the message on a timer to the walls.

    On another brain I have a power state turned on when round starts.

    So only when both of those things happen the walls will move. And since round start doesn't trigger in forge that means the walls will only move in the custom game.

    Brilliant! Thank you!
     
    #3 Graybes, Jan 15, 2016
    Last edited: Jan 15, 2016
    Psychoduck likes this.
  4. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    If you want a timer to be activated based on a condition other than the start of a round, you can use a dummy timer as described in this video.

    However, that is not necessary for what you are describing. You merely need a setup like this.

    Script Brain
    Script 1
    Condition: on timer
    Initial delay:
    Repeat time:​
    Action: message send
    Channel: alpha​
    Script 2
    Condition: on round start
    Action: power set
    Channel: bravo
    State: on
    Object you intend to move
    Script 1
    Condition: on message/power multi
    Minimum to trigger: 2
    Condition: on message
    Channel: alpha​
    Condition: on power
    Channel: bravo
    State: on​
    Action: move offset
    Switch (for use in forge only)
    Script 1
    Condition: on interaction
    Action: power set
    Channel: bravo
    State: on
    This way, Bravo acts as a control which prevents the multi condition script on your moving object from being met at the start of a forge session. Both conditions will be met in custom games and in forge if you opt to flip the switch.

     
    Graybes likes this.
  5. Graybes

    Graybes Forerunner
    Senior Member

    Messages:
    137
    Likes Received:
    6
    Ah thank you! Looks like I didn't edit my post quickly enough with my revelation haha. Thanks for the detailed explanation though! It all makes sense now!

    So when exactly does round start trigger at the beginning of a custom game? It seems like match start triggers before you even spawn. Does round start trigger when everyone spawns?
     
  6. Graybes

    Graybes Forerunner
    Senior Member

    Messages:
    137
    Likes Received:
    6
    Hey so I just tried this tonight and set up the scripts exactly as you said and it still started moving in forge. I tried round start and match start and it still triggered when I started a forge game.
     
  7. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    Hmm, I'll take a look tomorrow and figure it out.
     
  8. Graybes

    Graybes Forerunner
    Senior Member

    Messages:
    137
    Likes Received:
    6
    Awesome thanks!
     

Share This Page