H2A Scripting Examples map

Discussion in 'Halo and Forge Discussion' started by TurbTastic, Dec 28, 2014.

  1. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    File Share of TurbTastic, Map Variants, Scripting Examples

    I created a tutorial map that shows how to do a lot of things with scripting. I've spent dozens of hours playing with scripting so I decided to put this together for those who are still learning. The map is divided into 4 colored sections. Blue for switches, gold for timers, green for triggers, and purple for advanced. The map is available on my file share if interested. If you have any scripting questions or comments on the map let me know!
     
    SecretSchnitzel likes this.
  2. SecretSchnitzel

    SecretSchnitzel Donald Trump
    Forge Critic Senior Member

    Messages:
    2,433
    Likes Received:
    1,885
    Would you be able to help some of us out with advice on how to achieve specific goals with scripting?

    Myself, I'm trying to make an object that spawns in every 90 seconds but despawns 1 second later. This is for a trick with creating a floating power up that can be shot down by players or grabbed in mid-air.

    Thanks.
     
  3. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    That seems possible but I only partially follow what exactly you're going for. One of the maps on my file share had something like that but it was more of a bug on mine. I believe if you set the spawn time on the power up to 90 seconds and the spawn channel to 0, despawn true, and have a Timer Off on broadcast channel 0, then every 90 seconds it will flash for a partial second. If you want to increase the time it's available then you can set the Timer Off to power channel 1, and have a Timer Toggle set to broadcast channel 1 and timer data 1.

    How long could/would the game last? It could be setup entirely with timers with better control, but only feasible if the round is expected to be less than 15 minutes long.
     
  4. SecretSchnitzel

    SecretSchnitzel Donald Trump
    Forge Critic Senior Member

    Messages:
    2,433
    Likes Received:
    1,885
    No, the power up isn't mean to just be there for a second. It spawns every 90 seconds. Period. What I need is an object to spawn underneath it so it doesn't fall (as it's physics are set to normal) but despawn a second later.
     
  5. Citizen Bovine

    Citizen Bovine Promethean

    Messages:
    35
    Likes Received:
    16
    Ah I see what you're saying, I think. Normal physics means that the power will rest on the object holding it and therefore when that object despawns the power up will continue to float (until disturbed). So you need both the powerup and the object holding to spawn at the same time but the object holding the power to despawn a second later because you only need it to "stabilize" the powerup. Do I have that right? Or and I completely wrong about how that works?

    You would want to spawn the object at 89 then the powerup at 90 and despawn the object at 91.
     
  6. SecretSchnitzel

    SecretSchnitzel Donald Trump
    Forge Critic Senior Member

    Messages:
    2,433
    Likes Received:
    1,885
    Correct! Exactly that!
     
  7. Citizen Bovine

    Citizen Bovine Promethean

    Messages:
    35
    Likes Received:
    16
    @SecretSchnitzel The best person to ask (that would know for sure) is @buddhacrane. I'm sure that @TurbTastic can help you out too but I can't vouch for him as I haven't seen his map yet.

    I will say this. It is for sure 100% possible but I just can't tell you exactly how to set it up. Good luck with finding the solution but I'm sure it will be really cool to see.

    The best I can do is this link for now. https://www.youtube.com/user/buddhacrane/videos
     
  8. A Haunted Army

    A Haunted Army Your Local Pessimist
    Forge Critic Senior Member

    Messages:
    416
    Likes Received:
    311
    use the static weapon timers using buddhacranes method and attach the object you want to spawn and despawn to the same timer but set can despawn to true on it so the 1second off once timer will despawn it after it has been spawned.
     
  9. TurbTastic

    TurbTastic Forerunner
    Senior Member

    Messages:
    185
    Likes Received:
    128
    Do you want the power up to fall when that object despawns? I think we can figure this out with about 5 minutes of party chat. I'm on now.
     
  10. buddhacrane

    buddhacrane Ancient
    Senior Member

    Messages:
    1,204
    Likes Received:
    116
    Yeah, the same scripting method I've shown for static weapon timers will also work for what you want.

    Setup the following:
    • TImer: On Once: Broadcast Channel 0, Timer/User Data 10 - This is optional, for if you want the 90 seconds to start when the match begins, after the 10 second Deploying countdown.
    • Timer: On: Power Channel 0 (optional, for if you want to tie it to the Timer: On Once), Broadcast Channel 1, Timer/User Data 90
    • Timer: Off Once: Power Channel 1, Broadcast Channel 1, Timer/ User Data 2
    • Your power-up of choice: Physics Normal, Spawn Channel 1, Can Despawn False, Spawn Time Never, Place at Start False
    • Your power-up platform: Spawn Channel 1, Can Despawn True, Spawn Timer Never, Place at Start False
    So, every 90 seconds Broadcast Channel 1 will turn on, and then 2 seconds later it will turn off again. Your power-up and platform will both spawn in after that 90 seconds (I would position the platform so that the powerup can drop for a little bit before resting, this is so that if the powerup spawns in slightly earlier than the platform then the platform will still catch the powerup).

    2 seconds later Broadcast Channel 1 will turn off. The power-up will not be affected by this (Can Despawn False), but the platform holding up the power-up will despawn (Can Despawn True). Note that I've actually made it a 2 second delay, not 1 second as you requested. This is because objects don't always spawn in instantly (or settle from Normal physics to Floating straight away), so the 2 seconds adds a small buffer for both of those conditions to be met before despawning the platform.

    Finally, if you do decide to float your powerup above the platform (so that it can drop onto the platform) as I've recommended, then you can also place a platform directly underneath the powerup, to hold it in place while in Forge. This is a good trick for when you want floating Normal physics objects that don't drop and despawn while you're in Forge. Simply place the platform below the powerup and set its Spawn Time to Never and Place at Start to False, and leave it like that; this way, in Forge, the powerup will stay in position, but in-game the powerup will drop down onto your other platform as normal.

    Hope that helps!
     
    #10 buddhacrane, Dec 28, 2014
    Last edited: Dec 28, 2014
  11. A Haunted Army

    A Haunted Army Your Local Pessimist
    Forge Critic Senior Member

    Messages:
    416
    Likes Received:
    311

    change your poewrup of choice for item of choice that spawns under the power-up and you'd get the desired effect, can attach the power up to the timer broadcast channel but with can despawn false and you'd have your camo and object spawn in at the same time only after a second the object will despawn leaving the camo in its place.

    need to actually test this though to see if despawning an item from under a power up will leave it floating or cause it to fall.
     
  12. buddhacrane

    buddhacrane Ancient
    Senior Member

    Messages:
    1,204
    Likes Received:
    116
    Very good point, because I just tested it and it doesn't work. As soon as the platform despawns, the powerup continues to fall. I even left the platform there for a good 10 seconds, holding up the powerup, and the powerup still dropped the moment it despawned. It's funny because deleting the platform from underneath the powerup in Forge does work.

    So, er, yeah, bummer...
     
  13. A Haunted Army

    A Haunted Army Your Local Pessimist
    Forge Critic Senior Member

    Messages:
    416
    Likes Received:
    311
    yea just tested it myself, only thing i can think of is to use an on-destroy so you shoot it to destroy that'll depsawn an object and cause it to fall.

    so, you could embed a garage switch into a wall that you shoot at, once thats destroyed that'll despawn say a block 1x1 that's underneath camo causing it to drop.
     
  14. buddhacrane

    buddhacrane Ancient
    Senior Member

    Messages:
    1,204
    Likes Received:
    116
    Indeed. It's not quite as nice as being able to shoot the powerup, but it would do the trick.
     
  15. Citizen Bovine

    Citizen Bovine Promethean

    Messages:
    35
    Likes Received:
    16
    What about phasing the Power Up into an object that is above the power up? Think the letter T where the horizontal is the object and the vertical is the Power Up. Do everything the same except for the physical setup. Can someone try that maybe?
     

Share This Page