Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Light flickering cog.
Light flickering cog.
2004-05-13, 9:58 PM #1
Can someone please create me a cog that creates a thing and then destroys it and keeps doing this at random intervals between 0.1-2 seconds.

Thanks.

------------------
Nightfire Mod
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-05-14, 3:08 AM #2
Wait? Do you want something that will cause flickering dynamic light, or to make something disappear/reappear? Either way, I believe there's easier ways to do it.

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-14, 10:38 AM #3
If it's the light you want to flicker, try 00_thinglight.cog... If you want a thing to show, and disappear, then replace thinglight with set/clearthingflags...
Need more help, then ask for it and specify which it is, thing or light?

/Edward
Edward's Cognative Hazards
2004-05-14, 11:11 AM #4
Well its a dynamic light thing. I want it to flicker like that at random intervals to give the effect that the light is broken.

------------------
Nightfire Mod
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-05-14, 11:37 AM #5
Try this.
Code:
# Jedi Knight Cog Script
#
# flickerlight.cog
#
# Causes light templates to be created and destroyed at random
#  intervals.
# Based on LEC cog 10_thinglight.cog
#
# [Darth Slaw] - darthslaw@cox.net
# 5/15/04
# ===================================================================
symbols

message   startup

template  lighttemp=light1.0

thing     lightsource=-1
thing     light=-1                 local

end

code

startup:
	//light = CreateThing(lighttemp, lightsource); //[edit]this line messed it up -- fixed now
	while(1)
	{
		light = CreateThing(lighttemp, lightsource);
		sleep(rand() * 1.9 + 0.1);
		destroything(light);
		sleep(rand() * 1.9 + 0.1);
	}

return;

end


------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.

[This message has been edited by Darth Slaw (edited May 15, 2004).]
May the mass times acceleration be with you.
2004-05-15, 7:18 AM #6
just to make sure you all see this, I'll make a new post. I accidentally made the cog create a light outside the loop, that wasn't destroyed, and thus ruined the effect. It's fixed now. Sorry 'bout that.

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.
May the mass times acceleration be with you.
2004-05-15, 11:53 AM #7
I just got to test it and it works great thanks slaw

------------------
Nightfire Mod
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi

↑ Up to the top!