Halo 5 Scripting Help

Discussion in 'Halo and Forge Discussion' started by Fred E 104 SII, May 28, 2017.

  1. Fred E 104 SII

    Fred E 104 SII Legendary

    Messages:
    15
    Likes Received:
    7
    Would anyone be willing to come look at a script on Halo 5 for me I am literally stuck it has to do with object entering a boundary.

    My gt is Fred E 104 SII
     
  2. Studbeasttank

    Studbeasttank Legendary

    Messages:
    84
    Likes Received:
    212
    I could maybe help you out right now. What sort of object? and how often do you want the object to enter the boundary, and what do you want it to do once it enters?
     
  3. Fred E 104 SII

    Fred E 104 SII Legendary

    Messages:
    15
    Likes Received:
    7
    Flag and not that often, make a global sound effect
     
  4. Studbeasttank

    Studbeasttank Legendary

    Messages:
    84
    Likes Received:
    212
    Okay, this is a pretty quick rundown, but it should work. I'm assuming that only one team is bringing the flag in to get points.

    First, assign the flag a label. I'd use something like {user:foxtrot} for flag, but if it is the only label you are using {user:zulu} should be fine (it's the easiest label to find, just controller, left).

    Anyway, you'll want a script brain. have it send a message on a timer (you can choose, 0.1 seconds is the fastest). This will tell your boundary how often to check for the flag to enter.

    Now, the object with the boundary. You'll want a script stating that when it spawns, it sets it's number to 0.

    On: Spawn
    Action 1:
    Number Change
    Scope: Object
    OBJECT: THIS​
    Operation: Set,
    Source: Constant
    0
    That sets the object to have a base state. We want a script to change this base state.

    On: Message: Channel: {Timer}
    Action 1:
    Number Change:
    Scope: Object
    OBJECT: THIS​
    Operation: Set
    Source: Constant
    0​
    Action 2:
    Number Change:
    Scope: Object
    OBJECT: THIS​
    Operation: Decrement
    Source: Object Count
    Players [Add]
    Label [Include]
    {flag label}​
    Boundary: THIS [include]
    Select First: 1​
    0
    Condition Interrupt, Round interrupt, and Always run are set to Off.

    The first action resets the objects value to 0 when there is no flag in it, the second action sets the object's value to -1 when a flag is in it. Pay attention to the object count modifiers (make sure [add]s are [add]s and [include]s are [include]s.

    You'll want another script that does a number check on the boundary object, and on result of -1 you can have it change the score (

    score change:
    Team
    Team {x}[add]​
    Operation: Increment
    Source: Constant
    Value: 1
    )

    and do other things like send a message, or play a global sound effect (just have play sound as an action, and do players: [add] as the only modifier, and chose the sound.

    You will need additional scripts do despawn and respawn the flag, but those shouldn't be to hard.

    Hope that helps!

     
    ExTerrestr1al likes this.
  5. Fred E 104 SII

    Fred E 104 SII Legendary

    Messages:
    15
    Likes Received:
    7
    It also needs to be neutral not team based.
     
  6. Studbeasttank

    Studbeasttank Legendary

    Messages:
    84
    Likes Received:
    212
    Okay, what I've done is have two script brains with overlapping boundaries. The script I already wrote above goes on one brain, and detects the flag, while this one detects a player. On the first script, have a number check where -1 sends a message on channel {flag}.

    On: Message: Channel: {Timer}
    Action 1:
    Number Change:
    Scope: Object
    OBJECT: THIS​
    Operation: Set
    Source: Constant
    0​
    Action 2:
    Number Change:
    Scope: Object
    OBJECT: THIS​
    Operation: Increment
    Source: Object Count
    Players [Add]
    Team[Include]
    team 1 (defender)​
    Dead[exlude]
    Boundary: THIS [include]
    Select First: 1​
    0
    Action 3:
    Number Change:
    Scope: Object
    OBJECT: THIS​
    Operation: Decrement
    Source: Object Count
    Players [Add]
    Team[Include]
    team 2 (Attacker)​
    Dead[exlude]
    Boundary: THIS [include]
    Select First: 1​

    0
    On this new brain have three number check scripts, where a state of 1 (red team in) turns power channel {red} ON and power channel {blue} off. a state of -1 (blue team in) does the opposite. Finally, a state of 0 (no team in boundary or both teams in[blocking a capture]) sets both {red} and {blue} to OFF.

    Finally, there is a scoring brain. that has two message/ power multi scripts. the first one increments red score when:

    message recieved {flag} and {red} is on,

    and a second script that does the same for blue.

    In order to prevent constant scoring, you'll have to despawn the flag when it enters the boundary (after scoring), or have the {flag} script brain run on a different timer.
     

Share This Page