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 → ... i really hate cog... (broken powerup)
... i really hate cog... (broken powerup)
2004-07-01, 10:05 AM #1
the cog is so simple it should work. but if i add it to the template of the bryar (or a new template) JK gets stuck in limbo, allthough JK is definatly dead and black and gone, the resolution is the same as JK... but i am definatly in windows... its.. wierd.. but i cant see the desktop because JK is in the way... any ideas why?

Code:
# Jedi Knight Cog Script
#
# POW_BRYAR.COG
#
# POWERUP Script - Bryar Pistol pickup
#
# [YB & CYW]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

thing       powerup                          local
thing       player                           local
int         bin=2                            local
int         ammobin=11                       local
sound       pickupsnd=thrmlpu2.wav           local
sound       respawnsnd=Activate01.wav        local

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

message     activated
message     taken
message     respawn

end

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

code

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

   if((GetInv(player, bin) == 0) || (GetInv(player, ammobin) < GetInvMax(player, ammobin)))
   {
	print("you bought a bryar pistol for 15 credits");
      TakeItem(powerup, player);
   }
   Return;

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

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

   // Do effects.
   PlaySoundThing(pickupsnd, powerup, 1.0, -1, -1, 0);
   AddDynamicTint(player, 0.0, 0.0, 0.2);

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

      ChangeInv(player, bin, 1.0);

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

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

      // Check for Auto Reload
      if(GetAutoReload() & 1)
      {
         if(!bin_contents)
         {
            if(!((GetAutoReload() & 2) && (GetCurWeapon(player) == 10)))
            {
               // Try to autoselect and see if the best weapon is an energy cell weapon
               autoselect_weapon = AutoSelectWeapon(player, 2);
               if((autoselect_weapon == 2) || (autoselect_weapon == 3))
                  SelectWeapon(player, autoselect_weapon);
            }
         }
      }
   }
   else
   if(GetInv(player, ammobin) < GetInvMax(player, ammobin))
   {
      // Pickup ammo only.
      // Print("Energy Cells");
      jkPrintUNIString(player, ammobin);

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

      ChangeInv(player, ammobin, 10.0);

      // Check for Auto Reload
      if(GetAutoReload() & 1)
      {
         if(!bin_contents)
         {
            if(!((GetAutoReload() & 2) && (GetCurWeapon(player) == 10)))
            {
            // Try to autoselect and see if the best weapon is an energy cell weapon
            autoselect_weapon = AutoSelectWeapon(player, 2);
            if((autoselect_weapon == 2) || (autoselect_weapon == 3))
               SelectWeapon(player, autoselect_weapon);
            }
         }
      }
   }

   Return;

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

respawn:
   powerup = GetSenderRef();
   PlaySoundThing(respawnsnd, powerup, 0.6, 5.0, 10.0, 0);

   Return;

end


------------------
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-07-01, 12:59 PM #2
My first assumtion would be a broken While Loop, but as there is none, I really don't know... Have you put it through Parsec?

Let's have a look at your template while we are still here...

[This message has been edited by Edward (edited July 01, 2004).]
Edward's Cognative Hazards
2004-07-05, 3:52 AM #3
yea, the cog is basicaly just the normal powerup cog with a print line added. here's my template

-first one-
Code:
# DESC: Bryar Pistol Pickup
# BBOX: -.01 -.03 -.01 .01 .03 .01
bryar_cost  bryarpistol cog=pow_bryar.cog

-second one-
Code:
# DESC: Bryar Pistol Pickup
# BBOX: -.01 -.03 -.01 .01 .03 .01
bryarpistol       _powerup           thingflags=0x400 model3d=bryp.3do cog=pow_bryar.cog


------------------
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-07-05, 7:31 AM #4
Wait, are they in that order? IE, the one that listed first lists the second one as its parent, but the second one appears after the first one? SWITCH THEM.

------------------
Dear lady, can you hear the wind blow, and did you know
Your stairway lies on the whispering wind.
:wq
And when the moment is right, I'm gonna fly a kite.
2004-07-06, 1:12 AM #5
actually there from two different attempts... so that cant be it [http://forums.massassi.net/html/frown.gif]

------------------
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?

↑ Up to the top!