Halo 5 Scripting Infodump

Discussion in 'Halo and Forge Discussion' started by cookies4you, Dec 18, 2015.

  1. cookies4you

    cookies4you Halo 3 Era
    Senior Member

    Messages:
    178
    Likes Received:
    93
    Now that I've spent some time with Halo 5's Forge, I think it's time for another one of these threads. When I come back tomorrow, I'll update it with more information and work on making sense.

    General Terminology:
    - A, B, C... Z : Halo 5's scripting channels, which go from Alpha to Zulu.
    - 1, 0, T : 1 and 0 refer to the power states of a channel, being on and off. T stands for toggle.
    - @ : Stands for message.
    - & : The "Minimum to Trigger" counter for the "Multi" condition.
    - Event : Special conditions that do not rely on variables.

    Important Terminology: Channel, Power, Message
    A channel runs from <A> to <Z>.

    A channel's power state can be 1 or 0, default at 0. Scripts can use this data for their conditions, and unlike H2A, they can detect both 1 and 0 states.

    A channel message is like a signal.

    Condition-Based Scripting:
    Halo 5's scripting is based on conditions and actions. I'll be using the following form for scripts:

    (Condition) {Action}

    When the condition is true, then the action occurs. Let's look at an example:

    (A = 1) {B = T}

    All this means is that if (channel <A> is powered on) then {channel <B> will be toggled}.

    Events and Send/Receive Message:
    We have the (<A> = 1, 0, T) as options for the power state condition. We know what 1 and 0 are, but you may be wondering, how does T work? Well, T is a special kind of condition I like to call an event.

    Events are conditions that do not rely on existing variables, but rather, trigger on actions. For instance:

    (A = 1) triggers when channel A becomes 1.

    (A = T) triggers whenever channel A is changed.

    As an added note, all messages, denoted as @, are events.

    (A = @) {B = @}

    This translates as if (channel A receives a message), then {send a message to channel B}.

    On Message/Power Multi Condition:
    I'm calling it the Multi condition for short. When you choose it, you're given 5 inputs: "Minimum to Trigger" aka &, and "Condition 1-4". All #& means is that for the action to occur, at least # number of conditions must be true. Here's an example:

    (& = 4;A = 1;B = 1;C = 1) (<D> = 1) {E = 1}

    Starting from the beginning, you need at least 2 conditions to be true in order for the action to occur, which will set channel E to 1.

    If A = 1, B = 0, C = 0, and D = 0, then the action {E = 1} will not occur. But if any of the variables at 0 become 1, then the action will occur.

    Event Condition Action Scripting:
    The Multi condition allows normal conditions to be mixed with events.

    (& = 4;A = $;A = 1;B = 1;C = 1) {D = 1}

    If A receives a message and the following are true: A = 1, B = 1, and C = 1, then D = 1.

    Scripting Order:
    Scripts check through all conditions first, and then activate actions. In other words, the order of your scripts do not matter. As for how it's relevant, here's an example:

    Initial Conditions : A = 1, B = 0, C = 0
    Script 1 : (A = 1) {B = 1}
    Script 2 : (& = 2;A = 1;B = 0) {C = 1}

    Here's what happens:

    0. B and C begin at 0.
    1. A becomes 1.
    2. Script 1's conditions are checked.
    3. Script 1's conditions are met.
    4. Script 2's conditions are checked.
    5. Script 2's conditions are met.
    6. Script 1's actions occur, setting B to 1.
    7. Script 2's actions occur, setting C to 1.

    As such, the order of your scripts do not matter. If it did, here's what would've happened.

    1. Script 1's conditions are checked.
    2. Script 1's conditions are met.
    2. Script 1's actions occur, setting B to 1.
    3. Script 2's conditions are checked.
    4. Since B is 1, Script 2's conditions are not met.
    5. Script 2's actions do not occur.

    As for the actual order for condition checks and actions, Script 1 goes first, then Script 2, etc. I'll have to test the global hierarchy later, but I presume that older scripts are prioritized. As for the implications, it doesn't actually matter. Although it'll come into play if you have overlapping actions such as {A = 0} for one script and {A = 1} for another script with the same conditions, that kind of thing is a logic error, meaning you should probably clean it up for efficiency's sake.

    Other Trivia:
    - Most objects can hold scripts. The limit is 7 scripts per normal objects.
    - Thanks to the Multi condition, you can have up to 4 conditions per script.
    - You can only have 1 action per script.
    - Certain objects have the "Interact" condition, most notably Switches.
    - When using the "Move" action, objects normally move according to their angle. If the "Local" option is disabled, they will ignore their angles and move according to the absolute XYZ axis.
     
    #1 cookies4you, Dec 18, 2015
    Last edited: Dec 29, 2015
  2. cookies4you

    cookies4you Halo 3 Era
    Senior Member

    Messages:
    178
    Likes Received:
    93
    Did some small updates and expanded on Events.
     
  3. NOKYARD

    NOKYARD GrifballHub
    Cartographer Forge Critic Senior Member

    Messages:
    858
    Likes Received:
    1,365
    Question.

    I can script an event to happen at the start of each round.
    I can script an event to happen after a 13 second delay.
    How can i combine them so the event happens 13 seconds after the start of each round?

     
    IKL Dead Man likes this.
  4. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    At the start of a round, spawn an object with a despawn timer of 13 seconds. Set that object to send a message upon despawn. This will act as a timer which counts down each round and triggers your event.
     
  5. cookies4you

    cookies4you Halo 3 Era
    Senior Member

    Messages:
    178
    Likes Received:
    93
    I'll try in a bit, but you may have to use some despawning here.

    (Condition) {Action}

    Object 1
    - (Round Start) {Alpha = On}

    Object 2
    - (Alpha = On) {Spawn}
    - (Timer with 13 second delay) {Put your action}
    - (Timer with 14 second delay) {Alpha Off}
    - (Alpha = Off) {Despawn}

    (Some stuff like turning off Alpha may be completely unnecessary, but I've heard from someone that new rounds are broken with object spawning. If it's not, then you don't need the last two scripts, you can just have it so that Object 2 doesn't spawn at start. Furthermore, you an replace both Alpha = On with Alpha = Message for Object 1 and Object 2)

    Edit. Welp, Duck had a better solution.
     
  6. NOKYARD

    NOKYARD GrifballHub
    Cartographer Forge Critic Senior Member

    Messages:
    858
    Likes Received:
    1,365
    The item HAS to be a Space Whale, right?
     
    Redy likes this.
  7. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    Well, obviously. I thought that went without saying.
     
    Redy likes this.
  8. NOKYARD

    NOKYARD GrifballHub
    Cartographer Forge Critic Senior Member

    Messages:
    858
    Likes Received:
    1,365
    This worked. Thanks!

    The only issue is that Game Start and Round Start are different timers, so i will have to make an Alpha script for game start and a Bravo script for round start.
     
    Psychoduck likes this.
  9. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    Did you use the Despawn settings or a Despawn script? The Despawn on Timer setting built into the objects hasn't been cooperating for me.
     
  10. NOKYARD

    NOKYARD GrifballHub
    Cartographer Forge Critic Senior Member

    Messages:
    858
    Likes Received:
    1,365
    The despawn settings worked fine but may be unreliable in a laggy game. I will also try the script.
     
  11. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    I got it working for my map, but I'm trying to get something to despawn 20 seconds into each round. The first round has 13 seconds of loading time and subsequent rounds have 5 seconds of loading time, so they occur at a different time the first round as opposed to later rounds. Any ideas on how to address? I'm guessing it would involve On Match Start in some way.
     
  12. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    It's pretty simple. The only complication is that the round start timer will preempt the match start timer during the first round. So, I recommend creating two of the objects you want to spawn and using position move trickery to make things work.
    • Timer 1
      • Respawn timer: 33
      • Script 1
        • Condition: On match start
        • Action: Despawn
      • Script 2
        • Condition: On spawn
        • Action: Power set
        • Channel: Alpha
        • State: On
      • Script 3
        • Condition: On despawn
        • Action: Power set
        • Channel: Alpha
        • State: Off
    • Timer 2
      • Respawn timer: 25
      • Script 1
        • Condition: On round start
        • Action: Despawn
      • Script 2
        • Condition: On spawn
        • Action: Power set
        • Channel: Bravo
        • State: On
      • Script 3
        • Condition: On despawn
        • Action: Power set
        • Channel: Bravo
        • State: Off
    • Spawning object 1 (first round)
      • Script 1
        • Condition: On power set
        • Channel: Alpha
        • State: On
        • Acton: Spawn
      • Script 2
        • Condition: On power set
        • Channel: Alpha
        • State: Off
        • Acton: Despawn
    • Spawning object 2 (subsequent rounds)
      • Script 1
        • Condition: On power set
        • Channel: Bravo
        • State: On
        • Acton: Spawn
      • Script 2
        • Condition: On power set
        • Channel: Bravo
        • State: Off
        • Acton: Despawn
      • Script 3
        • Condition: On round start
        • Action: Position Reset
        • Time: 1
      • Script 4
        • Condition: On match start
        • Action: Message send
        • Channel: Charlie
      • Script 5
        • Condition: On message received
        • Channel: Delta
        • Action: Position move
        • Position: Somewhere outside your map
        • Time: 1
    • Timer 3
      • Respawn timer: 2
      • Script 1
        • Condition: On message received
        • Channel: Charlie
        • Action: Despawn
      • Script 2
        • Condition: On spawn
        • Action: Message send
        • Channel: Delta
    Okay, maybe that wasn't quite as simple as I thought. I think this will work, though. Basically, the first round you're spawning in both objects but moving the second outside the map before it actually spawns. In subsequent rounds, you're not spawning in the first object and you're resetting the position of the the second one before it spawns. This is all theoretical, so I'll get back to you once I've tested it out. Technically we are telling the second object to move and reset simultaneously, so that could cause some weird behavior. I'm also not sure if moving an object while it is not spawned in will work. Anyway, I'll run a test and get back to you.
     
    #12 Psychoduck, Dec 22, 2015
    Last edited: Dec 22, 2015
    TurbTastic likes this.
  13. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    Thanks for the suggestion. I tried your setup and it didn't work for me. After I tried reversing the actions for the power states since they seemed backwards and that didn't work either. I had something going with 4 dummy/timer objects, 1 object to despawn, and 2 channels, but it's not quite there.

    Edit: I got it! Pretty clean scripting, but still harder than it should be to do something so simple. I avoided using messages as those have seemed inconsistent at times.

    Dummy Timer Object 1:
    Respawn On Deletion @ 33 seconds
    On Match Start, Despawn
    On Spawn, Power Set Alpha On
    (Despawn command for first round)

    Dummy Timer Object 2:
    Respawn On Deletion @ 25 seconds
    On Match Start, Spawn
    On Round Start, Despawn
    On Spawn, Power Set Alpha On
    (Sends Despawn command right away first round, delayed later rounds)

    Dummy Timer Object 3:
    Respawn On Deletion @ 4 seconds
    On Round Start, Despawn
    On Spawn, Power Set Alpha Off
    On Spawn, Power Set Bravo Toggle
    (Make sure object is there at start of each round and that Alpha is Off)

    Object to Despawn:
    On Match Start, Spawn
    On Round Start, Spawn
    On Power State Alpha Off, Spawn
    On Power State Alpha On, Despawn
    On Power State Bravo On, Spawn
    On Power State Bravo Off, Spawn
     
    #13 TurbTastic, Dec 24, 2015
    Last edited: Dec 24, 2015
  14. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    My scripts here are all theoretical and based on several untested assumptions. So, it's quite possible that it wouldn't work. I think it is on the right track, though. If I have time, I'll look into this some more in the future.
     
  15. cookies4you

    cookies4you Halo 3 Era
    Senior Member

    Messages:
    178
    Likes Received:
    93
    Scripting is broken in general right now.
     
  16. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    See edited post. I got it to work earlier.
     
  17. itsmyyard

    itsmyyard Ancient
    Senior Member

    Messages:
    70
    Likes Received:
    3
    i'm trying to use the TV Monitors to change colours when a switch occurs, essentially a like a buzzer, but it doesn't seem to be working, I know the TV monitors can be any colour so not sure where i'm going wrong.
     
  18. Verses Fatum

    Verses Fatum Ancient
    Senior Member

    Messages:
    190
    Likes Received:
    105
    Can we get a thing for camera's and animations too, those are proving to be very frustrating...
     
  19. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    Download "scripts 1612" in my files, it has a few scripting examples in it and one of them is a really nice TV with a switch.
     
    MstrBlonde and REMkings like this.
  20. darkAssassinDRC

    darkAssassinDRC Legendary

    Messages:
    5
    Likes Received:
    0
    anyone know how to make objects move on an angle?
     

Share This Page