Need some scripting/despawn help from the pros...

Discussion in 'Halo and Forge Discussion' started by Hillel, Feb 3, 2016.

  1. Hillel

    Hillel Spartan II

    Messages:
    52
    Likes Received:
    28
    I've searched forums for this topic and haven't seemed to find anything specific to the issue I'm trying to resolve, so let me explain what I'm trying to do and see if anyone has any insight because I've tried several things and nothing has worked exactly....

    So I'm working on a minigame that involves rounds in strongholds that basically uses the same concept as the "Avalanche" minigame you may have seen: basically one base strongholds that's 1point to win round, so first one to get to it wins the round.

    What my issue is is that I'm trying to get an energy barrier to despawn after about 5-7 seconds or so after the start of each round. Just using the despawn option on timer isn't working for some reason, so I'm trying to do it with scripting. I've tried several things and have only gotten it to work on the first round. I'm using a Script 1 - "condition=on round start" "action=spawn", Script 2 - "condition=on timer (initial - 20, repeat - 0)" "action=despawn". This seems to work on the first round, but in the second round no despawn. It also seems to me that the despawn time on the first round needs to be compensated for the pre-match cinematics, but not so for the subsequent rounds. In other words, I need the energy barrier to despawn about 5 seconds after each round starts. I've also tried other things like a reset script on round start and also messing with the repeat delay on the timers. I just can't get it to despawn again after the first round. Can anyone help?? Is there a better or more efficient way to go about getting an energy barrier to despawn on a timer at the beginning of every round? Thanks for your input.
     
  2. ThisIsNotTheNSA

    ThisIsNotTheNSA Spartan III

    Messages:
    279
    Likes Received:
    333
    Have you tested the timed despawn in custom games? If it doesn’t work in custom games, then I don’t think timed despawning works at all.
     
    Hillel likes this.
  3. Hillel

    Hillel Spartan II

    Messages:
    52
    Likes Received:
    28
    I got it to work in custom, but it only works the first round. I suppose I could just have the object move instead of despawn, but I feel like if we have the scripting options is should work in theory. I'm not sure the options are necessarily setup to work intuitively with multiple round custom games.
     
  4. Hillel

    Hillel Spartan II

    Messages:
    52
    Likes Received:
    28
    Unfortunately, when it comes to scripting... I almost wanna say that H2A forge works better
     
  5. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    This video covers exactly what you're talking about. You'll simply need the final action of the sequence to despawn the object in question.

     
  6. Hillel

    Hillel Spartan II

    Messages:
    52
    Likes Received:
    28
    Dude, thank you so much. I think this is exactly what I'm trying to do, only with an energy barrier. Can you use any regular object as a dummy timer. I mean, it doesn't have to be the whales, right?
     
  7. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    They don't need to be Space Whales, but they probably should be Space Whales. ;)
     
    Yumudas Beegbut and Hillel like this.
  8. Hillel

    Hillel Spartan II

    Messages:
    52
    Likes Received:
    28
    Ok so first of all, huge thanks again Psychoduck for your help. The good news is that I got your method to work for my energy barrier at match start. The bad news is, now I'm having the opposite problem with all subsequent rounds that I did previously. With the method I was using, I could get the barrier to despawn on timer at Match start round, but subsequent rounds it would not despawn (and even if it did, it would have been 8 seconds longer than I wanted obviously). Now, with your method, on subsequent rounds it wont spawn at all. The Timmys seem to be working and I see the timer ones delete but it's like they can't trigger a despawn if there was nothing to despawn. So I suspect the problem is getting the barrier to respawn at least by round starts so that it can despawn again. My rounds are going to typically be about 23 seconds long and not more than 2 minutes. I even tried adding a "condition=round start - action=spawn (if not already spawned)" script to the barrier and that doesn't work either. So, I'm suspecting that either I've done something wrong (and I've double and tripple checked the scripting parameters), OR, there's a glitch with adding certain scripts to energy barriers. I might try a few more tweeks, but I'm probably gonna give up working on it for today.

    The other question I'm having is, do you happen to know if the object timed spawn/despawn properties override the scripting or is it vice versa? Like for example, if I have respawning off, but put a spawn script (if not already) at round start, will the respawning being off override the script? I can't tell for sure either way yet just from my own messing around. Your help is greatly appreciated.
     
  9. Psychoduck

    Psychoduck Spartan II
    343 Industries Cartographer Forge Critic Senior Member

    Messages:
    1,528
    Likes Received:
    428
    That is odd that the on round start-spawn script isn't working. That would have been my suggestion. To answer your question about timers, they work in tandem. Let's say you script something to despawn and set its respawn time to x seconds. It will respawn x seconds after despawning. If a script telling it to respawn precedes the respawn timer, it will respawn upon receiving the script.

    Try using a script brain to send a message or activate a power channel at the beginning of each round. Have the barrier despawn upon receiving that message.
     
    Hillel likes this.
  10. Hillel

    Hillel Spartan II

    Messages:
    52
    Likes Received:
    28
    Thanks again, I'll try that.
     

Share This Page