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 → Need another cog.
Need another cog.
2001-06-08, 6:46 AM #1
Man, I wish I understood cog more so i wouldn't have to ask all the time, well anyway I naad a cog that will create lightning at a ghost position for a certain amount of time when activated by a switch.
So, you activate a switch, lightning comes from a ghost position for a specified amount of time and after the time is reached it stops. It's for MP.
Thanks in advance.

------------------
True life shimmers with the light of diamonds.
A fake life is as black as coal.
------------------
I miss my X-wife,
but my aim is getting better.
------------------
It's really gonna hit the fan now!
------------------
The only thing I've learned from school is
1. Teachers punish in groups, and
2. School is pointless.
------------------
Visit the stormtroopertemple
2001-06-08, 12:35 PM #2
Here ya go.

Code:
symbols
   message  startup
   message  activate
   message  pulse

   thing    ghost0
   surface  switch0                     

   int      fireChannel0                     local
   int      fireChannel1                     local
   int      fireChannel2                     local
   int      flag=0                           local
   int      dummy                            local
   flex		autoAimXFOV=60							local
   flex     autoAimZFOV=60                   local
   template lightning=+force_lightning       local
   sound    fireSound=LTSaberHit05.wav       local
   sound    butnsound=Activate04.wav         local

end

# Code Section

code

//-------------------------------------------------------------------------------------------------

startup:
   SetWallCel(switch0, 0);
   return;

//-------------------------------------------------------------------------------------------------

activate:
   if (GetWallCel(switch0) == 1)
      {
         PlaySoundPos(butnsound, SurfaceCenter(switch0), 1, -1, -1, 0);
         SetWallCel(switch0, 0);
         flag = 0;
         SetPulse(0.5);
      }
   else if (GetWallCel(switch0) == 0)
      {
         PlaySoundPos(butnsound, SurfaceCenter(switch0), 1, -1, -1, 0);
         SetWallCel(switch0, 1);
         flag = 1;
         SetPulse(0);
      }
   return;

//-------------------------------------------------------------------------------------------------

pulse:

time=time+.5;

if(time == whatsecondtimeyouwanthere) 
{
         PlaySoundPos(butnsound, SurfaceCenter(switch0), 1, -1, -1, 0);
         SetWallCel(switch0, 1);
         flag = 1;
	   SetPulse(0);
	   time=0;
}
else if (ghost0 >= 0)
      {
       dummy = FireProjectile(ghost0, lightning, fireSound, 24, '0 0 0', '0 0 0', 1.0, 0x60, autoAimXFOV, autoaimZFOV);
      }

   return;

end


[EDIT: Forgot to put [/CODE] in [http://forums.massassi.net/html/smile.gif]]

[This message has been edited by *_Seifer_* (edited June 08, 2001).]

↑ Up to the top!