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 → Random explosions
Random explosions
2001-11-24, 2:23 PM #1
I need a cog that generates random explosions in a sector when a button is pushed for my new level, "The Resturant at the End of the Universe".

------------------
Don't knock my smock or ill clean ur clock!
Ban Jin!
Nobody really needs work when you have awesome. - xhuxus
2001-11-24, 6:50 PM #2
There is a cog, from level 16 I believe, that does that.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-25, 12:07 AM #3
Actually, there is a cog called dropbomb.cog, and if you assign a console as the switch and have loads of ghost templates with detonator explosions, that would work. You'd need about 30 ghosts though, but it would work. The cog is...
Quote:
<font face="Verdana, Arial" size="2">
# Drop/Fire any templates (i.e. TDs, Mines, etc.) at the flick of a switch -up to 4 at a time.

symbols

thing switch desc=switch

template proj_tpl=+seqchrg
thing tdg1 nolink,desc=tdg1
thing tdg2 nolink,desc=tdg2
thing tdg3 nolink,desc=tdg3
thing tdg4 nolink,desc=tdg4

int rounds=2 desc=rounds

flex rate=0.1 desc=rate
flex delay=3.0 desc=delay

int firing=0 local
int cur_round=0 local
int dummy local

sound on_snd=set_hi2.wav local
sound off_snd=lgclick1.wav local
sound warn

message activated

end

code

activated:
if(firing == 1) Return;
firing = 1;
playsoundglobal(warn, 1, 0, 132);
Sleep(1.5);
playsoundglobal(warn, 1, 0, 132);
Sleep(1.5);
dummy = PlaySoundPos(on_snd, switch, 1.0, 5.0, 10.0, 0);


cur_round = 0;
while(cur_round < rounds)
{
dummy = CreateThing(proj_tpl, tdg1);
Sleep(rate);
dummy = CreateThing(proj_tpl, tdg2);
Sleep(rate);
dummy = CreateThing(proj_tpl, tdg3);
Sleep(rate);
dummy = CreateThing(proj_tpl, tdg4);
Sleep(rate);

cur_round = cur_round + 1;
}

Sleep(delay);
dummy = PlaySoundPos(off_snd, switch, 1.0, 5.0, 10.0, 0);
firing = 0;
Return;

end
</font>


Hope that helps.

------------------
"Nac Mac Feegle weyhey!"
Battle cry of the Nac Mac Feegle.
"Nac Mac Feegle weyhey!"
Battle cry of the Nac Mac Feegle.
2001-11-25, 7:30 AM #4
Bah! Thats just a slightly modified version of LEC's TD trap cog.

Try this one on for size..


Code:
#11/2001 GBK
Symbols
Message Activated
Message Pulse
Surface Switch
Template Type0
Template Type1
Template Type2
Template Type3
Thing Ghost0
Thing Ghost1
Thing Ghost2
Thing Ghost3
Thing Ghost4
Thing Ghost5
Thing Ghost6
Thing Ghost7
Thing Ghost8
Thing Ghost9
Flex Pulse_rate=0.5
Int I=0   Local
Int Lock=0   Local
Int R=0    Local
End
Code
Activated:
If(Getsenderref() == Switch) {
If(Lock == 0) { Setpulse(Pulse_rate); Lock=1; }
Else { Setpulse(0); Lock=0; } }
Stop;
Pulse:
R=Rand()*10;
While(R >=3) { R=Rand()*10; }
Creatething(Type0[R], Ghost0[Rand()*10]);
Stop;
End



I dont know if it works, I just typed it into the box. But it should... [http://forums.massassi.net/html/biggrin.gif]


This one allows for 10 ghosts, and 4 templates. It runs off a pulse, set by 'Pulse_rate'. It randomly selects a template, and ghost position.


------------------
Success is the inverse relationship between effort, gain, and loss.

[This message has been edited by GBK (edited November 25, 2001).]
And when the moment is right, I'm gonna fly a kite.
2001-11-26, 10:08 AM #5
I dont want any TDs, just explosions. And the 1 from lvl 16 doesnt use switch.

------------------
Don't knock my smock or ill clean ur clock!
Ban Jin!
Nobody really needs work when you have awesome. - xhuxus
2001-11-26, 10:25 AM #6
Thats the things. YOu use the +td_exp or something template... it makes the explosion of a TD.

------------------
"Nac Mac Feegle weyhey!"
Battle cry of the Nac Mac Feegle.
"Nac Mac Feegle weyhey!"
Battle cry of the Nac Mac Feegle.
2001-11-26, 10:32 AM #7
Smock, try the cog I posted.

It works, I tested it.

And it does exactally what you wanted.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-26, 10:35 AM #8
cool, thanks.
Ban Jin!
Nobody really needs work when you have awesome. - xhuxus

↑ Up to the top!