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 → Particle CODE?
Particle CODE?
2001-06-05, 5:11 AM #1
You know the "code" for firing a projectile in a SendTrigger cog? Its like dummy = (FireProjectile, blah, blah, blah);. Well I'm trying to make it so whenever I target somebody with a Force power like Grip, a template appears around them. I know how to make the template appear around them but how do I do it in a SendTrigger cog?
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-05, 11:13 AM #2
Not trying to be rude or anything but will somebody please help? My patch needs to be released soon. Help. Thanks.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-05, 11:17 AM #3
at the guy your choking or at the one doing to choking
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-06-05, 11:24 AM #4
The guy being choked. If you have any ideas, thanks Han.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-06, 10:54 AM #5
Does anybody know?
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-06, 12:34 PM #6
I can't understand what you mean.
Capitalization
Commas
Periods
Question Marks
Apostrophes
Confusable Words
Plague Words
2001-06-06, 1:10 PM #7
put a createthingatpos in a pulse message
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2001-06-06, 2:30 PM #8
Put this in grip once it's found a legal target.

SendTrigger(-1, 250, victim, -1, -1, -1)

Then in the trigger.cog

if(getsourceref() == 250)
{
dummy=CreateThingAtPos(particals, getparam(0));
}
2001-06-06, 3:00 PM #9
*_Seifer how long have you been cogging? I would say you r one of the best because you are one of the only people that I know ever help me. Thanks Seifer!
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-07, 6:56 AM #10
Every time I add that sendtrigger message it just makes it so I can't target anybody.

[This message has been edited by LordX-T_IJ (edited June 07, 2001).]
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-07, 11:38 AM #11
Np , About a year now ..... lol , did you just copy and paste my code , I forgot on SendTrigger to put a ";" at the end. Try putting that in and see if it works. The reason the whole cog shut down was because it was a sytax error. [http://forums.massassi.net/html/smile.gif]
2001-06-07, 5:22 PM #12
My god, I would never have relaized that! *smacks forehead*. Thanks Seifer! Thank you! Thank you! Thank you!
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-07, 5:31 PM #13
Np dude [http://forums.massassi.net/html/smile.gif]
2001-06-07, 5:54 PM #14
Seifer I hate to bother you again but you said to place that line "after it has found a legal target". Well I can't seem to find that line.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-08, 12:02 AM #15
No problem , On the deactivated message it will have ...


if(mana >= cost)
{
if(HasLOS(player, victim)) // check that we still have a LOS on it...

Put it after that, it's a "legal" target because it's an actor or player and we have los on it and we have enough mana.
2001-06-12, 2:41 PM #16
Hmmm... Still nothing.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-12, 10:41 PM #17
Thats strange , post the whole cog here ...
2001-06-13, 6:18 PM #18
Code:
# Jedi Knight Cog Script
#
# FORCE_GRIP.COG
#
# FORCEPOWER Script - The Grip
#  Dark Side Power
#  Bin 31
#
# This power chokes the enemy in the target cone, slowly causing damage.
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

thing       player                           local
thing       victim                           local
thing       potential                        local

flex        cost=60.0                        local
flex        mana                             local
flex        dot                              local
flex        maxDot                           local
flex        damage                           local
flex        starthealth                      local
int         rank                             local
int         retval=0                         local

sound       gripSound=ForceGrip01.WAV        local

int         limit                            local
int         count                            local

int         active=0                         local
int         targetting=0                     local

message     startup
message     activated
message     deactivated
message     pulse
message     timer
message     newplayer
message     killed
message     selected
message     deselected

end

# ========================================================================================

code

startup:
   player = GetLocalPlayerThing();

   SetInvActivated(player, 31, 0);

   Return;

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

activated:
   // Cannot use power if blinded
   if(GetActorFlags(player) & 0x800) Return;

   if(active) Return;

   mana = GetInv(player, 14);
   if(mana >= cost)
   {
      victim = -1;
      active = 1;
      targetting = 1;
      SetPulse(0.33);
   }
   Return;

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

deactivated:
   // If no victim was found just cleanup and exit
   if((victim == -1) || (GetThingHealth(player) <= 0) || !active)
   {
      call stop_power;
      Return;
   }

   SetPulse(0);
   jkEndTarget();
   targetting = 0;

   mana = GetInv(player, 14);
   if(mana >= cost)
   {
      if(HasLOS(player, victim))             // check that we still have a LOS on it...
      {
         SendTrigger(-1, 250, victim, -1, -1, -1);
	 SetBinWait(player, 31, rank + 0.5);

         PlayMode(player, 24);
         if(GetInv(player, 64) != 1) ChangeInv(player, 14, -cost);
         rank = GetInv(player, 31);
         limit = rank * 2;
         starthealth = GetThingHealth(player);

         if(GetThingType(victim) == 10)
         {
            // Multiplayer enemies
            if(!(GetThingFlags(victim) & 0x200))
            {
               retval = SkillTarget(victim, player, 31, rank);
               SetPulse(0.1);
               count = 0;
               SetInvActivated(player, 31, 1);
            }
            else
            {
               Return;
            }
         }
         else
         {
            damage = SkillTarget(victim, player, 31, 0);

            if(damage > 0.0)
            {
               // Play choke animation on the victim.
               PlayMode(victim, 25);
               SetPulse(0.1);
               count = 0;
               SetInvActivated(player, 31, 1);
            }
         }
      }
   }

   Return;

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

pulse:
   if(targetting == 1)
   {
      // Check all things for our victim.
      victim = -1;
      maxDot = 0;

      // Search for all players and actors.
      potential = FirstThingInView(player, 70, 4, 0x404);
      while(potential != -1)
      {
         if(
            HasLOS(player, potential) &&
            (potential != player) &&
            (VectorDist(GetThingPos(player), GetThingPos(potential)) <= 1) &&
            !(GetThingFlags(potential) & 0x200) &&
            !(GetActorFlags(potential) & 0x100) &&
            !((jkGetFlags(potential) & 0x20) && !IsInvActivated(player, 23))
           )
         {
            if(!BitTest(GetActorFlags(potential), 0x100))
            {
               dot = ThingViewDot(player, potential);
               if(dot > maxDot)
               {
                  victim = potential;
                  maxDot = dot;
               }
            }
         }
         potential = NextThingInView();
      }

      // If we have a victim...
      if(victim != -1)
      {
         jkSetTargetColors(6, 7, 8);
         jkSetTarget(victim);
      }
      else
      {
         jkEndTarget();
      }
   }
   // this is the real Grip pulse
   else
   {
      if((count > limit) ||
         (GetThingHealth(player) < starthealth) ||
         (GetActorFlags(player) & 0x800) ||
         (GetThingFlags(victim) & 0x200)
        )
      {
         call stop_power;
         Return;
      }

      if(HasLOS(player, victim))
      {
         if(GetThingType(victim) == 10)      // OTHER PLAYER
         {
            // everything is done in the victim's KYLE.COG handler
            if(!(GetThingFlags(victim) & 0x200))
               retval = SkillTarget(victim, player, 31, rank);
         }
         else                                // ENEMY
         {
            DamageThing(victim, damage * rank / 5.0, 0x8, player);
            // Force the victim to stay in place
            SetActorFlags(victim, 0x40000);
            // But prepare to free it again in 0.45 seconds
            SetTimerEx(0.45, victim, GetThingSignature(victim), 0);
         }

         PlaySoundThing(gripSound, victim, 1.0, -1, -1, 0x80);
         count = count + 1;
         SetPulse(0.5);
      }
      else
      {
         // break the power if LOS is lost
         call stop_power;
      }
   }

   Return;

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

timer:
   // This checks that the thing ref is still assigned to the same thing
   if(GetThingSignature(GetSenderId()) == GetParam(0))
   {
      ClearActorFlags(GetSenderId(), 0x40000);
   }

   Return;

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

selected:
   jkPrintUNIString(player, 31);
   Return;

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

deselected:
   call stop_power;

   Return;

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

killed:
   if(GetSenderRef() != player) Return;

newplayer:
   call stop_power;

   Return;

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

stop_power:
   SetPulse(0);
   SetInvActivated(player, 31, 0);
   targetting = 0;
   victim = -1;
   active = 0;
   jkEndTarget();

   Return;

end


Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-16, 12:56 PM #19
Any ideas Seifer?
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-18, 4:14 PM #20
Anybody?
Ohh Crap! - Darien Fawkes (The Invisible Man)

↑ Up to the top!