PDA

View Full Version : ... i really hate cog... (broken powerup)



[SF]pjb
07-01-2004, 01:05 PM
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?



# 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?

Edward
07-01-2004, 03:59 PM
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).]

[SF]pjb
07-05-2004, 06:52 AM
yea, the cog is basicaly just the normal powerup cog with a print line added. here's my template

-first one-


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

-second one-


# 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?

gbk
07-05-2004, 10:31 AM
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.
:w (http://shauri.hopto.org)q (http://www.massassi.net/levels/files/2533.shtml)

[SF]pjb
07-06-2004, 04:12 AM
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?