On Repeating Outputs and the Like (Solved, prefab DL!)

A forum dedicated to chat about maps and the Source SDK for any Mod including tips and tutorials.
Post Reply
Ian_Suffix
Villun
Villun
User avatar
Posts: 742
Joined: Wed Aug 20, 2008 12:14 am
Location: Washington State

Games Played

Ville Awards

On Repeating Outputs and the Like (Solved, prefab DL!)

Post by Ian_Suffix » Fri Jul 30, 2010 2:04 am

Even after nearly a thousand hours using Hammer, sometimes the most simple of things can stump me. Gentlemen (and whatever ladies are involved in mapping), I require a way to loop an output so that I can essentially alternate between three phases of sprites every .5 seconds. I thought it would be easy: I got myself a logic_timer, set its Refire Interval to 0.5, and hoped for the best. I was pleased when my debug gametext came up and said "Added 1," but after five seconds of waiting for it to return, I became very unpleased. It should go without saying that none of my outputs are marked "fire only once."

So! Do any of you, particularly |3eeron, have a working prototype or knowledge to shed on this subject in general? I'm open to solutions that do not require a logic_timer; I merely need to use a math_counter ever 0.5 or so seconds.

This topic is of vital importance to me, as I intend to use it to make both Camping Trip and Cayenne Mountain easier to navigate.
Last edited by Ian_Suffix on Fri Jul 30, 2010 11:26 pm, edited 2 times in total.

Greebo
Retired Admin
Retired Admin
Posts: 256
Joined: Mon Oct 23, 2006 12:34 am

Ville Awards

knurd’s avatar
Loading…

Re: On Repeating Outputs and the Like (Logic_Timer)

Post by Greebo » Fri Jul 30, 2010 6:03 am

I can't check hammer right now (about to head to work), but it may be that the logic timer needs to be triggered by something.

I'll have a look when I get home this evening and see what I find out. (I have a prototype dod:source map that had a tank moving forwards and firing randomly, with an explosion happening a half second or so after that in the distance

Boss Llama
Site Admin
Site Admin
User avatar
Posts: 10153
Joined: Mon Mar 24, 2008 12:45 pm

Games Played

Ville Awards

<eVa> Boss Llama’s avatar
Loading…

Re: On Repeating Outputs and the Like (Logic_Timer)

Post by Boss Llama » Fri Jul 30, 2010 11:52 am

Well, one way I can think of would be as follows...

Assume the sprites are called env_sprite_1, 2, and 3
Start with all of their "Start on" flags disabled

Set up a logic_auto with:
"OnMultiNewRound env_sprite_1 ToggleSprite"
"OnMultiNewRound env_sprite_1 FireUser1"

Have env_sprite_1 have:
"OnUser1 env_sprite_2 ToggleSprite 0.5"
"OnUser1 env_sprite_2 FireUser1 0.5"
"OnUser1 env_sprite_1 ToggleSprite 0.5"

Have env_sprite_2 have:
"OnTrigger env_sprite_3 ToggleSprite 0.5"
"OnUser1 env_sprite_3 FireUser1 0.5"
"OnTrigger env_sprite_2 ToggleSprite 0.5"

Have env_sprite_3 have:
"OnTrigger env_sprite_1 ToggleSprite 0.5"
"OnUser1 env_sprite_1 FireUser1 0.5"
"OnTrigger env_sprite_3 ToggleSprite 0.5"


I don't have any great experience with sprites, but as far as outputs go, that should create a relay where starting a new round triggers an endless loop of each sprite toggling on, waiting half a second, then toggling off and telling the next one to turn on.
-Boss Llama

Ian_Suffix
Villun
Villun
User avatar
Posts: 742
Joined: Wed Aug 20, 2008 12:14 am
Location: Washington State

Games Played

Ville Awards

Re: On Repeating Outputs and the Like (Logic_Timer)

Post by Ian_Suffix » Fri Jul 30, 2010 2:21 pm

Ah, that would probably work, Alizée Fan, if I didn't want to pause the sequence of sprites on a certain event. With a non-sleepy mind today, I'll try some various solutions. If I come up with it, I'll prefab it as thanks.

UPDATE: At Beeron's recommendation (or interpretation of his recommendation?) I split the timer into three 1.5 second timers and enabled them one by one with an offset of 0.5 seconds. And PRESTO! It works! I'm not sure why it wouldn't loop before, but I'm not going to question it at this point. I'll make a prefab out of what I have now and then finish up everything else I required.

The landing lights prefab
I'll upload this to FPSBanana once I'm done with my own maps that will use it. A sort of patent protection, if you will.
Last edited by Ian_Suffix on Sun Aug 01, 2010 5:07 pm, edited 1 time in total.
Image

Boss Llama
Site Admin
Site Admin
User avatar
Posts: 10153
Joined: Mon Mar 24, 2008 12:45 pm

Games Played

Ville Awards

<eVa> Boss Llama’s avatar
Loading…

Re: On Repeating Outputs and the Like (Solved, prefab DL!)

Post by Boss Llama » Sat Jul 31, 2010 11:46 am

Cool looking piece, glad to hear you got it working :-)

So you're aware, the entity "blue_landing_light_timer" that both the logic_relays need isn't included in the prefab, so the lights don't change with the presently uploaded version :-)
-Boss Llama

Ian_Suffix
Villun
Villun
User avatar
Posts: 742
Joined: Wed Aug 20, 2008 12:14 am
Location: Washington State

Games Played

Ville Awards

Re: On Repeating Outputs and the Like (Solved, prefab DL!)

Post by Ian_Suffix » Sat Jul 31, 2010 7:24 pm

Hmm?! That's odd, I know I tested this and had it working... Now loading Hammer.

...I must have fixed it before wrapping up the color-changers. Well, I guess I'll go change and reupload that prefab after I'm done with my publishing work.
Image

Dog
Server Ops
Server Ops
User avatar
Posts: 14317
Joined: Sun Oct 15, 2006 12:12 am
Location: In the bath, having a good think....

Games Played

Ville Awards

Dog - RIP Stevo’s avatar
Loading…

Re: On Repeating Outputs and the Like (Solved, prefab DL!)

Post by Dog » Sat Jul 31, 2010 7:44 pm

Code: Select all

CreateTimer(0.5, InvokeSpriteCode, _, TIMER_REPEAT);
:lol:
Image

Ian_Suffix
Villun
Villun
User avatar
Posts: 742
Joined: Wed Aug 20, 2008 12:14 am
Location: Washington State

Games Played

Ville Awards

Re: On Repeating Outputs and the Like (Solved, prefab DL!)

Post by Ian_Suffix » Sun Aug 01, 2010 5:05 pm

Oh, sure, Dog, like anything could be that easy.

I discovered what was probably missing was the logic_auto it uses. I generally only use one logic_auto per map, but it might not be a problem to have two. In any case, I've tested this version. (DL)
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests