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 → easy, unrelated COG problem (I swear...)
easy, unrelated COG problem (I swear...)
2004-01-12, 1:12 PM #1
I'm thinking that...
a. Everyone here has grown to despise me (because of the actions of my 'little brother', honest!)
b. My COG-related conundrums are far too complex for mere mortals to comprehend.
c. None of the COG savants have swept through here in the past 24 hours.
(or a combination of some or all, like all the COG savants despise me because my problems are too complex!)

This is a general editing/cog related problem, but since it's more cog oriented, I'm posting it here.

One of the main points in Life of Grismath level 1 was the use of a warhammer holdover from the Rites of Xanthus TC. After hours of painstaking work, I got the weapon to work once more ingame, actually damage people, and be comaptible with my custom master cog.

Here's the catch:

I can't seem to give the player the hammer (which replaces the crossbow) in-game through COG. I thought I was real clever, and as I was typing this, I tried to do it all with triggers and pickups, but noooo.

it works in-game, and when I use 'diediedie' to get all weapons, I can mount it manually. But otherwise, it doesn't show up. I thought it had something to do with the ammo, so I gave myself full ammo, and still no luck.

Code:
trigger:
if(GetSourceRef()==1337) {
 status=1;
 adventure=GetMasterCog();
 SendMessage(adventure, user0);
 player=GetLocalPlayerThing();
 SetInv(player, 12, 1);
 SetInvAvailable(player, 135, 1);
 SetInv(player, 135, 1.0);
 SelectWeapon(player, 135);
 SetCurWeapon(player, 5);
 ParseArg(player, "puppet=ky.pup");
 SetCameraFocus(0, player);
 SetCurrentCamera(0);
}
return;


[EDIT: The pup does change and is most definitely unrelated to the problem, answering an IM question by Ruthven.]

That's in one of the cogs. If any code would help you to fix this,a sk for specifics and I'll post it. But I don't know where to start anymore, let alone who i am. This has jellified my mind.

[This message has been edited by Lord_Grismath (edited January 12, 2004).]
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-01-13, 5:03 AM #2
You're problem's doesn't seem to be that hard - if you're questions aren't getting answered, you should try rephrasing them so that they're more specific. If I have to skip over a someone's post, it's most often because I don't have time to write out a whole cog.

----------------

So your weapon doesn't show up? You mean it doesn't show up when you try to mount it?

Your trigger code is supposed to give the player a weapon in bin 135, and then make him use it, right? So why is SetCurWeapon() using weapon 5? If that's supposed to be the same as the weapon bin, then you'll need to put 11 for the 11'th weapon (it's not a bin number).

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2004-01-13, 1:33 PM #3
I'm glad you've clarified that SM [http://forums.massassi.net/html/smile.gif] - there was another instance of something like this (Tazz, I think, was the topic starter), which involved a certain level of ambiguity with the contents of the DataMaster, with regard to SetCurWeapon()... that is if memory serves me correctly... [http://forums.massassi.net/html/redface.gif]

Perhaps you could possibly clear this question up with the next release of the DataMaster? *hints* [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/smile.gif]

Hope this has helped (someone/anyone?) [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
"lucky_jackpot is the smily god..." - gothicX

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2004-01-13, 11:40 PM #4
Quote:
<font face="Verdana, Arial" size="2">Your trigger code is supposed to give the player a weapon in bin 135, and then make him use it, right? So why is SetCurWeapon() using weapon 5? If that's supposed to be the same as the weapon bin, then you'll need to put 11 for the 11'th weapon (it's not a bin number).</font>


I thought that the crossbow was weapon 5? I tried SetCurWeapon(player, 11);, and that didn't work either. Also, after the weapon is 'set' but nothing shows up, when I press G to cycle through the weapons, MotS freezes.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-01-13, 11:46 PM #5
Perhaps there is some error in the selected message for the hammer cog? I'm far too rusty to write my own weapon cog for the hammer at this point, so I'm using an ever-so-slightly modified version of the original RoX warhammer cog:

Code:
# Jedi Knight Missions Cog Script
#
# WEAP_SABER_M.COG MODIFIEd BY BEL IBLIS
# ========================================================================================


symbols

message  startup
message  activated
message  deactivated
message  selected
message  deselected
message  user0
message  newplayer
message  autoselect
message  timer
message  fire
message  killed
message	joined

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

model    povModel=bowv.3do             local
model    povModel_m=bowv.3do         local
model    saberMesh=bowg.3do            local

# ........................................................................................
# POV animations

keyframe mountAnim=SabVmnt.key         local
keyframe dismountAnim=SabVdis.key      local
keyframe holdAnim=SabVhold.key         local

keyframe povSnapAnim1=SabVf1.key       local
keyframe povSnapAnim2=SabVf2.key       local
keyframe povSnapAnim3=SabVf1.key       local

keyframe povPreFireAnim=SabVrdy.key    local
keyframe povFireAnimF1=SabVsnp1.key    local
keyframe povFireAnimF2=SabVsnp2.key    local
keyframe povFireAnimB1=SabVb1.key      local
keyframe povFireAnimB2=SabVb2.key      local
keyframe povFireAnimL1=SabVl1.key      local
keyframe povFireAnimR1=SabVr1.key      local
keyframe povChargeAnim=SabVch.key      local

keyframe povPreBlockAnim=SabVblk.key   local

# ........................................................................................
# External animations

keyframe preFireAnimL=KYreadyl.key     local
keyframe preFireAnimR=KYreadyr.key     local
keyframe fireAnimF1=KYsabrf1.key          local
keyframe fireAnimF2=KYsabrf2.key          local
keyframe fireAnimB1=KYsabrb1.key       local
keyframe fireAnimB2=KYsabrb2.key       local
keyframe fireAnimL1=KYsabrl1.key       local
keyframe fireAnimR1=KYsabrr1.key       local

keyframe snapAnim1=KYsabrf1.key           local
keyframe snapAnim2=KYsabrf2.key        local
keyframe snapAnim3=KYsabrf1.key        local
keyframe chargeAnim=mauls.key       local

keyframe preBlockAnim=KYblock.key      local
keyframe holsterAnim=kyhlstr.key       local

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

sound    dismountSound=LtSaberOff01.WAV         local
sound    mountSound=LtSaberOn01.WAV             local
sound    hitSound01=LtSaberHit01.WAV            local
sound    hitSound02=LtSaberHit02.WAV            local
sound    hitSound03=LtSaberHit03.WAV            local
sound    hitSound12=LtSaberHit12.WAV            local
sound    hitSound14=LtSaberHit14.WAV            local
sound    swingSound01=LtSaberSwing01.WAV        local
sound    swingSound02=LtSaberSwing02.WAV        local
sound    swingSound03=LtSaberSwing03.WAV        local
sound    swingSound04=LtSaberSwing04.WAV        local
sound    swingSound05=LtSaberSwing05.WAV        local
sound    swingSound06=LtSaberSwing06.WAV        local
sound    swingSound07=LtSaberSwing07.WAV        local
sound    swingSound08=LtSaberSwing08.WAV        local
sound    swingSoundDbl01=LtSaberSwingDbl01.WAV  local
sound    humSound01=LtSaberLp01.WAV             local

flex     damage                                 local
flex     bladeLen                               local
flex     holsterWait                            local

thing    player                                 local
thing    antagonist                             local

vector   ppos                                   local
vector   apos                                   local
vector   diff                                   local
vector   thrust                                 local

flex     damage                                 local
flex     type                                   local
flex     dot                                    local

int		iAlignmentPriority=-1	local

# ........................................................................................
# Animation tracks

int      mountAnimID=-1                         local
int      preAnimID=-1                           local
int      povPreAnimID=-1                        local
int      slashAnimID=-1                         local
int      povSlashAnimID=-1                      local

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

int      mode                                   local
int      slash                                  local
int      nextAttack                             local    # 0=right 1=left
int      humChannel=-1                          local
int      holsterTrack=-1                        local
int      slashSound=-1                          local

material    tip_mat=saberorange0.mat         local
material    side_mat=saberorange1.mat        local

template    tpl_wall=+ssparks_wall           local
template    tpl_blood=+ssparks_blood         local
template    tpl_saber=+ssparks_saber         local

int      assign                                 local
int      nosaber=1                              local

vector   shakePos                               local
vector   shakeAngle                             local

cog      kyleCog                                local

template	supartemp=+gamaxe		local

end

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

code

startup:
   // Set up player with saber.
   player = GetLocalPlayerThing();

   kyleCog = GetThingClassCog(player);
   

   ClearActorFlags(player, 0x2000);
   jkDisableSaber(player);
   slash = 0;
   nextAttack = 0;
   slashAnimID=-1;
   povSlashAnimID=-1;

   return;

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

timer:
   id = GetSenderId();

   if (id == 0)
   {
		if ((GetCurWeapon( player ) == 15) && !nosaber)
		{
			// Play mounting sound.
			PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);

			jkSetFlags(player, 0x1);
		}
   }
   else
   if (id == 2)
   {
      StopKey(player, holsterTrack, 0.0);
   }
   if (id == 3)
   {
      SetInv(player, 89, 0);
   }
   if (id == 10)
   {
		if (GetCurWeapon( player ) == 15)
			jkSetFlags(player, 0x81);
	}

   return;

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

selected:

   //jkSetSaberInfo(player, side_mat, tip_mat, 0.003, 0.001, 0.05, tpl_wall, tpl_blood, tpl_saber);

   // Cannot throw the saber in those 1.25 seconds
   SetInv(player, 89, 1);
   SetTimerEx(1.25, 3, 0, 0);

   assign = GetSenderRef();

   // Go to external
   if ((GetCurrentCamera() == 0) && (GetPrimaryFocus(0) == player))
      CycleCamera();

   // Setup the meshes and models.
   if (GetInv(player, 67) == 0.0)
      jkSetPOVModel(player, povModel);    // Kyle hand
   else
      jkSetPOVModel(player, povModel_m);  // Mara Hand
   SetArmedMode( player, 2 );
   jkSetWeaponMesh( player, saberMesh );
   jkSetWaggle(player, '10.0 7.0 0.0', 350);

   if (assign == 0)
   {
      // Play the animation (NOLOOP + UNIQUE + ENDPAUSE).
      // The animation is held at the last frame after it is played.
      PlayMode(player, 42);
      mountAnimID = jkPlayPOVKey( player, mountAnim, 0, 0x14 );
      SetTimerEx(0.7, 0, 0, 0);
   }
   else
   {
      mountAnimID = jkPlayPOVKey( player, holdAnim, 0, 0x14 );
   }

   SetMountWait(player, GetKeyLen(mountAnim));

   // Set saber flags, and allow activation of the weapon
   SetCurWeapon( player, GetWeaponBin(15) );

	if (iAlignmentPriority != -1)
	{
		aiRemoveAlignmentPriority(iAlignmentPriority);

		iAlignmentPriority = -1;
	}

	iAlignmentPriority = aiAddAlignmentPriority(1.0, 2);

   // Set autoblock on.
   //SetActorFlags(player, 0x2000);
   jkDisableSaber(player);
   nosaber = 0;

   //SetActorExtraSpeed(player, -0.8);

   return;

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

deselected:
   // Back to POV
   if ((jkGetSaberCam() == 1) && (GetCurrentCamera() == 1) && (GetPrimaryFocus(1) == player))
      CycleCamera();

   // Dismount the Lightsaber.
   PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);
   jkPlayPOVKey( player, dismountAnim, 0, 18 );

   holsterWait = GetKeyLen(holsterAnim);
   SetMountWait(player, holsterWait);
   holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
   SetTimerEx(holsterWait, 2, 0.0, 0.0);

   call user0;

//	DamageThing(player, 200.0, 16, player);

   return;

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

// This part is called directly from Force Saber Throw to get
// a fast dismount but clear all the saber stuff properly...
user0:
   // if the mount anim is still playing stop it
   if (mountAnimID != -1)
   {
      jkStopPOVKey( player, mountAnimID, 0 );
      mountAnimID = -1;
   }

	KillTimerEx(0);

   jkSetWaggle(player, '0.0 0.0 0.0', 0);

   // Clear variables
   slash = 0;
   nextAttack = 0;
   slashAnimID = -1;
   povSlashAnimID = -1;

   // Stop humming sound
   if(humChannel != -1)
   {
      StopSound( humChannel, 0.5 );
      humChannel = -1;
   }

	if (iAlignmentPriority != -1)
	{
		aiRemoveAlignmentPriority(iAlignmentPriority);

		iAlignmentPriority = -1;
	}
	
	// Waylay any hum sound that hasn't started yet.
   KillTimerEx(0);

   // Disable autoblock
   KillTimerEx(1);
   ClearActorFlags(player, 0x2000);
   jkDisableSaber(player);
   nosaber = 1;

   //SetActorExtraSpeed(player, 0.0);

   Return;

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

activated:
   mode = GetSenderRef();

   jkSetWaggle(player, '0.0 0.0 0.0', 0);

   if (mode > 1)
      return;

   povPreAnimID = -1;
   preAnimID = -1;

   ActivateWeapon( player, 0.5, mode );

   // Disable autoblock
   ClearActorFlags(player, 0x2000);

   return;

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

deactivated:
   mode = GetSenderRef();

   jkSetWaggle(player, '10.0 7.0 0.0', 350);
   DeactivateWeapon( player, mode );

   // Enable autoblock
   SetTimerEx(0.5, 1, 0, 0);

   return;

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

fire:
   // Stop block animations, by sending a message to kyle.cog.
   SendMessage( kyleCog, user0 );

FireProjectile(player, supartemp, -1, -1, 0, 0, 0, 0, 0, 0);

	// Tell kyle.cog that the player has done something to attract attention.
	SendMessageEx(kyleCog, user1, 3.0, 0, 0, 0);

   // Underwater saber attacks.
   if (GetMajorMode(player) == 15)
   {
      jkEnableSaber( player, 200, 0.15, 0.25 );

      if (nextAttack == 0)
      {
         PlayMode( player, 8);
         jkPlayPOVKey( player, povFireAnimR1, 2, 0x38 );
         nextAttack = 1;
      }
      else
      {
         PlayMode( player, 18);
         jkPlayPOVKey( player, povFireAnimL1, 2, 0x38 );
         nextAttack = 0;
      }

      shakePos = VectorScale(RandVec(),.001);
      shakeAngle = VectorScale(RandVec(),.5);
      SetPOVShake(shakePos, shakeAngle, .05, 80.0);

      SetFireWait(player, 1.0);

      slashSound = Rand()*7;
      PlaySoundThing(swingSound01[slashSound], player, 1.0, -1, -1, 0x80);
   }
   else
   {
      mode = GetSenderRef();
      if (mode == 0)
      {
         // If we do another attack, reset the quick slash counter.
         thrust = GetThingThrust( player );

         // RIGHT Regular Strike
         if (VectorX(thrust) > 0)
         {
            jkEnableSaber( player, 200, 0.15, 0.25 );

            jkPlayPOVKey( player, povFireAnimR1, 2, 0x38 );
            PlayKey(player, fireAnimR1, 1, 0x38);

            shakePos = VectorScale(RandVec(),.001);
            shakeAngle = VectorScale(RandVec(),.5);
            SetPOVShake(shakePos, shakeAngle, .05, 80.0);

//          PlaySoundThing(swingSound02, player, 1.0, -1, -1, 0x80);
            slashSound = Rand()*7;
            PlaySoundThing(swingSound01[slashSound], player, 1.0, -1, -1, 0x80);
            SetFireWait(player, 0.8);
         }
         else
         // LEFT Regular Strike
         if (VectorX(thrust) < 0)
         {
            jkEnableSaber( player, 200, 0.15, 0.25 );

            jkPlayPOVKey( player, povFireAnimL1, 2, 0x38 );
            PlayKey(player, fireAnimL1, 1, 0x38);

            shakePos = VectorScale(RandVec(),.001);
            shakeAngle = VectorScale(RandVec(),.5);
            SetPOVShake(shakePos, shakeAngle, .05, 80.0);

//          PlaySoundThing(swingSound02, player, 1.0, -1, -1, 0x80);
            slashSound = Rand()*7;
            PlaySoundThing(swingSound01[slashSound], player, 1.0, -1, -1, 0x80);
            SetFireWait(player, 0.8);
         }
         else
         // BACKWARDS Strike
         if (VectorY(thrust) < -0.1)
         {
            jkEnableSaber( player, 200, 0.15, 0.25 );

            if (nextAttack == 0)
            {
               jkPlayPOVKey( player, povFireAnimB1, 2, 0x38 );
               PlayKey(player, fireAnimB1, 2, 0x38);
               nextAttack = 1;
            }
            else
            {
               jkPlayPOVKey( player, povFireAnimB2, 2, 0x38 );
               PlayKey(player, fireAnimB2, 2, 0x38);
               nextAttack = 0;
            }
            shakePos = VectorScale(RandVec(),.001);
            shakeAngle = VectorScale(RandVec(),.5);
            SetPOVShake(shakePos, shakeAngle, .05, 80.0);

            slashSound = Rand()*7;
            PlaySoundThing(swingSound01[slashSound], player, 1.0, -1, -1, 0x80);
            SetFireWait(player, 0.8);
         }
         else
         // STANDING Strike
         if (VectorY(thrust) < 0.1)
         {
            jkEnableSaber( player, 200, 0.15, 0.25 );

            if (nextAttack == 0)
            {
               jkPlayPOVKey( player, povFireAnimF1, 2, 0x38 );
               PlayKey(player, fireAnimF1, 2, 0x38);
               nextAttack = 1;
            }
            else
            {
               jkPlayPOVKey( player, povFireAnimF2, 2, 0x38 );
               PlayKey(player, fireAnimF2, 2, 0x38);
               nextAttack = 0;
            }

            shakePos = VectorScale(RandVec(),.001);
            shakeAngle = VectorScale(RandVec(),.5);
            SetPOVShake(shakePos, shakeAngle, .05, 80.0);

//          PlaySoundThing(swingSound02, player, 1.0, -1, -1, 0x80);
            slashSound = Rand()*7;
            PlaySoundThing(swingSound01[slashSound], player, 1.0, -1, -1, 0x80);
            SetFireWait(player, 0.8);
         }
         else
         {
            // QUICK slash.
            if (slash == 0)
            {
               // If after a second, we haven't attacked again, reset slash to 0.
               jkEnableSaber( player, 200, 0.15, 0.25 );

               povSlashAnimID = jkPlayPOVKey( player, povSnapAnim1, 2, 0x38);
               slashAnimID = PlayKey(player, snapAnim1, 1, 0x38);
               PlaySoundThing(swingSound01, player, 1.0, -1, -1, 0x80);

               shakePos = VectorScale(RandVec(),.001);
               shakeAngle = VectorScale(RandVec(),.5);
               SetPOVShake(shakePos, shakeAngle, .05, 80.0);

               SetFireWait(player, 1.25);
               slash = 1;
            }
            else
            if (slash == 1)
            {
               // Allow another second for the 3rd attack.
               jkEnableSaber( player, 200, 0.15, 0.25 );

               povSlashAnimID = jkPlayPOVKey( player, povSnapAnim1, 2, 0x38 );
               slashAnimID = PlayKey(player, snapAnim1, 1, 0x38);
               PlaySoundThing(swingSound03, player, 1.0, -1, -1, 0x80);

               shakePos = VectorScale(RandVec(),.001);
               shakeAngle = VectorScale(RandVec(),.5);
               SetPOVShake(shakePos, shakeAngle, .05, 80.0);

               SetFireWait(player, 1.25);
               slash = 2;
            }
            else
            if (slash == 2)
            {
               jkEnableSaber( player, 200, 0.15, 0.25 );

               povSlashAnimID = jkPlayPOVKey( player, povSnapAnim1, 2, 0x38 );
               slashAnimID = PlayKey(player, snapAnim1, 1, 0x38);
               PlaySoundThing(swingSound02, player, 1.0, -1, -1, 0x80);

               shakePos = VectorScale(RandVec(),.001);
               shakeAngle = VectorScale(RandVec(),.5);
               SetPOVShake(shakePos, shakeAngle, .05, 80.0);

               SetFireWait(player, 2.0);
               slash = 0;
            }
         }
      }
      // mode == 1
      else
      {
         // HEAVY slash.
         {
            jkEnableSaber( player, 200, 0.15, 0.25 );
            jkPlayPOVKey( player, povChargeAnim, 2, 0x38 );
            PlayKey(player, chargeAnim, 2, 0x38);

            shakePos = VectorScale(RandVec(),.001);
            shakeAngle = VectorScale(RandVec(),.5);
            SetPOVShake(shakePos, shakeAngle, .05, 80.0);

            PlaySoundThing(swingSoundDbl01, player, 1.0, -1, -1, 0x80);
            SetFireWait(player, 2.0);
         }
      }
   }
   return;

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

newplayer:
   slash = 0;
   nextAttack = 0;
   slashAnimID=-1;
   povSlashAnimID=-1;
   // Disable autoblock
   ClearActorFlags(player, 0x2000);
   jkDisableSaber(player);

   // Back to POV, since the saber should never get autoselected at start for a multiplayer game.
   if ((jkGetSaberCam() == 1) && (GetCurrentCamera() == 1) && (GetPrimaryFocus(1) == player))
      CycleCamera();

   return;

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

joined:
	SetTimerEx(1.0, 10, 0, 0);
	return;

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

autoselect:
   player = GetSourceRef();

   // If the player has the weapon
   if(GetInv(player, GetWeaponBin(15)) != 0.0)
   {
      // If the player has ammo
      if(GetInv(player, 15) != 0.0)
      {
         ReturnEx(500.0);
      }
      else
      {
         ReturnEx(-1.0);
      }
   }
   else
   {
      ReturnEx(-1.0);
   }

   Return;

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

killed:
   if (GetLocalPlayerThing() == GetSenderRef())
   {
      if (GetCurWeapon(player) == 15)
      {
         PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);

         SetCurWeapon( player, GetWeaponBin(1) );
      }
      nosaber = 1;
   }
   Return;


end


I know, there's probably a TON of superfluous stuff in there, because I think Bel Iblis just modified a modified LEC cog (probably for the saber), and I was way too inexperienced back then to make it more efficient.

Here's the powerup cog that sends the trigger. Disregard the 'breakthrough!' part. ;p Due to time constraints, this is merely a crudely modified LEC cog as well. I tried using the call selected command twice in a row just in case that might actually mount the weapon, but to no avail.

Code:
# Jedi Knight Missions Cog Script
#
# POW_CROSSBOW_M.COG
#
# POWERUP Script - Crossbow
#
# [YB & CYW] + [RF] + [GRISMATH]
# BREAKTHROUGH!!!!!


symbols

thing       powerup                          local
thing       player                           local
int         bin=15                           local
int         ammobin=12                       local
sound       pickupsnd=thrmlpu2.wav           local
sound       respawnsnd=Activate01.wav        local
flex        amount                           local

int         bin_contents=0                   local
int         autopickup=0                     local
int         autoselect_weapon=-1             local

message     touched
message     taken
message     respawn

end

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

code

touched:
   player = GetSourceRef();

   if (GetThingType(player) == 10)  // Can only be taken by players.
   {
      if(IsMulti() || (GetInv(player, GetWeaponBin(bin)) == 0) || (GetInv(player, ammobin) < GetInvMax(player, ammobin)))
      {
         TakeItem(GetSenderRef(), -1);
         call taken;
      }
   }

   Return;

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

taken:
   player = GetSourceRef();
   powerup = GetSenderRef();

   // Do effects.
   PlaySoundLocal(pickupsnd, 1, 0, 0);
   AddDynamicTint(player, 0.0, 0.0, 0.2);

   SendTrigger(-1, 1337, 1, 0, 0, 0);

   if(GetInv(player, GetWeaponBin(bin)) == 0)
   {
      // Pickup gun and ammo.
      // Print("Crossbow");
      #jkPrintUNIString(player, GetWeaponBin(bin));

      ChangeInv(player, GetWeaponBin(bin), 1.0);

      // store the old bin contents
      bin_contents = GetInv(player, ammobin);
      ChangeInv(player, ammobin, 16.0);

      // Check for Auto Pickup
      autopickup = GetAutoPickup();
      if(autopickup & 1)
      {
         if(!((autopickup & 4) && (GetWeaponPriority(player, GetWeaponBin(GetCurWeapon(player)), 0) >= GetWeaponPriority(player, GetWeaponBin(bin), 0))))
         {
            if(!((autopickup & 8) && (GetWeaponBin(GetCurWeapon(player)) == jkGetMultiParam(1))))
            {
               SelectWeapon(player, GetWeaponBin(bin));
	       SelectWeapon(player, GetWeaponBin(bin));
               Return;
            }
         }
      }

      // Check for Auto Reload
      if(GetAutoReload() & 1)
      {
         if(!bin_contents)
         {
            if(!((GetAutoReload() & 2) && (GetWeaponBin(GetCurWeapon(player)) == jkGetMultiParam(1))))
            {
               // Try to autoselect and see if the best weapon is a power cell weapon
               autoselect_weapon = AutoSelectWeapon(player, 2);
               if((autoselect_weapon == 6) || (autoselect_weapon == 9) || (autoselect_weapon == 15))
                  SelectWeapon(player, autoselect_weapon);
            }
         }
      }
   }
   else
   if(GetInv(player, ammobin) < GetInvMax(player, ammobin))
   {
      // Pickup ammo only.
      // Print("Power Cells");
      jkPrintUNIString(player, ammobin);

      // store the old bin contents
      bin_contents = GetInv(player, ammobin);

      ChangeInv(player, ammobin, 16.0);

      // Check for Auto Reload
      if(GetAutoReload() & 1)
      {
         if(!bin_contents)
         {
            if(!((GetAutoReload() & 2) && (GetWeaponBin(GetCurWeapon(player)) == jkGetMultiParam(1))))
            {
               // Try to autoselect and see if the best weapon is a power cell weapon
               autoselect_weapon = AutoSelectWeapon(player, 2);
               if((autoselect_weapon == 6) || (autoselect_weapon == 9) || (autoselect_weapon == 15))
                  SelectWeapon(player, autoselect_weapon);
            }
         }
      }
   }

   Return;

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

respawn:
   PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);

   Return;

end


I'm definitely thinking that there's some error in the mounting procedure or selected/activated procedure in the weapon cog, but I don't know where to begin looking for it or even solving it.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-01-19, 10:51 AM #6
I hate doing this, but *bump*

I really want to release this level and this is the only thing holding me back. I can't think of any solution on my own.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.

↑ Up to the top!