Code:
# Jedi Knight Cog Script
#
# item_throwthings.cog
#
# Item Script
#
# Item cog that fires three projectiles forward with a differing fire
# angle for a spread shot.
#
# [3/3/04] - Darth Slaw
#==============================================================#
symbols
keyframe povFireAnim=detvpst1.key local
keyframe prePOVThrowAnim=detvpre1.key local
template projectile=+star local
sound throwSound=bwoosh1.wav local
sound clickSound=bwoosh2.wav local
thing player local
int firing=0 local
int prethrowtrack=-1 local
flex fireDelay=1.0 local
flex offset=8 local
vector vec local
message activated
message timer
end
#==============================================================#
code
#------------------------------------------------------
activated:
player = GetSourceRef();
if(firing == 1) Return;
firing = 1;
PlaySoundThing(clickSound, player, 1.0, -1.0, -1.0, 0x80);
//jkPlayPOVKey(player, prePOVThrowAnim, 1, 0x38);
prethrowtrack = PlayMode(player, 38);
SetTimerEx(0.2, 1, 0, 0);
Return;
#------------------------------------------------------
timer:
if(GetSenderID() == 0)
{
// Start waggling after the throw.
jkSetWaggle(player, '10.0 7.0 0.0', 350);
firing = 0;
}
else if(GetSenderID() == 1)
{
StopKey(player, prethrowtrack, 0);
prethrowtrack = -1;
SetPOVShake('0.0 -.003 0.0', '0.5 0.0 0.0', .05, 40.0);
jkPlayPOVKey(player, povFireAnim, 1, 0x38);
PlaySoundThing(throwSound, player, 1.0, 0.5, 2.5, 0x80);
FireProjectile(player, projectile, -1, 15, '0.05 0 0', '0 0 0', 1, 0x1, 0.0, 0.0);
ChangeInv(player, 4, 0.0);
if(GetInv(player, 4) > 0)
{
vec = VectorSet(0, offset, 0);
FireProjectile(player, projectile, -1, 15, '0.05 0 0', vec, 1, 0x1, 0.0, 0.0);
ChangeInv(player, 4, 0.0);
}
if(GetInv(player, 4) > 0)
{
vec = VectorSet(0, -offset, 0);
FireProjectile(player, projectile, -1, 15, '0.05 0 0', vec, 1, 0x1, 0.0, 0.0);
ChangeInv(player, 4, 0.0);
}
jkSetWaggle(player, '0.0 0.0 0.0', 0);
if(GetInv(player, 4) < 1 && GetCurWeapon(player) == 4)
{
if(GetAutoSwitch() & 1)
{
SelectWeapon(player, AutoselectWeapon(player, 1));
}
else
{
SelectWeapon(player, 1);
}
}
jkSetWaggle(player, '0.0 0.0 0.0', 0);
//delay before we can fire again
SetTimerEx(fireDelay, 0, 0, 0);
}
Return;
#------------------------------------------------------
endThis cog was given to me by darth slaw a while ago but bacause of that static.jkl problem the projectiles dont show up in mp. Because this is an items cog and not a weapon cog it works differently to normal mp synching. Can someone synch the projectiles for me.
![http://forums.massassi.net/html/smile.gif [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)
------------------
Nightfire Mod
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.
Rangi
Offer expires on 6/6/06. Valid one per customer, per day.
Rangi