I've been using the weap_bryar_m cog from MotS as the basis for a vibroblade that I'm alternating on button 5 with the bowcaster. I've just about got it finished. I've modified it to punch like Kyle does in the game with the right fist only (I'm going to attach a blade to the back of his fist). The only problem with it is this: the cog uses the correct keys and animations in the 1st person view, but will not use these animations in the external view. He looks just like he's shooting the pistol.
If anyone out there can help me remedy this problem, I would be most grateful. I tried to use the weap_fists_m cog as a base, but it causes MAJOR errors in performance, so I ditched in favor of the weap_bryar_m cog.
Here's a copy of the cog:
# Jedi Knight Missions Cog Script
#
# WEAP_BRYAR_M.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] + [RF]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
model povModel=fistv_x.3do local
model povModel_m=fistv_x.3do local
model weaponMesh=fistg_x.3do local
keyframe mountAnim=fistvmnt.key local
keyframe dismountAnim=fistvdis.key local
keyframe povfireAnim=fistvr.key local
keyframe holsterAnim=kyhlstr.key local
sound outSound=inactive.wav local
sound mountSound=active.wav local
sound dismountSound=inactive.wav local
sound fireSound=slash.wav local
sound failSound=inactive.wav local
template projectileB=+gamaxe local
template projectile=+gamaxe 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, 13) < 8.0)
{
PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
if(GetAutoSwitch() & 1)
SelectWeapon(player, GetWeaponBin(AutoSelectWeapon(player, 1)));
Return;
}
SendMessageEx(GetThingClassCog(GetLocalPlayerThing()), user1, 3, 0, 0, 0);
SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
if (GetInv(player, 93) > 0.0)
{
dummy = FireProjectile(player, projectileB, failSound, 8, '0.0135 0.1624 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
}
else
{
dummy = FireProjectile(player, projectile, fireSound, 8, '0.0135 0.1624 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
}
ChangeInv(player, 13, -8.0);
jkPlayPOVKey(player, povfireAnim, 1, 0x38);
powerBoost = GetInv(player, 63);
ChangeFireRate(player, fireWait/powerBoost);
Return;
# ........................................................................................
activated:
player = GetSourceRef();
mode = GetSenderRef();
if (GetInv(player, 93) > 0.0)
SendMessageEx(GetThingClassCog(player), skill, 1100, 0, 0, 0);
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.
if (GetInv(player, 67) == 0.0)
jkSetPOVModel(player, povModel); // Kyle hand
else
jkSetPOVModel(player, povModel_m); // Mara Hand
jkSetWeaponMesh(player, weaponMesh);
SetArmedMode(player, 1);
Print("Vibroblade Activated");
// 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, 5);
SetMountWait(player, GetKeyLen(mountAnim));
Return;
# ........................................................................................
deselected:
player = GetSourceRef();
weaponIndex = GetSenderRef();
Print("Vibroblade Deactivated");
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);
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, 5) != 0.0)
{
// If the player has ammo
if(GetInv(player, 13) != 0.0)
{
ReturnEx(500.0);
}
else
{
ReturnEx(-1.0);
}
}
else
{
ReturnEx(-1.0);
}
Return;
# ........................................................................................
timer:
StopKey(player, holsterTrack, 0.0);
Return;
end
------------------
I just love that part of the Jedi Code that says, "There is no ignorance - only knowledge". If that's the case, then what am I doing on this Force-blasted message board??!!
If anyone out there can help me remedy this problem, I would be most grateful. I tried to use the weap_fists_m cog as a base, but it causes MAJOR errors in performance, so I ditched in favor of the weap_bryar_m cog.
Here's a copy of the cog:
# Jedi Knight Missions Cog Script
#
# WEAP_BRYAR_M.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] + [RF]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
model povModel=fistv_x.3do local
model povModel_m=fistv_x.3do local
model weaponMesh=fistg_x.3do local
keyframe mountAnim=fistvmnt.key local
keyframe dismountAnim=fistvdis.key local
keyframe povfireAnim=fistvr.key local
keyframe holsterAnim=kyhlstr.key local
sound outSound=inactive.wav local
sound mountSound=active.wav local
sound dismountSound=inactive.wav local
sound fireSound=slash.wav local
sound failSound=inactive.wav local
template projectileB=+gamaxe local
template projectile=+gamaxe 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, 13) < 8.0)
{
PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
if(GetAutoSwitch() & 1)
SelectWeapon(player, GetWeaponBin(AutoSelectWeapon(player, 1)));
Return;
}
SendMessageEx(GetThingClassCog(GetLocalPlayerThing()), user1, 3, 0, 0, 0);
SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
if (GetInv(player, 93) > 0.0)
{
dummy = FireProjectile(player, projectileB, failSound, 8, '0.0135 0.1624 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
}
else
{
dummy = FireProjectile(player, projectile, fireSound, 8, '0.0135 0.1624 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
}
ChangeInv(player, 13, -8.0);
jkPlayPOVKey(player, povfireAnim, 1, 0x38);
powerBoost = GetInv(player, 63);
ChangeFireRate(player, fireWait/powerBoost);
Return;
# ........................................................................................
activated:
player = GetSourceRef();
mode = GetSenderRef();
if (GetInv(player, 93) > 0.0)
SendMessageEx(GetThingClassCog(player), skill, 1100, 0, 0, 0);
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.
if (GetInv(player, 67) == 0.0)
jkSetPOVModel(player, povModel); // Kyle hand
else
jkSetPOVModel(player, povModel_m); // Mara Hand
jkSetWeaponMesh(player, weaponMesh);
SetArmedMode(player, 1);
Print("Vibroblade Activated");
// 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, 5);
SetMountWait(player, GetKeyLen(mountAnim));
Return;
# ........................................................................................
deselected:
player = GetSourceRef();
weaponIndex = GetSenderRef();
Print("Vibroblade Deactivated");
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);
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, 5) != 0.0)
{
// If the player has ammo
if(GetInv(player, 13) != 0.0)
{
ReturnEx(500.0);
}
else
{
ReturnEx(-1.0);
}
}
else
{
ReturnEx(-1.0);
}
Return;
# ........................................................................................
timer:
StopKey(player, holsterTrack, 0.0);
Return;
end
------------------
I just love that part of the Jedi Code that says, "There is no ignorance - only knowledge". If that's the case, then what am I doing on this Force-blasted message board??!!
I just love that part of the Jedi Code that says, "There is no ignorance - only knowledge". If that's the case, then what am I doing on this Force-blasted message board??!!