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 → im looking for a cog...
im looking for a cog...
2002-01-18, 8:45 AM #1
I need a cog for a lvl, u press a button, an alarm goes off, and some enimys spawn and come over to the button, any ideas?
Mess with the best....Die like the rest.The New Jedi X Homepage
2002-01-18, 9:57 AM #2
Slim piece o' cake... [http://forums.massassi.net/html/wink.gif]


Code:
#01/2002 GBK
Symbols
Message Activated
Message Timer
Surface Switch
Thing Ghost0=-1
Thing Ghost1=-1
Thing Ghost2=-1
Thing Ghost3=-1
Template Type
Sound Alarm
Int Loop_sound=0    #Loop sound?  0 = no.
Flex Loop_time=30.0   #If loop, how long till stop?
Int Channel=0   Local
Int I=0   Local
End
Code
Activated:
If(Getsenderref() != Switch || Getwallcel(Switch) == 1) Stop;
Setwallcel(Switch, 1);
If(Loop_sound != 0) {
Channel = Playsoundglobal(Alarm, 1.0, 0.0, 0); Settimer(Loop_time); }
Else {
Playsoundglobal(Alarm, 1.0, 0.0, 0x1); }
For(I=0;I<2;I=I+1) {
If(Ghost0 != -1) { AIsetmoveframe(Creatething(Type, Ghost0), 0); } }
Stop;
Timer: Stopsound(Channel, 0.1); Stop;
End


For the ghosts, give them a frame0 of the position you want them to move to.

I dont know if it works, but it should... [http://forums.massassi.net/html/biggrin.gif]

 

Oh yeah, credit me...

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-18, 10:31 AM #3
make a new cog, and put what u wrote in it, right?
btw, consider urself credited
Mess with the best....Die like the rest.The New Jedi X Homepage
2002-01-18, 11:47 AM #4
Just want to let u know, ur cog works, the only probs with it are #1, i put 4 ghost objects (like it told me to) but only 2 of the stormtroopers appeared. prob #2, the alarm wouldnt stop ringing, how do i fix that?
Mess with the best....Die like the rest.The New Jedi X Homepage
2002-01-18, 1:21 PM #5
Silly me...


Code:
#01/2002 GBK
Symbols
Message Activated
Message Timer
Surface Switch
Thing Ghost0=-1
Thing Ghost1=-1
Thing Ghost2=-1
Thing Ghost3=-1
Template Type
Sound Alarm
Int Loop_sound=0    #Loop sound?  0 = no.
Flex Loop_time=30.0   #If loop, how long till stop?
Int Channel=0   Local
Int I=0   Local
End
Code
Activated:
If(Getsenderref() != Switch || Getwallcel(Switch) == 1) Stop;
Setwallcel(Switch, 1);
If(Loop_sound != 0) {
Channel = Playsoundglobal(Alarm, 1.0, 0.0, 0x1); Settimer(Loop_time); }
Else {
Playsoundglobal(Alarm, 1.0, 0.0, 0); }
For(I=0;I<4;I=I+1) {
If(Ghost0 != -1) { AIsetmoveframe(Creatething(Type, Ghost0), 0); } }
Stop;
Timer: Stopsound(Channel, 0.1); Stop;
End



It should work correctly now.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-18, 2:22 PM #6
thanx, and consider urself with credits in the readme file. [http://forums.massassi.net/html/smile.gif] [http://forums.massassi.net/html/smile.gif] [http://forums.massassi.net/html/smile.gif]
Mess with the best....Die like the rest.The New Jedi X Homepage
2002-01-19, 6:15 AM #7
BTW, you dont HAVE to use 4 ghosts. The cog automatically checks to see if each ghost is used before creating the object.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-20, 4:40 PM #8
I know that, but i want 4 enimeys. [http://forums.massassi.net/html/smile.gif]
Mess with the best....Die like the rest.The New Jedi X Homepage

↑ Up to the top!