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 → Weapon cog/tpl for LEVEL
Weapon cog/tpl for LEVEL
2001-03-14, 5:42 PM #1
I assume this will work without a mod required if the 3do of the weapon doesnt change.

Can someone do this for me, I need it for my next SP level, and you will get credited.

I need the bowcaster to have a new secondary fire, the projectile should be like a conc bullet, require 10 cells, travel very slowly--about half the speed of a raildet, and explode with the same damage just like a conc bullet.

------------------
2001-03-14, 10:30 PM #2
I'm not sure about re arranging the cog to change the charging bowcaster mode to a conc bullet, but heres some things you may do yourself.
ON the cog where it says all that about the projectile replace it with the projectile part of the cog for the conc bullet which has two distinctive fires. where it says at the top projectile=+concbullet change it to what ever the bow caster fires (help me out someone I cant remember what the bow projectile is)
keep the other projectile as +concbullet.
In the template creater in JED, the file for +concbullet should be opened, find the part where it says vel(x.0000, 0.000, 0.000)
Change the x which I think is 8 to half the speed of a rail det, make it about 1 or 2.
Hopefully an actually experienced editor who knows what theyre talking about will answer you.
Code:
if(getThingFlags(source) & 0x8){
  do her}
elseif(getThingFlags(source) & 0x4){
  do other babe}
else{
  do a dude}
2001-03-15, 7:58 AM #3
Ok, this cog will fire a slow conc bullet as secondary fire:

# Jedi Knight Cog Script
#
# WEAP_CROSSBOW.COG
#
# WEAPON 5 Script - Crossbow
#
# This cog is Not supported by LEC.


symbols

model povModel=BowV.3do local
model weaponMesh=BowG.3do local

keyframe mountAnim=BowVmnt.key local
keyframe dismountAnim=BowVdis.key local
keyframe povfireAnim=BowVpst1.key local
keyframe holsterAnim=kyhlstr.key local

sound mountSound=df_bry_ready.wav local
sound dismountSound=PutWeaponAway01.wav local

sound chargeSound=BCChargeUp.wav local
sound fireSound1=BCFire01.wav local
sound fireSound2=BCFire02.wav local
sound outSound=trprout.wav local

template projectile=+crossbowbolt local
template projectile2=+crossbowbolt2 local
template projectile3=+slowconcbullet local

flex fireWait=0.6 local
flex firewait2=1.2 local
flex delayTime local
flex error local
flex autoAimFOV=30 local
flex autoAimMaxDist=10 local
flex powerBoost local
flex holsterWait local

vector errorVec local

thing player local

int trackID=-1 local
int channel=-1 local
int holsterTrack local

message startup
message activated
message deactivated
message selected
message deselected
message newplayer
message autoselect
message fire
message killed
message timer

end

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

code

startup:
player = GetLocalPlayerThing();

Return;

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

activated:
mode = GetSenderRef();

jkSetWaggle(player, '0.0 0.0 0.0', 0);

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

Return;
}

if(mode == 0)
{
ActivateWeapon(player, 0, mode);

if(channel == -1)
{
channel = PlaySoundThing(chargeSound, player, 0.0, -1, -1, 0x181);

if(channel != -1)
{
ChangeSoundPitch(channel, 0.3, 0.01);
Sleep(0.03);

// looks stupid... but if the user taps quickly deactivated:
// gets called during the sleep, and channel becomes invalid !
if(channel != -1)
{
ChangeSoundVol(channel, 1.0, 0.6);
ChangeSoundPitch(channel, 1.0, 1.2);
}
}
}
}
else
{
powerBoost = GetInv(player, 63);
ActivateWeapon( player, fireWait/powerBoost, mode);
}

Return;

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

fire:
mode = getsenderref();

// Check that the player is still alive.
if(GetThingHealth(player) <= 0) Return;
// Check Ammo - If we are out, autoselect best weapon.
if(GetInv(player, 12) < 2.0)
{
SelectWeapon(player, AutoSelectWeapon(player, 1));
Return;
}

if(mode == 1)
{
SetPOVShake('0.0 -.01 0.0', '2.0 0.0 0.0', .05, 80.0);
dummy = FireProjectile(player, projectile3, fireSound2, 18, '0.0207 0.0888 0.00', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
ChangeInv(player, 12, -10.0);
jkPlayPOVKey(player, povfireAnim, 1, 0x38);
powerBoost = GetInv(player, 63);
ChangeFireRate(player, fireWait2/powerBoost);
}

Return;


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

deactivated:
mode = GetSenderRef();

jkSetWaggle(player, '10.0 7.0 0.0', 350);

if(mode == 0)
{
delayTime = DeactivateWeapon(player, mode);

if(channel != -1)
{
StopSound(channel, 0);
channel = -1;
}

// Set a delay, even if we don't fire here.
SetMountWait(player, fireWait/powerBoost);

// Make sure both keys are up before continuing.
if (GetCurWeaponMode() != -1) Return;

// make sure we still have ammo
if(GetInv(player, 12) < 2.0) Return;

// Always fire one projectile straight-ahead
SetPOVShake('0.0 -.01 0.0', '2.0 0.0 0.0', .05, 80.0);
FireProjectile(player, projectile, fireSound2, 18, '0.0207 0.0888 0.00', '0 0 0', 0, 0, autoAimFOV, autoAimFOV*2);

ChangeInv(player, 12, -2.0);

if(delayTime > 0.6)
{
if(GetInv(player, 12) > 1.0)
{
FireProjectile(player, projectile2, -1, 18, '0.0207 0.0888 0.00', '0 6 0', 0, 0, autoAimFOV, autoAimMaxDist);
FireProjectile(player, projectile2, -1, 18, '0.0207 0.0888 0.00', '0 -6 0', 0, 0, autoAimFOV, autoAimMaxDist);
ChangeInv(player, 12, -2.0);
}
}

if(delayTime > 1.2)
{
if(GetInv(player, 12) > 1.0)
{
FireProjectile(player, projectile2, -1, 18, '0.0207 0.0888 0.00', '0 12 0', 0, 0, autoAimFOV, autoAimMaxDist);
FireProjectile(player, projectile2, -1, 18, '0.0207 0.0888 0.00', '0 -12 0', 0, 0, autoAimFOV, autoAimMaxDist);
ChangeInv(player, 12, -2.0);
}
}

// Play animation and set delay.
jkPlayPOVKey(player, povfireAnim, 1, 0x38);
powerBoost = GetInv(player, 63);
}
else
{
DeactivateWeapon(player, mode);
}

Return;

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

selected:
// Play external animation
PlayMode(player, 41);

// Set up meshes and models.
jkSetPOVModel(player, povModel);
SetArmedMode(player, 1);
jkSetWeaponMesh(player, weaponMesh);
jkSetWaggle(player, '10.0 7.0 0.0', 350);

// Play sound and animation.
PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);
trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
SetMountWait(player, GetKeyLen(mountAnim));

// Set flags, etc.
jkClearFlags(player, 0x5);
SetCurWeapon(player, 5);

// Check Ammo - If we are out, autoselect best weapon.
if(GetInv(player, 12) < 2.0)
{
if((GetAutoSwitch() & 1))
SelectWeapon(player, AutoSelectWeapon(player, 1));
}

Return;

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

deselected:
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);

if(channel != -1)
{
StopSound(channel, 0.1);
channel = -1;
}

Return;

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

killed:
if (player == GetSenderRef())
{
if(channel != -1)
{
StopSound(channel, 0.1);
channel = -1;
}
}
Return;

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

newplayer:
// // Make sure that if the player is respawning, the old mount isn't playing anymore.
// if (trackID != -1)
// {
// jkStopPOVKey(player, trackID, 0);
// trackID = -1;
// }

if(channel != -1)
{
StopSound(channel, 0.1);
channel = -1;
}

Return;

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

autoselect:
// If the player has the weapon
if(GetInv(player, 5) != 0.0)
{
// If the player has ammo
if(GetInv(player, 12) > 1.0)
{
ReturnEx(700.0);
}
else
{
ReturnEx(-1.0);
}
}
else
{
ReturnEx(-1.0);
}

Return;

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

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

end


--------------------------------------

You'll also need to use these templates:
_weapon none orient=(0.000000/0.000000/0.000000) type=weapon collide=1 move=physics thingflags=0x20000000 timer=10.000000 mass=5.000000 physflags=0x200 maxrotvel=90.000000 damageclass=0x2 typeflags=0x1
_explosion none orient=(0.000000/0.000000/0.000000) type=explosion typeflags=0x1 damageclass=0x4
+whitecloud none orient=(0.000000/0.000000/0.000000) type=particle timer=0.200000 typeflags=0x3f material=00gsmoke.mat range=0.020000 rate=128.000000 maxthrust=30.000000 elementsize=0.007000 count=128
+dustcloud +whitecloud timer=0.120000 material=dusty.mat range=0.015000 rate=256.000000 maxthrust=80.000000 elementsize=0.010000
+conccloud +dustcloud rate=512.000000 maxthrust=100.000000 count=256 minsize=0.012000 pitchrange=5.000000
+conc_exp _explosion thingflags=0x1 light=0.300000 timer=1.000000 sprite=conx.spr soundclass=exp_conc.snd creatething=+conccloud typeflags=0x17 damage=80.000000 blasttime=1.000000 force=200.000000 maxlight=0.800000 range=0.800000
+lgflash _explosion thingflags=0x1 light=0.300000 timer=0.400000 typeflags=0x12 blasttime=0.200000 maxlight=1.000000
+slowconcbullet _weapon thingflags=0x20000001 model3d=con0.3do size=0.005000 movesize=0.005000 soundclass=conc.snd creatething=+lgflash vel=(0.000000/2.000000/0.000000) explode=+conc_exp fleshhit=+conc_exp damage=20.000000 typeflags=0x20000d

----------

All the templates do is change the speed of the concbullet. I think the only template you need is +slowconcbullet unless you put it in the static.jkl. I'm not sure cause I haven't experimented with making levels.

-----------

I'm not that good at making cogs, so hopefully an expert will look at it.

Hope that helps..


------------------
Yub-Yub, Commander.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!