TMCC : Forge Discussion

Buddy

Master
Feb 8, 2013
1,307
721
168
Germany
www.youtube.com
Sooo... I want to shoot a garage door switch, which despawns an object. Can anyone tell me what needs to be done? I already asked two people and they could not help. Man, the scripting...
 

SOLIDSNAKEee

Salad Snack
Jan 26, 2013
1,216
828
312
Ireland
Thanks, Mental, but I already know this thread. It is not in there or anywhere else on Youtube. I want a brief explanation what you need to do with object one and two, and with the garage door switch.

I think you may be mistaken. Apply the same concept to the garage door and it should work out fine.
 
Sooo... I want to shoot a garage door switch, which despawns an object. Can anyone tell me what needs to be done? I already asked two people and they could not help. Man, the scripting...

Set the object's spawn channel to 1 (with place at start_false and can despawn true), then place a timer that has timer data as 1 and a broadcast channel of 1. Then, set the garage door switch to broadcast channel 1. So 3 items in total.

Object:
Spawn Channel: 1

Timer:
Timer/User Data: 1
Broadcast channel: 1

Switch (either an "off" or a "toggle; the garage door switch is a toggle):
Broadcast channel: 1

As long as they are all on the same channel, it should work.

If you want an explanation I'll pm it to ya. ;)
 
Last edited:

buddhacrane

Proficient
Nov 2, 2014
34
8
23
37
What? I guess he has a different method than I do.
Verbatim copy of my post - it's a little "wordy", but I figure it's best to be too detailed and explanatory, than not detailed enough.

Yo Buddha.
So I already posted this on the Forge Disc. thread, but it seems like nobody knows a solution to this. You seem to be much into scripting, so I thought I'd post this here and ask you:
I want to make it so if I shoot a garage door switch, a hard object (for example any type of block, decoratives, etc. | NO interactive objects) despawns itself (like an opening door if you know what I mean). What do I need to do to set this up? Or is it even possible?

Hey Buddy. Yeah, sure, this is possible.

Initially, the thing to be aware of with the Garage Door Switch is that it can only ever turn on a broadcast channel. On its own it cannot turn off, or toggle, a broadcast channel; and it's turning off a broadcast channel that we need to do, to despawn an object. Using the on-destroyed triggers, which can only turn on broadcast channels, as a way to also turn off and toggle channels is something I'm going to cover in my guide; I just haven't gotten around to it yet. Anyway, this is what you do:

So you basically want to turn on one broadcast channel, so that you can turn off another broadcast channel (to despawn the object).

Setup the garage door switch so that it will broadcast to a particular channel, let's say 0. Shooting this will then turn on that channel.

Setup a Timer: Off Once so that its power channel is the same as the one on your switch (e.g. 0). Then set that timer's broadcast channel to another channel, let's say 1. So now whenever broadcast channel 0 is turned on, broadcast channel 1 will turn off.

Go to your object you want to have despawn, and set its Spawn Time to Never, its Place at Start to False, and then set its spawn channel to that of the Timer (e.g. 1), and also its Can Despawn property to True. This will now make it so that whenever broadcast channel 1 is turned off, the object will despawn.

By default a broadcast channel is initially off at the start of a game, which would mean our object would already be despawned at the beginning. So what we finally need is a Timer: On Once, set to the same broadcast channel as the other timer (e.g 1). Don't give this a power channel - we want this to trigger at the beginning of the game, but do give it a timer delay of about 5 seconds (this will solve an issue where timers don't trigger at the beginning of a game for Non-Host players). So now, at the beginning of the game, broadcast channel 1 will be on, and our object will be spawned into the map.

And that's pretty much your basic setup: The object will be there at the start, but once you shoot the switch, it will despawn.

Now, if you left it like this then your garage door switch would be a one-time deal. Once you'd shot it and despawned the object, you wouldn't be able to bring it back in again, unless you setup some more timers. I don't know if you need it to "reset" so I won't go into detail about how you would do that unless you want me to, but the basic premise would be to somehow turn the switch's broadcast channel back off, and the timer's broadcast channel back on - this would put it back to its initial starting state.

Hope that helps!
 
Verbatim copy of my post - it's a little "wordy", but I figure it's best to be too detailed and explanatory, than not detailed enough.



Hey Buddy. Yeah, sure, this is possible.

Initially, the thing to be aware of with the Garage Door Switch is that it can only ever turn on a broadcast channel. On its own it cannot turn off, or toggle, a broadcast channel; and it's turning off a broadcast channel that we need to do, to despawn an object. Using the on-destroyed triggers, which can only turn on broadcast channels, as a way to also turn off and toggle channels is something I'm going to cover in my guide; I just haven't gotten around to it yet. Anyway, this is what you do:

So you basically want to turn on one broadcast channel, so that you can turn off another broadcast channel (to despawn the object).

Setup the garage door switch so that it will broadcast to a particular channel, let's say 0. Shooting this will then turn on that channel.

Setup a Timer: Off Once so that its power channel is the same as the one on your switch (e.g. 0). Then set that timer's broadcast channel to another channel, let's say 1. So now whenever broadcast channel 0 is turned on, broadcast channel 1 will turn off.

Go to your object you want to have despawn, and set its Spawn Time to Never, its Place at Start to False, and then set its spawn channel to that of the Timer (e.g. 1), and also its Can Despawn property to True. This will now make it so that whenever broadcast channel 1 is turned off, the object will despawn.

By default a broadcast channel is initially off at the start of a game, which would mean our object would already be despawned at the beginning. So what we finally need is a Timer: On Once, set to the same broadcast channel as the other timer (e.g 1). Don't give this a power channel - we want this to trigger at the beginning of the game, but do give it a timer delay of about 5 seconds (this will solve an issue where timers don't trigger at the beginning of a game for Non-Host players). So now, at the beginning of the game, broadcast channel 1 will be on, and our object will be spawned into the map.

And that's pretty much your basic setup: The object will be there at the start, but once you shoot the switch, it will despawn.

Now, if you left it like this then your garage door switch would be a one-time deal. Once you'd shot it and despawned the object, you wouldn't be able to bring it back in again, unless you setup some more timers. I don't know if you need it to "reset" so I won't go into detail about how you would do that unless you want me to, but the basic premise would be to somehow turn the switch's broadcast channel back off, and the timer's broadcast channel back on - this would put it back to its initial starting state.

Hope that helps!
Hmm. I didn't know the garage door switch is strictly a switch on button. I guess in that case the switch would need to spawn a timer off once to despawn the object.

By the way, to make it respawn, you could simply set the garage door switch to spawn a timer off once with a time of 0 AND a timer on once with a your intended respawn time; both set to the object's spawn channel. This will cause it to despawn, then spawn again later, although it's a one-time thing. If you want it to work multiple times, it will be more complicated; I could tell you how to do that if you want.
 

Op618

Novice
Jan 21, 2014
7
0
6
Do any of you guys know how to save a dang map? Ever time I make a map in H2A it says that the save is unsuccessful, is there a way to fix this?
 
Do any of you guys know how to save a dang map? Ever time I make a map in H2A it says that the save is unsuccessful, is there a way to fix this?
Are you at 50 files yet? If so, 50 files is the limit that you can have (50 locally, another 50 on your file share). This sucks, I know, but that's how it is. If you want, you gotta delete an old map, or upload it onto your FS first then delete it.
 
" ya we will give you 650 objects that you can utilised in forge however anything over 500 pieces will not start in custom games" #343logic
Sigh... really? My invasion map has 650/650 pieces- though I guess that is the case since people kept lagging out in my custom lobby. I need help :(

However only certain people lagged out, though, not all of them... it might just be my connection.
 
Last edited: