[Solved] Objects won't despawn when ordered

Discussion in 'Halo and Forge Discussion' started by ExTerrestr1al, Dec 5, 2016.

  1. ExTerrestr1al

    ExTerrestr1al Forerunner
    Senior Member

    Messages:
    2,387
    Likes Received:
    2,515
    (solved, see below in ORANGE)

    Hi there,

    is there a known bug and is there a workaround, for objects that don't seem to respond to orders to despawn?

    I have items that need to despawn at start, but I want a fail-safe for editing the map so that I don't get stuck never being able to select the items again. So, I set a script brain to send a message on Zulu at match start (which I could always delete anytime) and my items are set to despawn on a message from Zulu.

    One light does despawn, but another one doesn't.

    Also, is there a limitation to making invisible switches despawn on command? I cannot seem to get a switch to despawn at all...

    I have a transit system partially constructed, where switches to open the door need to only be available when the "vehicle" is at that location, otherwise despawn (don't want door to open unless there is something to walk onto, rather than empty space falling to death). That is my preferred method, rather than putting something in to make it simply not work. I'd like the player to not have the "E" come up on screen until it is ready, rather than having the switch not work when pressed. A red light would indicate it's not ready, but I still don't want players to get confused...

    Any thoughts?

    Solution:
    I solved it. It ended up being a problem I created unwittingly. The 2x2x2 blocks I use as respawn timers to make a red/green lights appear about the same time it takes for my car to arrive, use the "spawn" event of the block to send a message to the light to spawn. Because these blocks spawn on start match, they are respawning items that are also being told to despawn.

    That is why it was doing this. I changed my script logic some and it now works perfectly.

    In case anyone runs into something like this...

    Setting objects to despawn (w/o a script) after a few seconds of a match/round does not seem to work. To get the same effect, I simply used 1 more spawn timer object to despawn on match start and then spawn soon, deactivating all things on the map you might want to hide on start (things that aren't in the players FOV at start, obviuosly)

    on that note, does anyone know if "match start" means the time gameplay starts or when you enter the match and cinematics play?
     
    #1 ExTerrestr1al, Dec 5, 2016
    Last edited: Dec 6, 2016
  2. Agent Zero85

    Agent Zero85 Legendary
    Wiki Contributor Senior Member

    Messages:
    400
    Likes Received:
    435
    1. Match start triggers in forge.

    2. Invis witches don't despawn on command

    So i advise you instead set your objects to despawn on timer within the object properties. This does not trigger in forge. And save you a lot of scripts.

    And use physical switches, they will spawn and despawn as commanded, even if the player is in the way.
     
    ExTerrestr1al likes this.
  3. ExTerrestr1al

    ExTerrestr1al Forerunner
    Senior Member

    Messages:
    2,387
    Likes Received:
    2,515
    saving scripts is always nice :) Thanks for that suggestion.

    you're saying match start triggers aren't very reliable I take it? EDIT: Oh I see you are saying that they might not trigger unless in an actual match. well I tested that with the same poor results...

    the problem I'd have with physical switches, is that I want the player to be able to walk up to a sliding door and press it intuitively. Not sure I want to make a visible switch vanish and reappear (immersion)

    too bad we can't just make any object into a switch :(

    I'll keep playing with it. Thanks
     
  4. Agent Zero85

    Agent Zero85 Legendary
    Wiki Contributor Senior Member

    Messages:
    400
    Likes Received:
    435
    No, match start is very reliable, which is why it triggers when you start the map in forge. Also, you can place the switch within the geometry of the door,
     
  5. ExTerrestr1al

    ExTerrestr1al Forerunner
    Senior Member

    Messages:
    2,387
    Likes Received:
    2,515
    hmm... curious why my brain script of:
    on start, send Zulu

    light script
    on message Zulu despawn

    isn't working then...

    but I do like the idea of despawning after a short timer. If I don't place any initial spawns near there, it should never be an issue where someone can use something that wasn't intended to be used at start of match.
     
  6. Agent Zero85

    Agent Zero85 Legendary
    Wiki Contributor Senior Member

    Messages:
    400
    Likes Received:
    435
    Are you sure you are using messages for both, as power channels and messages are different.
    And if you need to lights to despawn on round start, you can always set it up to despawn on round start. Instead of wiring it though a message channel.
     
  7. ExTerrestr1al

    ExTerrestr1al Forerunner
    Senior Member

    Messages:
    2,387
    Likes Received:
    2,515
    I am fairly certain they are all set to messages, though I will have to verify later. That was my main thought (and something I have done before by mistake).

    I am setting up the channel to despawn them from a script brain to protect them from being lost forever, if I somehow delete the item that would bring it back again... since we cannot delete items which have despawed (hopefully soon?)
     
    #7 ExTerrestr1al, Dec 5, 2016
    Last edited: Dec 5, 2016
  8. ExTerrestr1al

    ExTerrestr1al Forerunner
    Senior Member

    Messages:
    2,387
    Likes Received:
    2,515
    I solved it. It ended up being a problem I created unwittingly. The 2x2x2 blocks I use as respawn timers to make a red/green lights appear about the same time it takes for my car to arrive, use the "spawn" event of the block to send a message to the light to spawn. Because these blocks spawn on start match, they are respawning items that are also being told to despawn.

    That is why it was doing this. I changed my script logic some and it now works perfectly.

    In case anyone runs into something like this...

    Setting objects to despawn (w/o a script) after a few seconds of a match/round does not seem to work. To get the same effect, I simply used 1 more spawn timer object to despawn on match start and then spawn soon, deactivating all things on the map you might want to hide on start (things that aren't in the players FOV at start, obviuosly)

    on that note, does anyone know if "match start" means the time gameplay starts or when you enter the match and cinematics play?
     
    #8 ExTerrestr1al, Dec 5, 2016
    Last edited: Dec 5, 2016
  9. Agent Zero85

    Agent Zero85 Legendary
    Wiki Contributor Senior Member

    Messages:
    400
    Likes Received:
    435
    As soon as the cameras start rolling.
     
  10. ExTerrestr1al

    ExTerrestr1al Forerunner
    Senior Member

    Messages:
    2,387
    Likes Received:
    2,515
    Thanks, that is convenient!
     

Share This Page