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 → Forcefeild cog
Forcefeild cog
2001-11-06, 9:28 PM #1
The ones that LEC give don't work with what I want. Simply a want a force feild activated by one swith and deactivated by another. also, When the forcefeild is up it should always be seen Translucent(sp?). if you could post the cog here or e-mail me at TerraKitten@hotmail.com. I thank you in advance for any help given.
2001-11-07, 5:28 AM #2
This should do the trick...


 

# 11/2001 GBK
Symbols
Message Activated
Message Touched
Message Timer
Surface Switch_on
Surface Switch_off
Surface Field_0 LinkID=1
Surface Field_1 LinkID=1
Template Smoke
Flex Field_damage
Sound Field_on
Sound Field_off
Sound Field_ambient
Sound Field_hit
Int Field_channel=-1 Local
Thing Victem=0 Local
Int Lock=0 Local
End
Code
Activated:
If((Getsenderref() == Switch_on) && (Lock == 0)) { Lock=1; Call Field__On; }
Else If((Getsenderref() == Switch_off) && (Lock == 1)) { Lock=0; Call Field__off; } Stop;
Touched:
If(GetsenderID() == 1) {
Victem = Getsourceref(); Damagething(Victem, Field_damage, 0x4, Victem);
Creatething(Smoke, Victem); Playsoundthing(Field_hit, Victem, 1.0, 0.5, 10.0, 0x4); } Stop;
Field__on:
Playsoundpos(Field_on, Getsurfacecenter(Field_0), 1.0, 1, 10, 0x0);
Setwallcel(Switch_on, 1); SettimerEX(Getsoundlen(Field_on), 101, 0, 0);
Setfacetype(Field_0, 0x2);
Setfacetype(Field_1, 0x2);
Clearadjoinflags(Field_0, Getadjoinflags(Field_0));
Clearadjoinflags(Field_1, Getadjoinflags(Field_1));
Setadjoinflags(Field_0, 0x5);
Setadjoinflags(Field_1, 0x5);
Setfacegeomode(Field_0, 0x4);
Setfacegeomode(Field_1, 0x4);
Setsurfaceflags(Field_0, 0x4004);
Setsurfaceflags(Field_1, 0x4004);
Field_channel = Playsoundpos(Field_ambient, Getsurfacecenter(Field_0), 1.0, 1, 10, 0x1);
Stop;
Field__off:
Stopsound(Field_channel, 0.1);
Setfacetype(Field_0, 0x0);
Setfacetype(Field_1, 0x0);
Setadjoinflags(Field_0, 0x7);
Setadjoinflags(Field_1, 0x7);
Setfacegeomode(Field_0, 0x0);
Setfacegeomode(Field_1, 0x0);
Playsoundpos(Field_off, Getsurfacecenter(Field_0), 1.0, 1, 10, 0x0);
Setwallcel(Switch_off, 1); SettimerEX(Getsoundlen(Field_off), 102, 0, 0);
Stop;
Timer:
If(GetsenderID() == 101) { Setwallcel(Switch_on, 0); }
If(GetsenderID() == 102) { Setwallcel(Switch_off, 0); } Stop;
End

 

It works, I tested it.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-07, 8:46 AM #3
Hmmmm It doesn't work for me... when I hit the switch Jk crashes...
2001-11-07, 10:30 AM #4
Works for me, its problably an installation error on your part. Try re-applying the cog.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-07, 11:49 AM #5
Hmmm it is half working now.. But another problem.. when the forcefeild is off the surfaces still show as solid color, all surfaces are set right Geo 0 so why are they showing up?
2001-11-07, 11:56 AM #6
The surfaces does not require any specific treatment, the cog sets evrything. simply select 2 fresh adjoins, and apply the cog to them.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-07, 1:38 PM #7
GBK needs to add "It works, i tested it" to his sig [http://forums.massassi.net/html/smile.gif]
2001-11-07, 3:28 PM #8
I might just do that... [http://forums.massassi.net/html/tongue.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-07, 3:59 PM #9
Ahh I love you GBK, you save me alot of time writing out these cogs [http://forums.massassi.net/html/smile.gif]
2001-11-07, 4:41 PM #10
no no, I didn't edit the surface. All i did was ad the cog to the surfaces. Then they messed up, I took the cog off the surfaces and they still stay solid in game, even tho they are flagged to be invisable
2001-11-07, 5:36 PM #11
Ahh, change the surface material. That will fix it.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-07, 5:39 PM #12
If your still having trouble with the cog, I send you my project dir...

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-07, 5:40 PM #13
Hmm I fit isn't any trouble could you send it? That way I can see what I messed up.
2001-11-07, 6:06 PM #14
Hope this helps...

Click me.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-07, 8:40 PM #15
I'm not sure what I did wrong before but it works now, I just put all the settings the same as you had and it worked, thanks for your help.
2001-11-07, 8:48 PM #16
Glad I could help... [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.

↑ Up to the top!