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 → Showcasing Cogs and stuff.
12
Showcasing Cogs and stuff.
2002-08-15, 11:58 AM #1
I'm posting here because I want these to be kept kinda under raps. [http://forums.massassi.net/html/wink.gif]
Code:
# 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
template    cameraTpl=+camera                   local
template    cam=+zoom_cam                       local

thing       player                              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
flex        zoom=0.15                           local
flex        distance                            local

int         weaponIndex                         local
int         trackID=-1                          local
int         dummy=0                             local
int         bolt=0                              local
int         camera=0                            local
int         mode                                local
int         holsterTrack                        local
int         stay                                local
int         scope=1                             local
int         oldFocus                            local
int         count                               local
int         active=0                            local

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

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);
   bolt = 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();

   If(mode == 0)
   {
      jkSetWaggle(player, '0.0 0.0 0.0', 0);
      powerBoost = GetInv(player, 63);
      ActivateWeapon( player, fireWait/powerBoost, mode );
   }
   Else
   {
      If(!active)
      {
         oldFocus = GetCurrentCamera();
         ParseArg(player, "maxrotvel=20 maxrotthrust=20");
         SetPulse(.01);
         active = 1;
      }
      Stay = 0;
      Count = 0;
   }
   Return;

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

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

   If(mode == 0)
   {
      jkSetWaggle(player, '10.0 7.0 0.0', 350);
      DeactivateWeapon(player, mode);
   }
   Else
   {
      scope = 1 - scope;
      stay = 1;
      If(count <= 3) Call cancel;
   }
   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));
   Active = 0;

   Return;

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

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

   Call cancel;
   Scope = 1;
   
   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;

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

Pulse:
   If(!stay)
   {
      If(scope)
      {
         zoom = zoom + count * 0.005;
         If(zoom > 5) zoom = 5;
      }
      Else
      {
         zoom = zoom - count * 0.005;
         If(zoom < 0.15) zoom = 0.15;
      }
      count = count + 1;
   }
   If((zoom == 0.15) && !scope)
   {
      call cancel;
      Return;
   }
   distance = zoom / 1000;
   dummy = FireProjectile(player, cameraTpl, -1, -1, '0 0 0.037', '0 0 0', 0, 0, 0, 0);
   Sleep(distance);
   cam = CreateThingAtPos(camera, GetThingSector(dummy), GetThingPos(dummy), GetThingLVec(dummy));
   SetCameraFocus(0, cam);
   DestroyThing(dummy);
   If(GetCurrentCamera() != 0) CycleCamera();
   Return;

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

Cancel:
   SetPulse(0);
   ParseArg(player, "maxrotvel=200 maxrotthrust=180");
   SetCameraFocus(0, player);
   zoom = .15;
   If(oldFocus != GetCurrentCamera()) CycleCamera();
   active = 0;
   Return;

end
Here's the templates for this and a weapon that will fire through walls.
Code:
_weapon          none             orient=(0/0/0) type=weapon collide=1 move=physics thingflags=0x20000000 timer=10 mass=5 physflags=0x200 maxrotvel=90 damageclass=0x2 typeflags=0x1
_explosion       none             orient=(0.000000/0.000000/0.000000) type=explosion typeflags=0x1 damageclass=0x4

+lgflash         _explosion       thingflags=0x1 light=0.300000 timer=0.400000 typeflags=0x12 blasttime=0.200000 maxlight=1.000000

+nstrail         _weapon          vel=(0/7/0) size=0.005 movesize=0.005 damage=100 mindamage=100 maxrotvel=0 typeflags=0x20400d

+nightshot       _weapon          model3d=con0.3do vel=(0/7/0) collide=0 elementsize=0.05 typeflags=0x8000 range=100 trailthing=+bryarbolt

+camera          _weapon          vel=(0/1000/0) thingflags=0 damageclass=0 typeflags=0x40d size=.001 movesize=0.001

+zoom_cam        _weapon          size=0.001 movesize=0.001 maxvel=0 vel=(0/0/0) timer=0.01 thingflags=0 damageclass=0 typeflags=0xd
Still haven't figured out a way to change the the game to wireframe mode or for a scope to go through walls... That is for the nightshot projectiles. I still need permission to post the weapon models for SaberMaster to see. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[edit]Forgot to post the templates! [http://forums.massassi.net/html/redface.gif] Also add bit more info[/edit]

[This message has been edited by Descent_pilot (edited August 18, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-15, 8:04 PM #2
Sounds good. But I'm not sure why you would want to zoom through a wall?
Team Battle.
2002-08-16, 4:17 AM #3
Good sniping, because you can also shoot through the wall. [http://forums.massassi.net/html/wink.gif] They'll never know what hit them.

I got a confession to make. I kinda got that idea from Perfect Dark's Farsight gun. [http://forums.massassi.net/html/redface.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-16, 6:10 AM #4
Now all you need is my 'blurry world' code...

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-08-16, 10:53 AM #5
Like in the GoldenEye Mod (Weap 10, primary fire)? And for what, the bounce scope or the Nightshot scope?

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-16, 12:44 PM #6
If any of you know me, I like to do it first, test the whole thing at once (well I do). I got two problems, why won't the "bryar" activate, it gets stuck in that endless loop with the other weapon's dismount key. Parsec only says unused assigned variables. The second problem is why won't the NightShot damaged anything, does that have to be a cog instead of a trailthing? Ahhh, help me! In theory it should work, because all the code is right for the first problem, and the template are correct. [http://forums.massassi.net/html/confused.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-16, 12:58 PM #7
Quote:
<font face="Verdana, Arial" size="2">If any of you know me, I like to do it first, test the whole thing at once (well I do).</font>


And that is exactly the wrong thing to do. You should always start with a minimal version of your system and then build on it. Otherwise, you only make debugging harder on yourself and the coding will suffer.

I'll test out the weapon and see what's wrong. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-16, 1:29 PM #8
SMs right.


I always do a small bit of code, to see if an idea is feasible. If it works, I improve the POC, until I am confident I have completed the original concept.


Building a new concept all at once causes unneeded problems. Start small.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-08-16, 2:25 PM #9
Alright, the reason the cog won't work is fairly simple. "end" is a reserved word marking the end of the cog, and you can't use it as a message name. The zoom system seems to need work also.

Quote:
<font face="Verdana, Arial" size="2">The second problem is why won't the NightShot damaged anything, does that have to be a cog instead of a trailthing?</font>


No, you can do it with a trailthing, but your templates aren't set up correctly. Try these:

Quote:
<font face="Verdana, Arial" size="2">+nstrail _weapon vel=(0/7/0) size=0.005 movesize=0.005 damage=100 typeflags=0xd model3d=bry0.3do

+nightshot _weapon model3d=con0.3do vel=(0/7/0) size=0.005 movesize=0.005 trailthing=+nstrail elementsize=0.3 damage=0 typeflags=0xa000 collide=0 range=5
</font>


These are fairly rough templates, but I think you should be able to customize them to what you need. The 0xa000 type flags for the nightshot and the range of 5 are important for the trailthing. Also, the orient of your _weapon is missing a '/'.

As for viewing surfaces as wireframes, that's just not practical for a patch. [http://forums.massassi.net/html/frown.gif]

Now, as much as I hate to say it, this isn't a showcase forum. 3d model pictures are hardly appropriate. But since you want, I'll gladly make a few visits to the Showcase Forum. [http://forums.massassi.net/html/wink.gif]

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

[This message has been edited by SaberMaster (edited August 16, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-16, 2:25 PM #10
Fine then! Humh. I'll go change my ways. SaberMaster, I'm sending you a gob will all the files. (The Nightshot is what you guys are suggesting for me to do, the bounce scope isn't exactly...)

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-16, 2:35 PM #11
I also just came up with this, the cogger's motto 'We make things happen.' [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-18, 6:46 AM #12
Thanks SaberMaster, here's the link to my most recent gun 3dos topic.

In theory, you fire the dummy CameraTpl, create the real camera at the postion, pyr, sector. Destroy the dummy, and the rest. The speed is 1000 so the distance is the zoom/1000 you sleep that much after firing the dummy.

Also, still can't get the trail things to work, I've tried a whole lot of stuff, still won't work. [http://forums.massassi.net/html/frown.gif]

If the Dummy is removed before the camera creation is called, how will I create a camera at its "hit" spot?

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited August 18, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-18, 11:38 AM #13
After much debugging, I have come to this conclusion, I had the templates backwards! [http://forums.massassi.net/html/eek.gif] Camera was suppose to be zoom_cam instead, We all forgot the obvious. Its always the easist things that we should look at first. But Alas, she still won't work. [http://forums.massassi.net/html/confused.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-18, 11:47 AM #14
Most of those models are fairly good. The models could be a little more detailed, but they would look good anyway with good textures. The best model there is the jeep. [http://forums.massassi.net/html/smile.gif]

As I said in my email, the gob you sent me seems to have been corrupted. If you'll send it again, I'll see if I can fix the zoom and trailthings.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-18, 12:42 PM #15
Thanks, I'm begging Hellcat to help me texture. (I owe him big for that) And I'll give you lots of credit and publisity in the creds and stuff. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-19, 6:44 PM #16
Oo oo oo, new thread by me. [http://forums.massassi.net/html/biggrin.gif] yea. yea. yea. Go take a look SaberMaster, and see what everybody's comments have done. [http://forums.massassi.net/html/wink.gif]

BTW - does anybody have an answer for my questions?

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-19, 9:34 PM #17
Sorry to bother during a talk, but how can a bullet go through walls?

I remember writing that sniping code, still can know its my coding.

------------------
http://millennium.massassi.net - Millennium
JK Mods : Sniper Arena! - Enhancement Pack!
2002-08-20, 4:25 AM #18
Realism and eithics aren't part of the science in Star Wars universe. What I'm saying is anything is possible. [http://forums.massassi.net/html/wink.gif] I all can find at Mellennium is the body percing projectile. I didn't take this from anybody, no matter how simaler it looks. [http://forums.massassi.net/html/wink.gif] I like to only use as little public stuff as I can. GoZ, there's a boy with a lot of cred...

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-20, 4:37 AM #19
Oh, and I'll be away playing golf (gotta love golf, maybe I should do a golf mod sometime...) [http://forums.massassi.net/html/biggrin.gif] up in Navada, near Lake Tahoe. And I'm not using edit just so I can inflate my post count. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-20, 5:24 AM #20
I don't want to look like an ego boosted man nor really blame you but my code looks too similar for me to keep from posting it.

Code:
stop_power:

	if(!(GetInv(player, 143) & 0x4)) return;

	SetThingCurGeoMode(player, GetThingGeoMode(player));
	ChangeInv(player, 143, -4);
	for(i = 127; i <= 134 ; i = i + 1) SetInvActivated(player, i, 0);
	SetInvActivated(player, 127 + GetInv(player, 143), 1);

	SetPulse(0);

	ParseArg(player, "maxrotvel=200 maxrotthrust=180");
	SetCameraFocus(0, player);
	SetInv(player, 120, 0.15);

	if( (OldFocus == 1) && (GetCurrentCamera() != 1) ) CycleCamera();
	SetInv(player, 146, 0);

	return;

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

pulse:

	if(!Stay)
	{
		if(Zoom)
		{
			ZoomMag = ZoomMag + ZoomCount * 0.005;
			if(ZoomMag > MaxZoom) ZoomMag = MaxZoom;
		}
		else
		{
			ZoomMag = ZoomMag - ZoomCount * 0.005;
			if(ZoomMag < 0.15) ZoomMag = 0.15;
		}

		ZoomFactor = VectorSet(0, ZoomMag, 0.037);
		ZoomCount = ZoomCount + 1;
	}

	if( (ZoomMag == 0.15) && !Zoom)
	{
		call stop_power;
		return;
	}

	Dummy = FireProjectile(player, CameraTpl, -1, -1, ZoomFactor, '0 0 0', 0, 0, 0, 0);
	SetThingPos(Dummy, VectorAdd(GetThingPos(Dummy), VectorScale(VectorNorm(GetThingLVec(Dummy)), -0.1)));
	SetCameraFocus(0, Dummy);

	FireProjectile(player, aim_tpl, -1, -1, VectorAdd(ZoomFactor, '0 0 -0.00095'), '0 0 0', 0, 0, 0, 0);

	SetInv(player, 120, ZoomMag - 0.1);
	if(GetCurrentCamera() == 1) CycleCamera();

	Return;


Probably it's used here and there by modders.

------------------
http://millennium.massassi.net - Millennium
JK Mods : Sniper Arena! - Enhancement Pack!
2002-08-20, 8:30 AM #21
The code is very similar. I had assumed when I first read the original cog that it was based on Hideki's zoom.

Quote:
<font face="Verdana, Arial" size="2">Oh, and I'll be away playing golf (gotta love golf, maybe I should do a golf mod sometime...)</font>


I've done a frisbee-golf patch. [http://forums.massassi.net/html/smile.gif]

Quote:
<font face="Verdana, Arial" size="2">Sorry to bother during a talk, but how can a bullet go through walls?</font>


The 0x4 Weapon Typeflag causes a weapon to explode when it hits a wall. Without the flag, it will travel through it.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-20, 2:24 PM #22
Thanks SM, but if I remember correctly, if the explosion flag was not set, it will just slide the surface to the edge as the projectile hits surfaces, not go through it.

Has anyone tested it?

------------------
http://millennium.massassi.net - Millennium
JK Mods : Sniper Arena! - Enhancement Pack!
2002-08-21, 11:50 AM #23
Ah, should have said it before: the projectile has its collide set to zero also. A trailthing is used to give damage since the projectile can't.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-21, 1:39 PM #24
Wow idea.

------------------
http://millennium.massassi.net - Millennium
JK Mods : Sniper Arena! - Enhancement Pack!
2002-08-21, 7:49 PM #25
I'm back, real golf is better. [http://forums.massassi.net/html/biggrin.gif] I did okay 122 on a private course, first time. Average for me. (Shut up, I've only been player golf for about 2 years) Then I shot a 131 on the regular course. Bad round. [http://forums.massassi.net/html/frown.gif]

It's been tested (now), it doesn't work. And yes I did use your zoom as a reference, but then agian, all the zooms I've found are like that. [http://forums.massassi.net/html/wink.gif]

Idea, VectorNorm(), it might not be created properly, so its beeing nulled instead, gotta go test it in the morning.

PS - remember Hideki, you can make fun of me all you want, boost you ego, what not, I don't care what you say, because... I have nothing to blackmail you with. SaberMaster, GBK, and me, we can blackmail each other all we want. [http://forums.massassi.net/html/wink.gif]

BTW - Can you give me the frisbe-golf patch, sounds fun. [http://forums.massassi.net/html/smile.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-23, 4:54 PM #26
Quote:
<font face="Verdana, Arial" size="2">BTW - Can you give me the frisbe-golf patch, sounds fun.</font>


I don't have it with me, I'll have to email for it. But I'll send it to you ASAP. [http://forums.massassi.net/html/wink.gif]

Anyways, did you get my email on the zoom cog and nightshot? I've fixed the cog and all, but I'm not sure what you want it to do since wireframe geometry isn't possible. [http://forums.massassi.net/html/confused.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-24, 2:37 AM #27
Ooh, can I have it too?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-08-24, 4:29 AM #28
It doesn't seem to be getting through to me. [http://forums.massassi.net/html/confused.gif] [url="mailto:ohbother@attbi.com"]mailto:ohbother@attbi.com[/url]ohbother@attbi.com</A> or [url="mailto:descent_pilot@yahoo.com"]mailto:descent_pilot@yahoo.com[/url]descent_pilot@yahoo.com</A> Try sending a quick E-mail to my home (first). I don't know why I'm not getting it? [http://forums.massassi.net/html/confused.gif]


BTW - I'll be gone by this afternoon for a whole week. [http://forums.massassi.net/html/biggrin.gif] (Sunny) Southern California. [http://forums.massassi.net/html/biggrin.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-24, 7:24 AM #29
Ok, I just emailed you. I don't know if you'll get them in time, though. You can resurrect this thread when you get back, and then we'll resolve the problems. [http://forums.massassi.net/html/wink.gif]

Sure, Grismath. [http://forums.massassi.net/html/smile.gif]

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

[This message has been edited by SaberMaster (edited August 24, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-28, 8:23 AM #30
I didn't read all the post's, so if this idea was already mentioned I'm sorry. [http://forums.massassi.net/html/smile.gif]

I have the Red Faction game that has a gun almost exactly like what you are talking about. Its called a rail gun. Also featured in Eraser with Swartchen'whatever is spelled ( LOL )

As for a scope, don't make it zoom through walls, you may have troubles with different Vid cards and homing, instead make it so that when you use the scope, it picks up on what in reality would be body heat. If the scope passes over a person on the other side of the wall, it out lines or creates a red figure shaped person in place of the person directly in sight. Kinda like infer red heat detection. That way theres an advantage and disadvantage to using the scope. Making it more fair to play with. Other wise you can just find a spot and view through walls and peg people off through out the game. I hope that helps in an idea for your project. I think the concept is very awsome to add to the game. [http://forums.massassi.net/html/tongue.gif]

------------------
Generation Knights - for MotS
( http://viper-studios.clanpages.com/ )
------------------------
2002-08-31, 4:55 PM #31
I'M BACK! [http://forums.massassi.net/html/biggrin.gif] Did you all miss me? For details on my trip, I'll post them tomarrow as I right myself with all the current events in my home and here at Massassi. [http://forums.massassi.net/html/wink.gif] now, on to "work." You know what, Viper has a good idea, I'll look into that. Thanks. [http://forums.massassi.net/html/smile.gif] I had a sh!!load of E-mail! Ahhh... SaberMaster, still haven't received any more from you, send it again as you did the quicke. I hope to hear from you guys soon.

Descent_pilot

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-01, 3:04 AM #32
Welcome back, Pilot. [http://forums.massassi.net/html/wink.gif]

You did get the cogs and templates I emailed you right?

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-01, 10:00 AM #33
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Descent_pilot:
Ahhh... SaberMaster, still haven't received any more from you, send it again as you did the quicke.
</font>


In other words, no did not recieve it. I dunno. [http://forums.massassi.net/html/confused.gif]

New E-mail, yeah!!!!!!!!! [url="mailto:descent_pilot@attbi.com"]mailto:descent_pilot@attbi.com[/url]descent_pilot@attbi.com</A> Try that one. Oh and thanks for welcoming me back. Unlike GBK... [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-01, 10:42 AM #34
Just showcasin' this cog, works just fine. Any suggestions are welcome even harsh ones. [http://forums.massassi.net/html/wink.gif]
Code:
# Jedi Knight Cog Script
#
# WEAP_FD-31C.COG
#
# WEAPON 6 Script - FD-31c
#
# This is a Freemod Defender's 31c sub-machine gun.
# This is the standard issue gun for all Caren freedom fighters
# Has both automatic and burst fire modes
#
# - Not affected by MagSealed sectors/surfaces.
#
# [DP]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

model       povModel=rptv.3do                   local
model       weaponMesh=rptg.3do                 local

keyframe    mountAnim=RptVmnt.key               local
keyframe    dismountAnim=RptVdis.key            local
keyframe    povfireAnim=RptVpst1.key            local
keyframe    holsterAnim=kyhlstr.key             local

sound       mountSound=df_bry_ready.wav         local
sound       dismountSound=PutWeaponAway01.wav   local
sound       fireSound=rpeatrlp.wav              local
sound       fireSound1=repeat-1.wav             local
sound       outSound=trprout.wav                local

vector      fireOffset                          local
vector      shakePos                            local
vector      shakeAngle                          local
vector      randVec                             local

template    projectile=+bullet                  local

thing       player                              local

flex        fireWait=0.1                        local
flex        powerBoost                          local
flex        autoAimFOV=25                       local
flex        autoAimMaxDist=5                    local
flex        holsterWait                         local

int         dummy                               local
int         trackID=-1                          local
int         mode                                local
int         fireChannel=-1                      local
int         ammoCost                            local
int         holsterTrack                        local
int         i                                   local
int         reloading=0                         local
int         round=0                             local
int         type=0                              local

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

end

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

code

startup:
   player = GetLocalPlayerThing();
   fireOffset = '0.0186 0.0102 0';

   Return;

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

Activated:
   mode   = GetSenderRef();
   jkSetWaggle(player, '0.0 0.0 0.0', 0);

   If(mode > 1) Return;

   If(round > 99)
   {
      Call reload;
      Return;
   }

   If(GetInv(player, 12) < 1)
   {
      PlaySoundThing(outSound, player, 1.0, -1, -1, 0x180);
      Return;
   }

   If (mode == 0)
   {
      If(type == 0) fireWait = .1;
      If(type == 1) fireWait = .5;
   }
   Else
   If(mode == 1)
   {
      If(reloading) Return;
      reloading = reloading + 1;
      type = 1 - type;
      Sleep(.1);
      reloading = reloading - 1;
      Return;
   }

   powerBoost = GetInv(player, 63);
   ActivateWeapon(player, fireWait/powerBoost, mode);
   jkPlayPOVKey(player, povfireAnim, 1, 0x38);

   Return;

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

Fire:
   mode = GetSenderRef();

   If(reloading) Return;

   If(round > 99)
   {
      Call reload;
      Return;
   }

   If(GetThingHealth(player) <= 0)
   {
      If(fireChannel != -1)
      {
         StopSound( fireChannel, 0.1 );
         fireChannel = -1;
         dummy = PlaySoundThing(fireSound1, player, 1.0, -1, -1, 0x180);
      }
      Return;
   }

   If(GetInv(player, 12) < 1)
   {
      If(GetAutoSwitch() & 1)
         SelectWeapon(player, AutoSelectWeapon(player, 1));

      If (fireChannel != -1)
      {
         StopSound( fireChannel, 0.1 );
         fireChannel = -1;
         dummy = PlaySoundThing(fireSound1, player, 1.0, -1, -1, 0x180);
      }
      Return;
   }

   shakePos = VectorScale(RandVec(),.001);
   shakeAngle = VectorScale(RandVec(),1);
   SetPOVShake(shakePos, shakeAngle, .05, 80.0);

   If(mode == 0)
   {
      If(type == 0)
      {
         If((round <= 99)&&(GetInv(player, 12) > 1))
         {
            If((fireChannel == -1))
               fireChannel = PlaySoundThing(fireSound, player, 1.0, -1, -1, 0x181);
            randVec = VectorSet((Rand()-0.5)*1.5, (Rand()-0.5)*1.5, 0.0);
            FireProjectile(player, projectile, -1, 8, fireOffset, randVec, 1.0, 0x30, autoAimFOV, autoAimFOV*2 );
            round = round + 1;
            ChangeInv(player, 12, -1);
         }
      }
      Else
      {
         For(i=0; i<3; i=i+1)
         {
            If((round <= 99)&&(GetInv(player, 12) > 1))
            {
               randVec = VectorSet((Rand()-0.5)*2, (Rand()-0.5)*2, 0.0);
               FireProjectile(player, projectile, fireSound1, 8, fireOffset, randVec, 1.0, 0x30, autoAimFOV, autoAimFOV*2 );
               round = round + 1;
               ChangeInv(player, 12, -1);
            }
         }
      }
   }

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

   If(round > 99)
   {
      If (fireChannel != -1)
      {
         StopSound( fireChannel, 0.1 );
         fireChannel = -1;
         dummy = PlaySoundThing(fireSound1, player, 1.0, -1, -1, 0x180);
      }
      Call reload;
      PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80);
      Return;
   }

   If(GetInv(player, 12) == 0)
   {
      If (fireChannel != -1)
      {
         StopSound( fireChannel, 0.1 );
         fireChannel = -1;
         dummy = PlaySoundThing(fireSound1, player, 1.0, -1, -1, 0x180);
      }

      If(GetAutoSwitch() & 1)
         SelectWeapon(player, AutoSelectWeapon(player, 1));
   }

   Return;

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

Deactivated:
   mode = GetSenderRef();

   jkSetWaggle(player, '10.0 7.0 0.0', 350);
   if(fireChannel != -1)
   {
      StopSound( fireChannel, 0.1);
      fireChannel = -1;
      PlaySoundThing(fireSound1, player, 1.0, -1, -1, 0x180);
   }
   DeactivateWeapon( player, mode );

   Return;

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

Selected:
   PlayMode(player, 41);
   PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);

   jkSetPOVModel(player, povModel);
   SetArmedMode(player, 1);
   jkSetWeaponMesh(player, weaponMesh);
   jkSetWaggle(player, '10.0 7.0 0.0', 350);

   trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
   SetMountWait(player, GetKeyLen(mountAnim));

   jkClearFlags(player, 0x5);
   SetCurWeapon(player, 6);

   If(round > 99) Call reload;

   Return;

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

Deselected:
   If(fireChannel != -1)
   {
      StopSound(fireChannel, 0.1);
      fireChannel = -1;
   }

   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;

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

Newplayer:
   If(fireChannel != -1)
   {
      StopSound(fireChannel, 0.1);
      fireChannel = -1;
   }
   Return;
   
# ........................................................................................

Killed:
   If (player == GetSenderRef())
   {  
      If(fireChannel != -1)
      {
         StopSound(fireChannel, 0.1);
         fireChannel = -1;
      }
   }
   Return;

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

Autoselect:
   // If the player has the weapon
   If(GetInv(player, 6) != 0.0)
   {
      // If the player has ammo
      If(GetInv(player, 12) != 0.0)
      {
         ReturnEx(800.0);
      }
      Else
      {
         ReturnEx(-1.0);
      }
   }
   Else
   {
      ReturnEx(-1.0);
   }

   Return;

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

Timer:
   If(GetSenderId() == 2)
   {
      StopKey(player, holsterTrack, 0.0);
      Return;
   }

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

Reload:
   reloading = reloading + 1;
   PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);
   Sleep(1);
   round = 0;
   reloading = reloading - 1;
   Return;

end
A few minor things are going to be added/changed to make it look/sound/act correctly. (ie. models/keyframes/sounds) [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited September 01, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-01, 2:45 PM #35
Here's a new system that will give the player stars based on certain requirements.
Code:
# Jedi Knight Cog Script
#
# TALLY.COG
#
# This is the Master tally and scoring system cog.
# Handles
# Overall Accuracy
# Total Head shots
# Total Body shots
# Total Stars given out
# Par time to be handled by the Master level cogs
#
# [DP]
#
# Triggers
# 101 - Head hit 102 - Body hit 103 - Right Arm hit 104 - Left Arm hit
# 105 - Right Leg hit 106 - Left Leg hit 107 - Right before endlevel

symbols
flex        totalHits=0                                  local

int         totalGuys=0                                  local
int         totalShots=0                                 local
int         headHits=0                                   local
int         bodyHits=0                                   local
int         rarmHits=0                                   local
int         larmHits=0                                   local
int         rlegHits=0                                   local
int         llegHits=0                                   local
int         i                                            local

thing       player                                       local

message     startup
message     trigger

end

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

code
Startup:
   player = GetLocalPlayerThing();
   For(i=0;i<=GetThingCount();i=i+1) If(GetThingType(i) == 2) totalGuys = totalGuys + 1;
   Return;

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

Trigger:
   If(GetSenderID() == 100) totalShots = totalShots + 1;
   Else
   If((GetSenderID() >= 101)&&(GetSenderID() <= 106))
   {
      totalHits = totalHits + 1;
      i = GetSenderID() - 100;
      totalHits = totalHits + 1;
   }
   Else
   If(GetSenderID() == 107)
   {
      If(!GetParam(0))
      {
         JKEndLevel(0);
         Return;
      }

      If((GetInv(player, 71) != 0) && (GetInv(player, 70) == GetInv(player, 71)))
         ChangeInv(player, 16, 1);     // Secret Areas
      If((totalHits/totalShots) >= .9)
         ChangeInv(player, 16, 1);     // 90% accuracy or greater
      If(headHits > (totalGuys/2))
         ChangeInv(player, 16, 1);     // 1/2 guys with a round in their heads

      // More to be added, ex tally screen and stuff.

      JKEndLevel(1);
   }
   Return;

end
The accuracy sending code is simple, the head shot part is abit more time consuming then anything, and the tally screen will be easy. Neat little system if I do say so myself. [http://forums.massassi.net/html/smile.gif] Input please. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited September 02, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-02, 10:53 AM #36
OK, I'll send the files again to your new address, although I think my Yahoo account
is to blame. [http://forums.massassi.net/html/frown.gif]

I tried out the weapon cog there, and it works well enough. Seconday fire is a bit
loud, though, because there's three firesounds playing almost at once.

The tally cog is a neat idea, but I see two things there: A sleep() on startup isn't a
catch-all fix or requirement, and you'll need GetSourceRef() to retrieve the trigger's
ID. And I'm curious to know how you'll create the tally screen. [http://forums.massassi.net/html/smile.gif]

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

[This message has been edited by SaberMaster (edited September 02, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-02, 5:07 PM #37
Quote:
<font face="Verdana, Arial" size="2">To die, to Sleep(). To Sleep(), perchance to dream...</font>


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

[This message has been edited by SaberMaster (edited September 03, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-02, 6:11 PM #38
OKay, I guess I should explain it, now that I'm back from Ice Cream. [http://forums.massassi.net/html/smile.gif] Nevermind, once agian SaberMaster has taught me something about cogs. I assumed (a bad thing to do) that fire would only be called after ActivateWeapon(); was called, or in other words - Player Input only. [http://forums.massassi.net/html/redface.gif] Thank you SaberMaster.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[edit - thank you. [http://forums.massassi.net/html/wink.gif] ]

[This message has been edited by Descent_pilot (edited September 03, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-05, 4:33 AM #39
Ok, I just wanted to say... um.... *clears throat and hums kazoo*

Happy birthday to me, happy birthday to me.
Happy birthday dear Descent_pilot.
Happy birthday to me.

[ElvisVoice]Thank you very much.[/ElvisVoice]

[http://forums.massassi.net/html/biggrin.gif] *bows*

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-06, 12:28 PM #40
And no one wished me a happy birthday, same on you. [http://forums.massassi.net/html/wink.gif] 9,999.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
12

↑ Up to the top!