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 a cog...
I need a cog...
2001-11-12, 1:24 PM #1
That has the script:

1) A surface is slashed with weapon number 0 (lightsaber)
2) A mat goes over one animation.
3) All lights in several sectors go off.
4) A constant red blinking light and animated mat on several surfaces comes on. At the same time an alarm sound is playing.
5)Several doors opens.

Its for my new SP level pack "Military Intelligence"

I don't know squat about cogs so I cant do it. If you can THANKS! I'll post screenies of my level as soon as I find a chain link fence mat. (hint hint wink wink nudge nudge) [http://forums.massassi.net/html/smile.gif]


------------------
Windows Really Good Edition.

[This message has been edited by Zell (edited November 12, 2001).]
DO NOT WANT.
2001-11-12, 4:55 PM #2
Hmm, I dont know what you meant by 'red blinking light', but this shoud do the trick.


 


# 11/2001 GBK
Symbols
Message Activated
Message Damaged
Surface Switch Mask=0x448
Flex Switch_fps=10.0
Sector Light_sector0
Sector Light_sector1
Sector Light_sector2
Sector Light_sector3
Sector Light_sector4
Surface Alarm_display0
Surface Alarm_display1
Surface Alarm_display2
Surface Alarm_display3
Surface Alarm_display4
Material Alarm_material
Flex Alarm_fps=10.0
Sound Alarm_sound
Thing Door0
Thing Door1
Thing Door2
Thing Door3
Thing Door4
Flex Door_movespeed=4.0
Int Target_frame=1
Surface Kill_alarm
Int Alarm_channel=0 Local
Int Light_int=0 Local
Int Lock=0 Local
Int I=0 Local
End
Code
Damaged:
If((Getsenderref() == Switch) && (Lock==0)) {
If(Bittest(Getparam(1), 16)) { Lock=1;
Surfaceanim(Switch, Switch_fps, 0x0);
For(I=0;I<=4;I=I+1) {
If(Light_sector0 != -1) {
Setsectorlight(Light_sector0, 0, 0); } }
For(I=0;I<=4;I=I+1) {
If(Alarm_display0 != -1) {
Setsurfacemat(Alarm_display0, Alarm_material);
Surfaceanim(Alarm_display0, Alarm_fps, 0x1); } }
Alarm_channel = Playsoundlocal(Alarm_sound, 1.0, 0.0, 0x1);
For(I=0;I<=4;I=I+1) {
If(Door0 != -1) {
Movetoframe(Door0, Target_frame, Door_movespeed); } } } }
Stop;
Activated:
If(Getsenderref() == Kill_alarm) {
Stopsound(Alarm_Channel, 0.1); } Stop;
End

 

It works, I tested it. [http://forums.massassi.net/html/biggrin.gif]


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-13, 11:36 AM #3
Thanks!!!!!!!!!!!!! [http://forums.massassi.net/html/biggrin.gif]

[EDIT: What is "Kill_alarm"?]

[This message has been edited by Zell (edited November 13, 2001).]
DO NOT WANT.
2001-11-13, 12:23 PM #4
Kill_alarm is a switch that stops the alarm sound.

I put that in because the sound never stops without it. You dont have to define it, its just a debug variable.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-13, 12:58 PM #5
Hmmmm... Okay, well, the sound stops after about 40 seconds and you hear a "bloop" sorta sound as the power goes off. It then changes 10 mats to a different mat or animates it (How do I add two mats together to make an animated mat?) over one animation.

I also need something else, before the alarm comes on and the red light comes on but after you slash the surface. A mat goes over ONE[/b] (Out of four) animations.
DO NOT WANT.
2001-11-13, 5:08 PM #6
Hmmmmmm. [http://forums.massassi.net/html/tongue.gif]


 


# 11/2001 GBK
Symbols
Message Damaged
Message Timer
Surface Switch Mask=0x448
Sector Light_sector0
Sector Light_sector1
Sector Light_sector2
Sector Light_sector3
Sector Light_sector4
Surface Alarm_surface0
Surface Alarm_surface1
Surface Alarm_surface2
Surface Alarm_surface3
Surface Alarm_surface4
Surface Alarm_surface5
Surface Alarm_surface6
Surface Alarm_surface7
Surface Alarm_surface8
Surface Alarm_surface9
Material Alarm_material
Flex Alarm_fps=10.0
Sound Alarm_sound
Flex Alarm_sleep=40.0
Sound Power_out
Thing Door0
Thing Door1
Thing Door2
Thing Door3
Thing Door4
Flex Door_movespeed=4.0
Int Target_frame=1
Int Alarm_channel=0 Local
Int Light_int=0 Local
Int Lock=0 Local
Int I=0 Local
End
Code
Damaged:
If((Getsenderref() == Switch) && (Lock==0)) {
If(Bittest(Getparam(1), 16)) { Lock=1;
Setsurfacecel(Switch, 1);
Alarm_channel = Playsoundlocal(Alarm_sound, 1.0, 0.0, 0x1);
Settimer(Alarm_sleep); } } Stop;
Timer: Stopsound(Alarm_Channel, 0.1);
Playsoundlocal(Power_out, 1.0, 0.0, 0x4);
For(I=0;I<=4;I=I+1) { If(Light_sector0 != -1) {
Setsectorlight(Light_sector0, 0, 0); } }
For(I=0;I<=9;I=I+1) { If(Alarm_surface0 != -1) {
Setsurfacemat(Alarm_surface0, Alarm_material);
Surfaceanim(Alarm_surface0, Alarm_fps, 0x1); } }
For(I=0;I<=4;I=I+1) { If(Door0 != -1) {
Movetoframe(Door0, Target_frame, Door_movespeed); } }
Stop;
End

 


It works, I tested it... [http://forums.massassi.net/html/biggrin.gif]


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-14, 8:15 AM #7
Ehh... It actually doesn't work. The light starts blinking after the alarm stops. The other texture doesn't change, It doesn't even mention ANOTHER TEXTURE NOT THE ONE YOU SLASHED in the cog. I also need to figure out how to make an animated mat for the slashed grate to get into the building. Where can I get some WWII-ish enemies dressed for snow?
DO NOT WANT.
2001-11-14, 8:30 AM #8
[http://forums.massassi.net/html/frown.gif] Sorry.

 


# 11/2001 GBK
Symbols
Message Damaged
Message Timer
Surface Switch Mask=0x448
Surface Another_surface
Sector Light_sector0
Sector Light_sector1
Sector Light_sector2
Sector Light_sector3
Sector Light_sector4
Surface Alarm_surface0
Surface Alarm_surface1
Surface Alarm_surface2
Surface Alarm_surface3
Surface Alarm_surface4
Surface Alarm_surface5
Surface Alarm_surface6
Surface Alarm_surface7
Surface Alarm_surface8
Surface Alarm_surface9
Material Alarm_material
Flex Alarm_fps=10.0
Sound Alarm_sound
Flex Alarm_sleep=40.0
Sound Power_out
Thing Door0
Thing Door1
Thing Door2
Thing Door3
Thing Door4
Flex Door_movespeed=4.0
Int Target_frame=1
Int Alarm_channel=0 Local
Int Light_int=0 Local
Int Lock=0 Local
Int I=0 Local
End
Code
Damaged:
If((Getsenderref() == Switch) && (Lock==0)) {
If(Bittest(Getparam(1), 16)) { Lock=1;
Setsurfacecel(Another_surface, 1);
Alarm_channel = Playsoundlocal(Alarm_sound, 1.0, 0.0, 0x1);
Playsoundlocal(Power_out, 1.0, 0.0, 0x4);
For(I=0;I<=4;I=I+1) { If(Light_sector0 != -1) {
Setsectorlight(Light_sector0, 0, 0); } }
For(I=0;I<=9;I=I+1) { If(Alarm_surface0 != -1) {
Setsurfacemat(Alarm_surface0, Alarm_material);
Surfaceanim(Alarm_surface0, Alarm_fps, 0x1); } }
For(I=0;I<=4;I=I+1) { If(Door0 != -1) {
Movetoframe(Door0, Target_frame, Door_movespeed); } }
Settimer(Alarm_sleep); } } Stop;
Timer: Stopsound(Alarm_Channel, 0.1); Stop;
End

 

I didnt test it, but it should work.

If this isnt what you want, please, list it again.

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

[This message has been edited by GBK (edited November 14, 2001).]
And when the moment is right, I'm gonna fly a kite.
2001-11-14, 9:10 AM #9
Ahhhhh!! Nooooo!! It STILL[/b] doesn't work!! The power down sound happens right when you slash the thing, the slashed surface doesn't change, but the other one does!!!!!!!!!!!! [http://forums.massassi.net/html/mad.gif]
DO NOT WANT.
2001-11-14, 9:56 AM #10
[http://www.massassi.net/ec/images/1509.jpg]
[http://www.massassi.net/ec/images/1510.jpg]

As you can see, I slash the surface on the left. Kyle draws aside to reveal... HUH?!?! [http://forums.massassi.net/html/confused.gif] The slashed surface is the same, but the other surface on the right has changed. (That's the one I was all mad about in my last post about not being changed.)

Verah scr00d, huh?
DO NOT WANT.
2001-11-14, 10:26 AM #11
Not sure if this is what you want or not. Only thing I changed from GBK's last code segment was make both surfaces change when the first one is slashed, and put the power down sound happen after the alarm quits (~40 seconds later). If this is not what you want, try to be more specific.

# 11/2001 Modified GBK's code [Rishka]

Symbols
Message Damaged
Message Timer
Surface Switch Mask=0x448
Surface Another_surface
Sector Light_sector0
Sector Light_sector1
Sector Light_sector2
Sector Light_sector3
Sector Light_sector4
Surface Alarm_surface0
Surface Alarm_surface1
Surface Alarm_surface2
Surface Alarm_surface3
Surface Alarm_surface4
Surface Alarm_surface5
Surface Alarm_surface6
Surface Alarm_surface7
Surface Alarm_surface8
Surface Alarm_surface9
Material Alarm_material
Flex Alarm_fps=10.0
Sound Alarm_sound
Flex Alarm_sleep=40.0
Sound Power_out
Thing Door0
Thing Door1
Thing Door2
Thing Door3
Thing Door4
Flex Door_movespeed=4.0
Int Target_frame=1
Int Alarm_channel=0 Local
Int Light_int=0 Local
Int Lock=0 Local
Int I=0 Local
End
Code
Damaged:
If((Getsenderref() == Switch) && (Lock==0)) {
If(Bittest(Getparam(1), 16)) { Lock=1;
Setsurfacecel(Switch, 1);
Setsurfacecel(Another_surface, 1);
Alarm_channel = Playsoundlocal(Alarm_sound, 1.0, 0.0, 0x1);
For(I=0;I<=4;I=I+1) { If(Light_sector0 != -1) {
Setsectorlight(Light_sector0, 0, 0); } }
For(I=0;I<=9;I=I+1) { If(Alarm_surface0 != -1) {
Setsurfacemat(Alarm_surface0, Alarm_material);
Surfaceanim(Alarm_surface0, Alarm_fps, 0x1); } }
For(I=0;I<=4;I=I+1) { If(Door0 != -1) {
Movetoframe(Door0, Target_frame, Door_movespeed); } }
Settimer(Alarm_sleep); } } Stop;
Timer:
Stopsound(Alarm_Channel, 0.1);
Playsoundlocal(Power_out, 1.0, 0.0, 0x4);
Stop;
End



[This message has been edited by ~Rishka~ (edited November 14, 2001).]
2001-11-14, 10:51 AM #12
Hmmm... Well, yes, it does work fine, but I forgot to mention. I need it to stop the animation for about 40 textures.
DO NOT WANT.
2001-11-14, 1:38 PM #13
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Zell:
I need it to stop the animation for about 40 textures.</font>


As in 40 surfaces?

You could define them all in the cog, but that would be a pain. Add this to the cog after 'Damaged':


For(I=0;I<=Getsurfacecount();I=I+1) {
If(Getsurfaceflags(I) == 0x104) {
Stopsurfaceanim(I); } }

Then, set all the surface's surface flags this needs to have a affect on to '0x104'.

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

[This message has been edited by GBK (edited November 14, 2001).]
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!