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 → One Shot Kill
One Shot Kill
2001-09-14, 9:06 AM #1
How would i make the Bryar Pistol more powerful and kill with one shot, is there something i have to do to the weap_byar.cog??


# Jedi Knight Cog Script
#
# WEAP_BRYAR.COG
#
# WEAPON 2 Script - Bryar Pistol
#
# The trusty weapon of Kyle Katarn. This is actually an older modified rifle
# that has been cut down to more of a pistol size. It is very accurate but
# somewhat of a low power weapon. This weapon has only one type of fire.
#
# - Affected by MagSealed sectors/surfaces.
#
# [YB & CYW]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

model povModel=bryv.3do local
model weaponMesh=bryg.3do local

keyframe mountAnim=bryvmnt.key local
keyframe dismountAnim=bryvdis.key local
keyframe povfireAnim=bryvpst1.key local
keyframe holsterAnim=kyhlstr.key local

sound outSound=pistout1.wav local
sound mountSound=df_bry_ready.wav local
sound dismountSound=PutWeaponAway01.wav local
sound fireSound=pistol-1.wav local

template projectile=+bryarbolt local

thing player local
thing victim local
thing potential local

flex dot local
flex maxDot local

flex fireWait=0.5 local
flex holsterWait local
flex fireDelay=0.6 local
flex powerBoost local
flex autoAimFOV=30 local
flex autoAimMaxDist=5 local

int weaponIndex local
int trackID=-1 local
int dummy=0 local
int mode local
int holsterTrack local

message activated
message deactivated
message selected
message deselected
message autoselect
message fire
message timer

end

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

code

fire:
player = GetSourceRef();

// Check that the player is still alive.
if(GetThingHealth(player) <= 0)
{
Return;
}

// Check Ammo - If we are out, autoselect best weapon.
if(GetInv(player, 11) < 1.0)
{
PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
if(GetAutoSwitch() & 1)
SelectWeapon(player, AutoSelectWeapon(player, 1));
Return;
}

SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
dummy = FireProjectile(player, projectile, fireSound, 8, '0.0135 0.1624 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
ChangeInv(player, 11, -1.0);
jkPlayPOVKey(player, povfireAnim, 1, 0x38);

powerBoost = GetInv(player, 63);
ChangeFireRate(player, fireWait/powerBoost);

Return;

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

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

jkSetWaggle(player, '0.0 0.0 0.0', 0);
powerBoost = GetInv(player, 63);
ActivateWeapon( player, fireWait/powerBoost, mode );
Return;

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

deactivated:
player = GetSourceRef();
mode = GetSenderRef();

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

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

selected:
player = GetSourceRef();

// Setup the meshes and models.
jkSetPOVModel(player, povModel);
jkSetWeaponMesh(player, weaponMesh);
SetArmedMode(player, 1);

// Play mounting sound.
PlayMode(player, 41);
PlaySoundThing(mountSound, player, 1.0, -1.0, -1.0, 0x80);

// Play the animation (NOLOOP + UNIQUE + ENDPAUSE).
// The animation is held at the last frame after it is played.
trackID = jkPlayPOVKey(player, mountAnim, 0, 0x14);
jkSetWaggle(player, '10.0 7.0 0.0', 350);

// Clear saber flags, and allow activation of the weapon
jkClearFlags(player, 0x5);
SetCurWeapon(player, 2);
SetMountWait(player, GetKeyLen(mountAnim));

Return;

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

deselected:
player = GetSourceRef();
weaponIndex = GetSenderRef();

PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);
jkPlayPOVKey(player, dismountAnim, 0, 0x18);

holsterWait = GetKeyLen(holsterAnim);
SetMountWait(player, holsterWait);
holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
SetTimerEx(holsterWait, 2, 0.0, 0.0);
if (trackID != -1)
{
jkStopPOVKey(player, trackID, 0);
trackID = -1;
}
jkSetWaggle(player, '0.0 0.0 0.0', 0);

Return;

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

autoselect:
player = GetSourceRef();

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

Return;

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

timer:
StopKey(player, holsterTrack, 0.0);
Return;

end
2001-09-14, 9:23 AM #2
It really wasn't neccessary to post the unedited basic bryar cog since everyone already has it anyway.

To answer your question...

Probably the simpliest way would be to change a value in this line :

dummy = FireProjectile(player, projectile, fireSound, 8, '0.0135 0.1624 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);

to this :

dummy = FireProjectile(player, projectile, fireSound, 8, '0.0135 0.1624 0.0', '0 0 0', 2.0, 0x20, autoAimFOV, autoAimFOV*2);

For instance that would make the fireprojectile line shoot two bolts instead of one. Substitute different numbers until you get the desired effect.

That is one way. I think the best way is to construct a new template because it gives you the most control over a new projectile. But of course you have to do extra cogging to get new templates to work in multiplayer.
2001-09-14, 10:35 AM #3
or in the kyle.cog you could use getparam and find out what kind of fire it was then have it multiply the damage by a high number. but that is if you want it all laser fire to kill in one shot. but templates are the sure way to do it check tutorials to find out how to do templates
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-09-15, 6:00 AM #4
Yeah, thats a good way too. You could just got it so it used getthingtemplate() to check if it was a bryarbolt and then only multiply then. I did that to pump up the damage on the scope in MotS once.
2001-09-15, 6:16 AM #5
Firing multiple projectiles usually makes a really loud noise.

[This message has been edited by Aglar (edited September 15, 2001).]
2001-09-15, 12:24 PM #6
Why don't you just turn up the template damage? Sheesh.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-09-16, 1:36 PM #7
Emon - because, changing the template would require some trigger coding to make it work in multiplayer, and when you ask a question like this you probably don't know how to do it. There are some situations where a trigger produced projectile also won't do the job.

Firing mutliple projectiles doesn't make extra noise if you set the second fireprojectile() verb to have a -1 value for the sound. I don't think it doubles the sound when you change the value for how many to fire, but I don't usually use that method so I'm not sure.

↑ Up to the top!