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 → Shadow Jedi
Shadow Jedi
2002-07-16, 5:16 PM #1
How do you make shadow jedi? Help anyone?
2002-07-17, 2:04 PM #2
Explain, more detail is needed to help you. I don't understand when you mean 'shadow jedi'. [http://forums.massassi.net/html/confused.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-17, 6:33 PM #3
A shadow jedi, you know has all force powers etc...
2002-07-17, 6:43 PM #4
All Force Powers, that's easy. Doing that for The X Project. Changing the darkjedi cog with random numbers and stuff. Ex.
Code:
user0:
   // Don't start using force powers until message is received
   if(okay == 0) return;

   victim = GetParam(0);
   forcepower = GetParam(1);

   if(forcepower == 1)
   {
   choice = rand();
   if(choice < 0.45)
   {
      // Print("Force Power 1a : FORCE LIGHTNING...");
      FireProjectile(darkjedi, lightning, lightningSound, 35, '0 0 0', '0 0 0', 1.0, 0, autoAimFOV, autoAimMaxDist);
   }
   else
   if(choice < 0.65)
   {
      // Print("Force Power 1b : FORCE GRIP...");
      if(!IsInvActivated(victim, 29))
      {
         PlayMode(darkjedi, 24);
         SetActorFlags(darkjedi, 0x40000);
         Sleep(0.3);
         // He could die during the sleep
         if(GetThingHealth(darkjedi) <= 0) Return;

         SetActorFlags(victim, 0x40000);
         PlayMode(victim, 25);
         count = 0;
         limit = 5;
         forcepulse = 10;
         SetPulse(0.5);
      }
   }
   else
   {
      if(effectHandle == -1)
      {
         // Print("Force Power 1c : FORCE BLINDING...");
         PlayMode(darkjedi, 24);
         Sleep(0.3);
         // He could die during the sleep
         if(GetThingHealth(darkjedi) <= 0) Return;

         dummy = CreateThingAtPos(cone_tpl, GetThingSector(darkjedi), VectorAdd(GetThingPos(darkjedi), '0.0 0.0 0.04'), '0.0 0.0 0.0');
         SetThingLook(dummy, VectorSub(GetThingPos(victim), GetThingPos(darkjedi)));
         PlaySoundThing(blindingSound, darkjedi, 1.0, -1, -1, 0x80);

         // If the player doesn't have Seeing active.
         if(!IsInvActivated(victim, 23))
         {
            effectHandle = newColorEffect(0, 0, 0, 0, 0, 0, 180, 260, 230, 1.0);
            SetActorFlags(victim, 0x800);
            forcepulse = 7;
            SetPulse(5.0);
         }
      }
   }
   }
   else
   if(forcepower == 2)
   {
   choice = rand();
   if(choice < 0.5)
   {
      // Print("Force Power 2a : FORCE DESTRUCTION");
      AddDynamicTint(victim, 0.3, 0.0, 0.15);
      FireProjectile(darkjedi, destProj, destSound, 24, '0 0 0', '0 0 0', 1.0, 0, autoAimFOV, autoAimMaxDist );
   }
   else
   if(choice < 0.7)
   {
      // Print("Force Power 2b : FORCE DEADLY SIGHT...");
      PlayMode(darkjedi, 24);
      Sleep(0.3);

      // He could die during the sleep
      if(GetThingHealth(darkjedi) <= 0) Return;

      SetActorFlags(darkjedi, 0x40000);

      // Play activation sound
      PlaySoundThing(deadlySound, victim, 1.0, -1, -1, 0x80);

      // Play loop sound at 0.0 volume and fade it in to 1.0 volume in 0.75 secs
      channel = PlaySoundThing(deadlySound2, victim, 0.0, -1, -1, 0x81);
      if(channel != -1) ChangeSoundVol(channel, 1.0, 0.75);

      count = 0;
      limit = 16;
      forcepulse = 14;
      SetPulse(0.5);
   }
   else
   {
      // Print("Force Power 2c : FORCE PERSUASION...");
      PlayMode(darkjedi, 24);
      Sleep(0.3);
      // He could die during the sleep
      if(GetThingHealth(darkjedi) <= 0) Return;

      SetActorFlags(darkjedi, 0x80);
      SetThingCurGeoMode(darkjedi, 0);
      jkSetFlags(darkjedi, 0x20);
      forcepulse = 6;
      SetPulse(10.0);
   }
   }
   else
   if(forcepower == 3)
   {
      // Print("Force Power 3 : FORCE PULL");
      if(!IsInvActivated(victim, 28))
      {
         forcepulse = 4;
         SetPulse(0.1);
      }
   }

   Return;

# ........................................................................................

pulse:
   if(forcepulse == 4)                       // FORCE PULL
   {
      SetPulse(0);
      if(GetHealth(victim) > 0)
      {
         if((GetCurWeapon(victim) != 1) && (GetCurWeapon(victim) != 10))
         {
            PlayMode(darkjedi, 36);
            Sleep(0.3);

            PlaySoundThing(pullSound, victim, 1.0, -1, -1, 0x80);

            // Create a powerup corresponding to the current weapon
            PulledWeapon = CreateThingAtPos(tpl[GetCurWeapon(victim)], GetThingSector(victim), GetThingPos(victim), '0 0 0');

            // Set the created powerup to no collide for now...
            SetCollideType(PulledWeapon, 0);

            // ...and set a timer to make it collide again later
            SetTimerEx(0.3, 1, PulledWeapon, 0);

            // Throw the powerup at the DJ
            ApplyForce(PulledWeapon, VectorScale(VectorNorm(VectorSub(GetThingPos(darkjedi), GetThingPos(victim))), 30));

            // Remove the weapon from the player
            ChangeInv(victim, GetCurWeapon(victim), -1);

            SelectWeapon(victim, 1);
         }
      }
   }

   if(forcepulse == 6)
   {
      ClearActorFlags(darkjedi, 0x80);
      jkClearFlags(darkjedi, 0x20);
      SetThingCurGeoMode(darkjedi, GetThingGeoMode(darkjedi));
      SetPulse(0);
   }

   if(forcepulse == 7)
   {
      if(effectHandle!=-1)
      {
         freeColorEffect(effectHandle);
         effectHandle = -1;
         AddDynamicAdd(victim, 180, 260, 230);
      }
      ClearActorFlags(victim, 0x800);
      SetPulse(0);
   }

   if(forcepulse == 10)                      // FORCE GRIP
   {
      if((count > limit) ||
         (GetThingHealth(darkjedi) < starthealth) ||
         (GetHealth(victim) < 1) ||
         !HasLOS(darkjedi, victim)
        )
      {
         ClearActorFlags(victim, 0x40000);
         ClearActorFlags(darkjedi, 0x40000);
         SetPulse(0);
         Return;
      }

      // Print("You are taking Grip damage");
      jkPrintUNIString(victim, 300);

      DamageThing(victim, 5, 0x8, darkjedi);

      if(griptrackID != -1)
      {
         StopKey(player, griptrackID);
         griptrackID = -1;
      }
      count = count + 1;
   }

   if(forcepulse == 14)                      // FORCE DEADLY SIGHT
   {
      if((count > limit) ||
         (GetThingHealth(darkjedi) < starthealth) ||
         (GetHealth(victim) < 1) ||
         !HasLOS(darkjedi, victim)
        )
      {
         SetPulse(0);
         ClearActorFlags(darkjedi, 0x40000);
         if(channel != -1)
         {
            StopSound(channel, 0.0);
            channel = -1;
         }
         Return;
      }

      // Print("You are taking Deadly Sight damage");
      jkPrintUNIString(player, 301);
      DamageThing(victim, 5, 0x8, darkjedi);
      smoke = CreateThingAtPos(smoke_tpl, GetThingSector(victim), GetThingPos(victim), '0 0 0');

      count = count + 1;

      // Add a tint if the victim is in 1st person view
      if((victim == GetLocalPlayerThing()) && (GetCurrentCamera() == 0))
      {
         AddDynamicTint(victim, 0.3, 0.0, 0.15);
      }
   }

   Return;

# ........................................................................................

timer:
   if(GetSenderId() == 1)                    // Pull
   {
      // A pulled weapon must be made takeable again
      SetCollideType(GetParam(0), 1);

      // Set gravity to them so they don't float around
      SetPhysicsFlags(GetParam(0), 1);

      // Make the powerup last hours
      SetLifeLeft(GetParam(0), 36000);
   }
   if(GetSenderId() == 2)                    // blinding protection
   {
      // This makes the DJ nearly immune to blinding
      // by removing the blind flag every 3 seconds
      ClearActorFlags(darkjedi, 0x800);
      SetTimerEx(3, 2, 0, 0);
   }

   Return;
I used the darkjedi_jerec.cog as a base. You need to add the symbols, but that's easy. This is just a exert, but you can use it a base. You could also make it a class cog, I think...

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-18, 3:14 AM #5
OK, umm I am no good with stuff like that... Would you mind mailing me it or somthing? If so my e-mail is ReallySmellySocks@hotmail.com [http://forums.massassi.net/html/redface.gif]

↑ Up to the top!