Halo 5 Scripting Infodump

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

  1. Hardcore Hero

    Hardcore Hero Legendary

    Messages:
    25
    Likes Received:
    15
    Just choose the right combination of directions to get the angle you want, and have the right ratio of distances, for example 1:1 if you wanted a piece to move at a 45 degree angle
     
  2. itsmyyard

    itsmyyard Ancient
    Senior Member

    Messages:
    70
    Likes Received:
    3
    Thanks Turb, just looked at it, should come pretty handy, thank you!
     
    TurbTastic likes this.
  3. xxBRYTExx

    xxBRYTExx Ancient
    Senior Member

    Messages:
    495
    Likes Received:
    93
    What is the purpose of the scripting brain? I dont understand what it does
     
  4. itsmyyard

    itsmyyard Ancient
    Senior Member

    Messages:
    70
    Likes Received:
    3
    I'm having an issue with terminals warping to where they originally spawn when creating them when I want them in a completely different spot, moving them causes the scripts to not work at all, is that a known issue?
     
  5. Hardcore Hero

    Hardcore Hero Legendary

    Messages:
    25
    Likes Received:
    15
    Hmm, I'm not sure if it is a known issue. But sounds like the FX issue, and the work around I have come up with for that is to move it right next to the location you want it at, then duplicate so that it lands right where you want it.
     
  6. itsmyyard

    itsmyyard Ancient
    Senior Member

    Messages:
    70
    Likes Received:
    3
    From what I can tell, as long as I deselect it with LB and not any other method, it won't warp back when its in the right spot, hasn't happened since I've worked it out.
     
  7. DrSammyD

    DrSammyD Forerunner
    Senior Member

    Messages:
    46
    Likes Received:
    11
    It's the only object which can and more than one condition. e.g. If alpha and bravo, then turn on charlie
     
  8. xxBRYTExx

    xxBRYTExx Ancient
    Senior Member

    Messages:
    495
    Likes Received:
    93
    understood thanks
     
  9. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    There is a problem with this setup as you described. The second timer despawns at the start of the first round as it does for all subsequent rounds. Its respawn then precedes that of the first timer and tells the object to despawn eight seconds early during the first round. Did you, perhaps, leave something out of the description for your setup?
     
  10. cookies4you

    cookies4you Halo 3 Era
    Senior Member

    Messages:
    178
    Likes Received:
    93
    False. That's just the On Message/Power Multi condition, which allows an object to hold 4 conditions in a single script. The actual purpose of a Scripting Brain is that it's convenient. For one, it's invisible and it has its own unique model, making it stand out.

    Also, I've made an addition to the list, being Scripting Order. Some of you guys might find it interesting, and it should help avoid logic errors for more complicated scripts.
     
  11. NOKYARD

    NOKYARD GrifballHub
    Cartographer Forge Critic Senior Member

    Messages:
    858
    Likes Received:
    1,365
    I finally got the staggered start script working properly once i decided to ditch the redundant Round Start switch object.

    Here's my solution in pic form:

    Alpha Channel triggers the action scripted into each wall piece to drop it into position.

    At Match Start turn Bravo Off
    [​IMG]

    At 6 seconds Send Message Delta
    [​IMG]

    At 14 seconds Send Message Charlie
    [​IMG]

    Script 1 If Bravo is On (round start), Send Message Alpha when Delta is Received
    [​IMG]

    Script 2 If Bravo is Off (match start), Send Message Alpha when Charlie is Received
    [​IMG]

    Be sure Bravo is on for the next round.
    [​IMG]

    Hopefully the script works in laggy games, but if not the entire court is surrounded by invisibarriers.

    Here's the video
     
    #31 NOKYARD, Dec 31, 2015
    Last edited: Dec 31, 2015
  12. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    As usual, I attempted an overly complicated method and overlooked a simple, elegant one. Thank you for your contribution, good sir. :)
     
    NOKYARD likes this.
  13. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    I did go back and adjust some things a little bit. Final setup:

    Dummy Timer Object 1:
    NO CHANGE

    Dummy Timer Object 2:
    Respawn On Deletion @ 25 seconds
    On Match Start, Spawn
    On Round Start, Despawn
    On Spawn, Power Set Alpha On
    On Match Start, Spawn
    (Sends Despawn command right away first round, delayed later rounds)
    ADDED LAST SCRIPT - I think since it's a later sequence the Match Start command occurs after the Round Start command. I think the first script is not needed but I didn't want to poke the bear.

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

    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
    On Message Received Bravo, Spawn
    CHANGED LAST 2 SCRIPTS - to Receive Message

    This is how I got Mongoose Sumo to work.
     
  14. NOKYARD

    NOKYARD GrifballHub
    Cartographer Forge Critic Senior Member

    Messages:
    858
    Likes Received:
    1,365
    I find it best to speak the script out loud. I also cleaned up the scripting objects. [​IMG] The timings to close the wall behind Breakout launch starts is 8 and 16 seconds.
     
  15. buddhacrane

    buddhacrane Ancient
    Senior Member

    Messages:
    1,204
    Likes Received:
    116
    Do you need that very first Script to turn Off Bravo channel?! Shouldn't it already be classed as Off at the beginning of a game anyway? Might be able to save yourself a Script there ...

    You've also just highlighted something that I didn't know about the new Scripting. So Power States of Channels carry across Rounds - was this the case in MCC? In MCC I thought that if a Channel was On, it would reset itself back to Off at the beginning of a new round. I've just been assuming that a new round always resets everything back its original state ... hmmm ...
     
    Yumudas Beegbut likes this.
  16. NOKYARD

    NOKYARD GrifballHub
    Cartographer Forge Critic Senior Member

    Messages:
    858
    Likes Received:
    1,365
    I typically assign a value when i declare a variable, whether it needs it or not. It makes for cleaner reading, easier to understand code for people who look at it later.

    The script did not work properly in round 2 without the pig script.
     
  17. buddhacrane

    buddhacrane Ancient
    Senior Member

    Messages:
    1,204
    Likes Received:
    116
    Fair enough. I do absolutely the same thing when coding for real, but in the world of Forge's Scripting I'm very wary of the fact we have Object, Script, and Channel limits, so I always favour the solution that uses up the least of those limits. To each their own :)

    So in that vain, I decided to have a go at messing around with this particular "Consistent Round Timer" scenario myself - if nothing else, just to have an excuse to mess about with the Scripting a little more! I've come up with a different solution:


    Part 1: Match Start Timer

    This Timer will only activate once, when the Match first starts. Just the one Script required.

    Script 2
    Condition: On Timer
    - Initial Delay: 16
    - Repeat Timer: 0
    Action: Message Send
    - Channel: Alpha
    Description: 16 seconds into the match, a message is sent to Alpha.
    [​IMG]


    Part 2: Subsequent Rounds Timer

    This Timer will only activate on additional rounds. A respawnable object and 3 Scripts are required - I've used a single Invisible Blocker to contain the whole lot (including the Timer from Part 1).

    Script 1:
    Despawn:
    - On Timer: On
    - Timer: 8
    Condition: On Destroyed/Despawn
    Action: Message Send
    - Channel: Bravo
    Description: 8 seconds into the start of every round, a message is sent to Bravo.
    [​IMG]

    Script 3:
    Condition: On Message Received
    - Channel: Alpha
    Action: Power Set
    - Channel: Alpha
    - State: On
    Description: After the "Match Start" Timer has activated, the Alpha channel will be turned On.
    [​IMG]

    Script 4:
    Condition: On Message/Power Multi
    - Minimum to Trigger: 2
    - Condition 1: On Power, Alpha, On
    - Condition 2: On Message, Bravo
    Action: Message Send
    - Channel: Alpha
    Description: When the 8 second Timer activates, and only after the "Match Start" Timer has also activated, a message is sent to Alpha. This means that this Script only sends a message to Alpha 8 seconds into subsequent rounds.
    [​IMG]

    For the object that you want to have use these timers, make use of the "On Message Received: Alpha" Condition.

    Summary Info:
    - Objects used: 1 (The Invisible Blocker)
    - Scripts Created: 4
    - Message Channels Used: 2 (Alpha and Bravo)
    - Power Channels Used: 1 (Alpha)

    Note: It's actually possible to tweak this slightly to use one less Script, but it enters the realms of "voodoo script science" by leveraging a quirk in the behaviour of the "On Message/Power Multi" condition when sharing message and power channels, so I figured it best to just save you all the headache for the sake of one Script budget, lol!


    Obviously Nokyard's approach works too, but you can save yourself some Objects, Scripts, and Channels if you do it this way; whichever is more comfortable for you, just figured I'd give people options.


    Edit: I also have a more robust/complicated version of this Script (requires more Channels and Scripts), for handling the scenario where you want a delay that's later into a round and it's possible for the round to end before that delay occurs. Currently, both mine and Nokyard's approaches will go screwy in that scenario. I'll only post the fix for that though if anyone's bothered, because of how much more complicated it is (took me a few hours to figure out the logic for that one).
     
    #37 buddhacrane, Jan 1, 2016
    Last edited: Jan 2, 2016
    Yumudas Beegbut likes this.
  18. NOKYARD

    NOKYARD GrifballHub
    Cartographer Forge Critic Senior Member

    Messages:
    858
    Likes Received:
    1,365
    I tested your script and it works perfectly, with one caveat. My script does not activate in Forge mode, where your script activates 16 seconds in. I prefer to not have scripts run in Forge mode if at all possible so i setup invisible switches to manually test my scripts. In the case of your script all you would have to do is to program the moving parts to reset position on say, a message from Zulu Channel and have an Invisible Zulu Channel Switch off to the side so you can reset the moved pieces and carry on forging after the script runs. Still, you wrote a pretty tight script. I never thought it could be done with only 2 scripting items.

    I tested both scripts by placing Flag Spawn and Capture plates right where you land after the launch to simulate the fastest rounds possible, both scripts function properly if the round ends immediately after the start.
     
  19. buddhacrane

    buddhacrane Ancient
    Senior Member

    Messages:
    1,204
    Likes Received:
    116
    @NOKYARD Yeah, I agree that sometimes Scripts running in Forge can be a pain. The Scripting puzzle I'm currently working on is a right nightmare to Forge because of it, lol. We could do with a "Toggle Scripts: On/Off" Option in Forge ... *Goes to add it to the Scripting Feedback Thread*

    With the specific delays that we've used in our examples there is indeed no issue with rounds ending immediately - that's because the delays in the Scripts kick off soon enough. If you extended their delays though (like someone else might do if they wanted to re-use this Scripting logic for their own nefarious purposes, lol), and then had the first round end before those delays have a chance to fire, then you'd get the following behaviour in the second round:

    With your Script:
    The First Timer would kick off in the second round, instead of the Second Timer, because your "Make sure Bravo is On next round" Timer never had a chance to activate in the first round.

    With my Script:
    The First Timer would activate after its Delay finishes, based on what's still remaining on its delay, e.g. if the Timer delay was 30 seconds, and the first rounded ended 20 seconds in, then the timer would go off 10 seconds into the second round. The second Timer would also activate, as it does normally in the second round.


    When I was testing it, I setup a Slayer gametype with multiple Rounds, a Score to win of 1, and made Suicides give me 1 point. Doing that allowed me to control exactly when I wanted rounds to end, to test all the different scenarios.

    As I mentioned in my edit, I do have a version of my script that handles this scenario, but it uses up 3 more Scripts, 1 more Power Channel, and 1 more Message Channel. I can post it if you're curious; but it basically involves creating new, separate Scripting logic that works out whether it's the second round or not (Toggling power at Round Start - First toggle turns power On, then second toggle turns it Off, use a condition for the Off state to flag that the second round has started via another Power Channel), and then modifying the conditions on the Scripts that decide whether to send a message to Alpha or not, to hook into that new logic - simples!
     
  20. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    Someone may find this useful. Whenever I have objects despawning, moving, or rotating, I like to setup a Message Received Zulu on them to respawn/reset on the last script. Then I hide a switch on the map that sends a message on Zulu to get everything back to normal. Whenever you're all done you can get rid of the Zulu stuff.
     

Share This Page