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 → I need help with a cog...
I need help with a cog...
2001-12-12, 5:34 AM #1
Basically, the help I need is for someone to make it for me. I need a cog that will have a sound generating from a thing that loops and when you hit a specified switch it has a set wait for a explosion at 5 ghost positions.

------------------
Watch Your Back On The Zone...Cause "Deth" Is Always Creeping Up Behind.
(Hostile Takeover)
http://www.massassi.net/levels/files/1708.shtml
(RWP)
http://www.massassi.net/levels/files/1780.shtml
Check Um Out...
2001-12-12, 5:54 AM #2
Um. Ok. But Id better get credit for this! [http://forums.massassi.net/html/smile.gif]


Code:
#12/2001 GBK
Symbols
Message Startup
Message Damaged
Message Timer
Thing Sound_thing
Sound Thing_sound
Flex Maxdist=100
Surface Damage_surface  Mask=0x448
Flex Exp_wait=1.0
Template Explosion
Thing Ghost0
Thing Ghost1
Thing Ghost2
Thing Ghost3
Thing Ghost4
Int I=0   Local
Int Channel=0  Local
Int Lock=0   Local
End
Code
Startup:
Sleep(1.0);
Channel = Playsoundthing(Thing_sound, Sound_thing, 1.0, -1, Maxdist, 0x1);
Stop;
Damaged:
If(Getsenderref() != Damage_surface || Lock != 0) Stop;
Lock=1;
Setwallcel(Damage_surface, 1);
Stopsound(Channel);
Settimer(Exp_wait);
Stop;
Timer:
For(I=0;I<=4;I=I+1) {
Creatething(Explosion, Ghost0); }
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]

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

[This message has been edited by GBK (edited December 12, 2001).]
And when the moment is right, I'm gonna fly a kite.
2001-12-12, 6:44 AM #3
Well, its doesn't work at all. The sound doesn't work the explosions don't go off, nothing.

------------------
Watch Your Back On The Zone...Cause "Deth" Is Always Creeping Up Behind.
(Hostile Takeover)
http://www.massassi.net/levels/files/1708.shtml
(RWP)
http://www.massassi.net/levels/files/1780.shtml
Check Um Out...
2001-12-12, 8:42 AM #4
It works fine for me. Although there is a error in the Stopsound function. Here is the updated cog:

Code:
#12/2001 GBK
Symbols
Message Startup
Message Damaged
Message Timer
Thing Sound_thing
Sound Thing_sound
Flex Maxdist=100
Surface Damage_surface Mask=0x448
Flex Exp_wait=1.0
Template Explosion
Thing Ghost0
Thing Ghost1
Thing Ghost2
Thing Ghost3
Thing Ghost4
Int I=0 Local
Int Channel=0 Local
Int Lock=0 Local
End
Code
Startup:
Sleep(1.0);
Channel = Playsoundthing(Thing_sound, Sound_thing, 1.0, -1, Maxdist, 0x1);
Stop;
Damaged:
If(Getsenderref() != Damage_surface || Lock != 0) Stop;
Lock=1;
Setwallcel(Damage_surface, 1);
Stopsound(Channel, 1.0);
Settimer(Exp_wait);
Stop;
Timer:
For(I=0;I<=4;I=I+1) {
Creatething(Explosion, Ghost0); }
Stop;
End



It works, I tested it. Be sure you have your variables set right.


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-12, 9:19 AM #5
Ah, I see what the problem is you made the cog right, but I should have explained what I wanted better. I ment "hit" as flick or activate, you thought I ment shoot. I just need you to activate the switch.

------------------
Watch Your Back On The Zone...Cause "Deth" Is Always Creeping Up Behind.
(Hostile Takeover)
http://www.massassi.net/levels/files/1708.shtml
(RWP)
http://www.massassi.net/levels/files/1780.shtml
Check Um Out...
2001-12-12, 11:45 AM #6
Silly me. Try this one on for size.

Code:
#12/2001 GBK
Symbols
Message Startup
Message Activated
Message Timer
Thing Sound_thing
Sound Thing_sound
Flex Maxdist=100
Surface Switch
Flex Exp_wait=1.0
Template Explosion
Thing Ghost0
Thing Ghost1
Thing Ghost2
Thing Ghost3
Thing Ghost4
Int I=0 Local
Int Channel=0 Local
Int Lock=0 Local
End
Code
Startup:
Sleep(1.0);
Channel = Playsoundthing(Thing_sound, Sound_thing, 1.0, -1, Maxdist, 0x1);
Stop;
Activated:
If(Getsenderref() != Switch) || Lock != 0) Stop;
Lock=1;
Setwallcel(Switch, 1);
Stopsound(Channel, 1.0);
Settimer(Exp_wait);
Stop;
Timer:
For(I=0;I<=4;I=I+1) {
Creatething(Explosion, Ghost0); }
Stop;
End



I havent tested the modifications, but it should work.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!