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 → force field vire switch cog....
force field vire switch cog....
2001-04-28, 11:24 AM #1
I wanted a cog that turned a force field on. the 10_ffieldswitch doesnt do this, the force field is already on. I wanted to turn it on rather than turn it off.

I hope that made sence.

Also could you tell me how to make the cogs people post in this forum. THanks



[This message has been edited by sammyLSD (edited April 28, 2001).]
My Site
2001-04-29, 10:12 AM #2
Was that last question to explain the entire COG language?! Start here.

------------------
"I am Murray, the all powerful demonic skull, BWAHAHAHAHAHA!"-Murray
Viva la Monkey Island!

[This message has been edited by DemonicMurray1 (edited April 29, 2001).]
"I am Murray, the all powerful demonic skull, BWAHAHAHAHAHA!"-Murray
Viva la Monkey Island!
2001-04-29, 11:22 AM #3
Sorry i didnt make myself clear. When people post cogs in this fourm, how do you turn it into a .cog file.
My Site
2001-04-29, 1:07 PM #4
Copy the text, paste it into a text editor, and save it as cogname.cog

------------------
Together we stand.
Divided we fall.
2001-04-30, 5:27 PM #5
Here's the 10_FFieldSwitch.cog modified to have the force field OFF or ON at the start. All that needed to be done was change the startup code section by adding a check for a new fieldon variable. When you add the cog in JED leave fieldon as 0 for off and change it to 1 for the normal on at start. I haven't tested this, let me know if it doesn't work right. You probably know that this cog works with textured mats.

I have a different version of the forcefield cog on my website: http://www.lactarius.com/sylvicolus/jk/cogother.htm

Code:
# 10_FFieldFlip.cog
# Jedi Knight Cog Script
#
# This is 10_FFieldSwitch.cog modified to be off or on at start.
#
# If you want the field on at start then in JED enter 1 for fieldon.
# Otherwise field will be off at start of game.
#
# this script activates a forcefield that damages a player on touch.
# also sets this surface to be nomove and translucent.
# Shooting or activating switch will turn it on or off.
#
# Not supported by LucasArts Entertainment Co.


symbols

message     startup
message     damaged
message     activated
message     touched
message     timer

surface     switch                        linkid=1 mask=0x448
surface     damsurf                       mask=0x448
surface     damsurf2                      mask=0x448

flex        maxdamage=10.0
flex        mindamage=5.0
flex        damage=0.0                    local

sound       powerup=ForceFieldOn01.wav    local
sound       powerdown=ForceFieldOff01.wav local
sound       wav0=ForceFieldHum01.wav      local
sound       wav1=ForceFieldHit01.wav      local

int         garbage=0                     local
int         fieldon=0   

thing       victim                        local

end


code
startup:
   sleep(0.5);
   SetWallCel(switch,0);                  //on
   ClearAdjoinFlags(damsurf,10);          //no move
   ClearAdjoinFlags(damsurf2,10);
   SetFaceGeoMode(damsurf,0);             //translucent
   SetFaceGeoMode(damsurf2,0);
   SetSurfaceFlags(damsurf,16384);        //magsealed
   SetSurfaceFlags(damsurf2,16384);
   if (!fieldon) {
      SetWallCel(switch,1);                     //off
      SetAdjoinFlags(damsurf,10);               //move
      SetAdjoinFlags(damsurf2,10);
   }
   return;

activated:
   if (GetSenderID() != 1) return;

   if (GetWallCel(switch) == 0)
   {
      SetWallCel(switch,1);                     //off
      PlaySoundLocal(powerdown, 1, 0, 0);
      SetAdjoinFlags(damsurf,10);               //move
      SetAdjoinFlags(damsurf2,10);
   }
   else if (GetWallCel(switch) == 1)
   {
      SetWallCel(switch,0);                     //on
      PlaySoundLocal(powerup, 1, 0, 0);
      ClearAdjoinFlags(damsurf,10);             //no move
      ClearAdjoinFlags(damsurf2,10);
   }
   return;

touched:
   if ((GetSenderRef() == damsurf) || (GetSenderRef() == damsurf2))
   {
      victim = GetSourceRef();
      damage = (Rand()*(maxdamage - mindamage))+mindamage;
      garbage = DamageThing(victim, damage, 0x4, victim);
      PlaySoundPos(wav1, GetSurfaceCenter(damsurf), 0.5, 1, 10, 0);
      call fieldflash;
   }
   Return;

damaged:
   if (GetSenderID() == 1)
   {
      call activated;
   }
   else
   {
      call fieldflash;
   }
   return;

timer:
   SetFaceGeoMode(damsurf,0);
   SetFaceGeoMode(damsurf2,0);
   Return;

fieldflash:
      SetFaceGeoMode(damsurf,4);
      SetFaceGeoMode(damsurf2,4);
      KillTimerEx(1);
      SetTimerEx(0.5, 1, 0, 0);
      return;

end


------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2001-05-02, 10:43 AM #6
Thanks!
My Site

↑ Up to the top!