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 → Can I? Will you?
Can I? Will you?
2001-09-15, 4:31 PM #1
Ok, I asked for this cog a LONG time ago but it was at Cog Warehouse and as most of you know, its gone. Well, now's when I need it. I need a little assistance. I just need somebody to take the standard Persuasion cog and modify it a bit. I'm not 100% sure it can be dont but here goes. I want it to be modified so it can be turned on and off whenever you want by activating it. Second I want it to be so you can still target somebody even though they are invisible. So it would look like there are just those little recticle circles floating in air. Is that possible? Well if it isn't just leave off the targeting part. Thanks ahead of time.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-09-15, 6:30 PM #2
It's all possible, but I can't do it (don't have JK stuff anymore). Anyway, Cog Warehouse should be back up soon on a GOOD host.
2001-09-15, 6:44 PM #3
CW should be up soon, but here's the cog, not tested, but it should work. They aren't able to be targeted, though.:
Code:
# Jedi Knight Cog Script
#
# FORCE_PERSUASION.COG
#
# FORCEPOWER Script - Persuasion
#  Light Side Power
#  Bin 26
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

thing       player                           local

flex        mana                             local
flex        cost=250.0                       local
int         rank                             local
int         on=0      local

sound       persuasionSound=ForcePersuas01.WAV  local
sound       persuasionSound2=ForcePersuas02.WAV local
int         channel=-1                       local

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

end

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

code

startup:
   player = GetLocalPlayerThing();
   call stop_power;

   Return;

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

activated:
if(on)
{
   on = 0;
   call stop_power;
   return;
}
   if(!IsInvActivated(player, 26))
   {
      mana = GetInv(player, 14);
      if(mana >= cost)
      {
         if(GetInv(player, 65) != 1) ChangeInv(player, 14, -cost);
         SetInvActivated(player, 26, 1);

         PlayMode(player, 24);

         // Play activation sound
         PlaySoundThing(persuasionSound, player, 1.0, -1, -1, 0x80);
         on = 1;

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

         rank = GetInv(player, 26);
         SetTimerEx(rank * 10, 1, 0, 0);

         // Set player invisible to AI
         SetActorFlags(player, 0x80);

         // Set player "invisible" to real players
         if(rank == 1) jkSetPersuasionInfo(player, 14, 22);
         else if(rank == 2) jkSetPersuasionInfo(player, 11, 19);
         else if(rank == 3) jkSetPersuasionInfo(player, 8, 16);
         else if(rank == 4) jkSetPersuasionInfo(player, 5, 13);

         SetThingCurGeoMode(player, 0);
         jkSetFlags(player, 0x20);

         SetPulse(0.5);
      }
   }

   Return;

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

timer:
   call stop_power;

   Return;

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

pulse:
   if(GetThingHealth(player) < 1) call stop_power;

   Return;

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

selected:
   jkPrintUNIString(player, 26);
   Return;

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

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

newplayer:
   call stop_power;

   Return;

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

stop_power:
   SetPulse(0);
   KillTimerEx(1);
   if(channel != -1)
   {
      StopSound(channel, 0.1);
      channel = -1;
   }
   SetInvActivated(player, 26, 0);
   ClearActorFlags(player, 0x80);
   SetThingCurGeoMode(player, GetThingGeoMode(player));
   jkClearFlags(player, 0x20);

   Return;

end
Capitalization
Commas
Periods
Question Marks
Apostrophes
Confusable Words
Plague Words
2001-09-16, 11:40 AM #4
Thanks lordvader! I really appreatiate it. I'll get back to you in a few minutes to see whether it works or not.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-09-16, 11:51 AM #5
Ok, you got one part right. The part about activating and deactivating works perfectly. I want it to slowly drain your mana while its on. If it already does and I haven't noticed, sorry. But I need that cog to also drain your mana slowly while its on. When you turn the power off, its quit draining mana.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-09-17, 9:32 AM #6
CW should be up soon, but here's the cog, not tested, but it should work. They aren't able to be targeted, though.:
Code:
# Jedi Knight Cog Script
#
# FORCE_PERSUASION.COG
#
# FORCEPOWER Script - Persuasion
#  Light Side Power
#  Bin 26
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

thing       player                           local

flex        mana                             local
flex        cost=250.0                       local
int         rank                             local
int         on=0      local

sound       persuasionSound=ForcePersuas01.WAV  local
sound       persuasionSound2=ForcePersuas02.WAV local
int         channel=-1                       local

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

end

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

code

startup:
   player = GetLocalPlayerThing();
   call stop_power;

   Return;

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

activated:
if(on)
{
   on = 0;
   call stop_power;
   return;
}
   if(!IsInvActivated(player, 26))
   {
      mana = GetInv(player, 14);
      if(mana >= cost)
      {
         if(GetInv(player, 65) != 1) 
         SetInvActivated(player, 26, 1);

         PlayMode(player, 24);

         // Play activation sound
         PlaySoundThing(persuasionSound, player, 1.0, -1, -1, 0x80);
         on = 1;

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

         rank = GetInv(player, 26);
         SetTimerEx(rank * 10, 1, 0, 0);

         // Set player invisible to AI
         SetActorFlags(player, 0x80);

         // Set player "invisible" to real players
         if(rank == 1) jkSetPersuasionInfo(player, 14, 22);
         else if(rank == 2) jkSetPersuasionInfo(player, 11, 19);
         else if(rank == 3) jkSetPersuasionInfo(player, 8, 16);
         else if(rank == 4) jkSetPersuasionInfo(player, 5, 13);

         SetThingCurGeoMode(player, 0);
         jkSetFlags(player, 0x20);

         SetPulse(0.5);
      }
   }

   Return;

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

timer:
   call stop_power;

   Return;

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

pulse:
   if(GetThingHealth(player) < 1) call stop_power;
ChangeInv(player, 14, -1);
if(GetInv(player, 14) < 1)
{
   call stop_power;
}

   Return;

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

selected:
   jkPrintUNIString(player, 26);
   Return;

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

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

newplayer:
   call stop_power;

   Return;

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

stop_power:
   SetPulse(0);
   KillTimerEx(1);
   if(channel != -1)
   {
      StopSound(channel, 0.1);
      channel = -1;
   }
   SetInvActivated(player, 26, 0);
   ClearActorFlags(player, 0x80);
   SetThingCurGeoMode(player, GetThingGeoMode(player));
   jkClearFlags(player, 0x20);

   Return;

end


[This message has been edited by lordvader (edited September 17, 2001).]
Capitalization
Commas
Periods
Question Marks
Apostrophes
Confusable Words
Plague Words

↑ Up to the top!