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 → simple/diverse cogger help
12
simple/diverse cogger help
2002-07-12, 12:27 PM #1
Hey im wondering if anyone would like to help me with a mod im working on, I just need a sort of 'advisor' as far as cogging, im very new to it and my mod is pretty simple but its still over my head, let me know if your interested here or icq: 52848698 any help appreciated.

cogs im looking into:
-class system
-scoring system
2002-07-12, 12:50 PM #2
Let me say this first, before GBK or SaberMaster says it. Welcome to Massassi Forums or Massassi all together. No offense or anything, but you should try doing little things to a weapon cog first, and test it, but DON'T I repeat DON'T release a bunch of hacks onto Massassi, we have enough already.

Onto the job. Good references are JKSpecs and Massassi's tutorials Tutorials can help you get under way. The JKSpecs are a great reference source.
As for your mod. Post the cogs here and GBK, SaberMaster, and/or I will look over them, completly free of charge, because thats what we do. Right guys? [http://forums.massassi.net/html/wink.gif] Another thing go see is my thread on my most recent ship model. (yes I'm cross referencing and making a fool out of myself, but I want people to see [http://forums.massassi.net/html/redface.gif] )

------------------
The Sniper Missions. Current project, The Sniper Missions <---------- [edit]See this part down here, go get your own signature, otherwise we won't help you[/edit]

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

Completed
Judgement Day (HLP), My level pack
2002-07-12, 12:58 PM #3
I have some experience writing weapon cogs... just like changing projectiles and rates of fire and all that... but nothing as far as "multiplayer features" so im wondering where the best place to start is?
2002-07-12, 1:05 PM #4
What do you mean by class system? The Scoring in JK and MotS is done by the Game's engine (which we can't modify) But to add your own scoring system, that would be cogging ex. CTF. That what you're talking about by scoring system?
[Oh, and go to profile, get a sig and check the Display Signiture box in the reply page.]
------------------
The Sniper Missions. Current project, The Sniper Missions

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

Completed
Judgement Day (HLP), My level pack
2002-07-12, 1:59 PM #5
Pilot, I don't think we needed you to go into detail like that. [http://forums.massassi.net/html/rolleyes.gif]

Mischa, few people would be willing to commit themselves to your project, but feel free to post on this forum any questions you have. Explain carefully what you want to do, and we'll help you to code it. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-12, 2:01 PM #6
okay the class system would be like:
player joins game, uses numerical selection menu (if possible) to join team 1, or 2
then when team is selected, be prompted for class (say light, medium, and heavy)

scoring system modifications I was describing were:
player does action 'x' and gets 'x' kills

or would that all have to be cogged through a map?
------------------
Blue Spandex.
WHEEEEEEEEEE.

[This message has been edited by sgt_mischa (edited July 12, 2002).]
2002-07-12, 2:27 PM #7
Good sig. I guess SaberMaster has got it from here.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-12, 6:03 PM #8
I have zero experiance with ingame menus, but Im fairy sure its possible...


Learn the basics before you try to tackle something big like that.

------------------
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-07-12, 7:31 PM #9
Thank you for the advice, My main question was IS IT POSSIBLE, but I will try and get some experience before I start on that project.. and when I do you can be sure to hear my girly screams of "HEEEEEELP" but until then, thanks and see you when im smart or close to it

[This message has been edited by sgt_mischa (edited July 13, 2002).]
2002-07-13, 8:00 AM #10
Yes, what you want to do is certainly possible, although the selection menu is fairly difficult.

Make some preliminary patches and read some tutorials to gain experience. I would recommend the DataMaster as a good reference and tutorial, but I'm biased. [http://forums.massassi.net/html/tongue.gif]

Good luck, Mischa. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-13, 9:14 AM #11
Where is the DataMaster tutorial that your mentioning... I am fairly new to cogging ive never written one from scratch and im curious, do programs help? or is notepad the way to go...

------------------
Blue Spandex.
WHEEEEEEEEEE.
2002-07-13, 9:44 AM #12
As a (no offense intended) n00b cogger, you might want to use "Cogwriter". It has a built-in syntax checker, that will catch some of the more common mistakes...


You can find it in the programs section here at Massassi.

------------------
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-07-13, 10:53 AM #13
n00b cogger? *sniff* IM A n00b COGGER YAY!!! Moved up I guess [http://forums.massassi.net/html/smile.gif] Another question specific this time! I haven't downloaded cogwriter yet but in notepad I modified the repeater so it used a different sound, but the sound only plays once on full auto... also I want to make the projectiles so that 4 shots are NO projectile and the 5th shot is the repeater projectile.. any ideas ?

------------------
Blue Spandex.
WHEEEEEEEEEE.

[This message has been edited by sgt_mischa (edited July 13, 2002).]
2002-07-13, 11:09 AM #14
The menu thingy would be easier in MotS, palyeraction (thinking of doing something like that in one of mine). No offense, but a n00b (aka noobie and newbie) coggers is the bottem of cogging, if you show us something good, you could very easily become a biginner, then intermedate, advanced (my level), then the masters (GBK, SaberMaster, and Hideki). That's how I do it anyways, don't know how you two (GBK,SM) do it.

Add int i local to the symbols section.
Add this right before the FireProjectile line.
Code:
If(i<4) i = i + 1;
Else
{
   FireProjectile(blah blah this is the line said above ^^^);
   i = 0;
}
Also add this after startup: and selected:
i = 0;
That way, you will have to fire the four shots, no matter what you finsih on.
For the sound, just change the sound file in the symbols section and leave everything else it should work.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-13, 12:33 PM #15
wheee okay im going for it... hopefully it will work but I kind of am starting to understand the layout of these weapon cogs... just some of the stuff is in arabic or something so ill continue staring

-------------------------
if (mode == 0)
If(i<4) i = i + 1;Else{ FireProjectile(); i = 0;}
{
dummy = FireProjectile(player, projectile, -1, 8, fireOffset, '0 0 0', 1.0, 0x30, autoAimFOV, autoAimFOV*2 );
}
-----------------------
(sorry I dont remember the small quote thing)
is that right or did I manage to screw it up?

------------------
Blue Spandex.
WHEEEEEEEEEE.

[This message has been edited by sgt_mischa (edited July 13, 2002).]

[This message has been edited by sgt_mischa (edited July 13, 2002).]
2002-07-14, 3:20 AM #16
You have an extra code block in there, Mischa. It should be something like:

Code:
if(mode == 0)
If(i < 4) i = i + 1;
else
{
 dummy = FireProjectile(player, projectile, -1, 8, fireOffset, '0 0 0', 1.0,
 0x30, autoAimFOV, autoAimFOV*2 );
 i = 0;
}


The if statement runs the next statement (EG, i=i+1) or code block (EG, { code here })
if the condition (EG, (i<4)) is true. If the condition is false, JK ignores the statement
or block after the if statement.

If there's an else statment following that code and the if statement's condition was
false, JK will run the statement or block after the else; but otherwise, it will
ignore the code after the else.

The problem with the code in your last post was that you had two code blocks after the
else statement.

Pilot, what do you intend this code to do? You're stopping the player from firing four
times before he fires... [http://forums.massassi.net/html/confused.gif]

As for the DataMaster, the link is in my signature. It's a JK Cog reference written
in HTML. It includes basic and advanced tutorials.

For text editors, there's CogWriter and EditPlus. CogWriter has a convenient syntax
checker, but EditPlus is by far easier to use. I've created some user files for
EditPlus so you can it's autocompletion, syntax highlighting, and cliptext library
features with Cogscript.

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited July 14, 2002).]

[This message has been edited by SaberMaster (edited July 19, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-14, 4:47 AM #17
*gurgle* thank for the help guys... Been up all night reading about cogs and did not kno what I was getting into. But hey my bryar pistol has a scope on it now yaaay! maybe ill write my own and not follow a tutorial someday [http://forums.massassi.net/html/smile.gif]

------------------
Blue Spandex.
WHEEEEEEEEEE.
2002-07-16, 10:24 AM #18
SavageX actually had a simple ingame menu system kind of like what you were describing in SS3 8.5. I believe it worked on the same principle as custom crosshairs for its graphic effect. However, the MotS playeraction verbs would make it a lot easier to do it 'cleanly'.
2002-07-17, 7:06 PM #19
It did not in fact work like custom crosshairs. I opened the cog to take a look, being the incredibly curious sort that I am, and discovered that he used jkSetPOVmodel(). There's a different model for each variation in the screen. Seems odd, but I think it looks a lot better than sprite-based menu systems.

------------------
Christianity: Don't knock it if you haven't tried it.

Why should the devil have all the good music? www.thousandfootkrutch.com

[This message has been edited by TheTwistedSpasm (edited July 17, 2002).]
Cynic (sin'ik) n. One of a sect of ancient Greek philosophers who held that virtue is the ultimate goal of life, their doctrine gradually coming to symbolize insolent self-righteousness.

Drink So-Be, and play longer!
2002-07-18, 3:07 PM #20
Wow thanks for the help, I have messed around a lot with weapon cogs and gotten some results but I have a theory and im curious how to go about it, I have a general idea of making symbols/new blocks of code so my idea anyway was, on the stormtrooper rifle I was going to add a bit of code where the weapon would "holster" play a sound, then come back up (just use the holster animation, playsound, unholster) but the area im worried about is how would I get that code to "work" as a bind, like triggered by a button... where it would store the ammo but only a certain amount could be in the gun at a time?
------------------
Blue Spandex.
WHEEEEEEEEEE.

[This message has been edited by sgt_mischa (edited July 18, 2002).]
2002-07-19, 12:02 PM #21
Alright, so you want to make some sort of reloading system? Assuming you have your hotkey set up, here's what to do:

Put this in the activated message of your hotkey cog:
Code:
player = GetLocalPlayerThing();
SendMessage(GetInvCog(player, GetCurWeapon(player)), user0);

This will call the user0 message in the cog of the current weapon.

Add this at the beginning of the fire message in the weapon cog:
Code:
count = count + 1;
if(count > 4) { Print("Out of ammo. Reload."); Return; }


And add this message to the cog:
Code:
user0:

disID = jkPlayPOVKey(player, dismountAnim, 0, 0x4);
SetMountWait(player, GetKeyLen(holsterAnim));
holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
if(trackID != -1) { jkStopPOVKey(player, trackID, 0); trackID = -1; }

Print("Reloading...");
Sleep(1);
Print("Reloaded!");

StopKey(player, holsterTrack, 0);
PlayMode(player, 41);
jkStopPOVKey(player, disID, 0);
trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
SetMountWait(player, GetKeyLen(mountAnim));
count = 0;

Return;


Now make sure that you define all of the symbols used here. And for count, make sure you initialize it to zero in the cog's startup message. This system isn't perfect, but it's a good beginning for you.

Good luck. [http://forums.massassi.net/html/wink.gif]


------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited July 19, 2002).]

[This message has been edited by SaberMaster (edited September 21, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-19, 4:40 PM #22
Okay being as newbish as I am there generally tend to be questions, such as on hotkey in items.dat should I make it an item? also im confused about what symbols I need, and what type they are (ie flex, int, whatever) because I kind of understand the code for the rest of it, kind of [http://forums.massassi.net/html/wink.gif]

------------------
Blue Spandex.
WHEEEEEEEEEE.
2002-07-20, 4:20 AM #23
I think all the symbols are already defined in the cog except disID and count, and those are "int"s.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-20, 6:49 AM #24
alright I think I got it, except does the hotkey have to be a new cog?
Quote:
<font face="Verdana, Arial" size="2">
int count=0 local
int disID local
</font>


or is disID supposed to be =-1 ?

and descent JUST checked out your ships, you use milkshape for those?? Pretty nice [http://forums.massassi.net/html/smile.gif] you need to get 3ds max bro lol...
http://www.geocities.com/sgt_mischa is just an archive of some of the weapons ive made in 3ds... texturing jobs were to embarrasing to post however [http://forums.massassi.net/html/wink.gif]

------------------
Blue Spandex.
WHEEEEEEEEEE.

[This message has been edited by sgt_mischa (edited July 20, 2002).]
2002-07-20, 9:39 AM #25
Your weapons are pretty good. All of my models were made in JED and rendered in Milkshape. They are all going to go into my projects. My site has my current 3dos posted, soon to add more (and textured {as soon as I can Fuc'ing find out how to take screenshots in JED/Desktops/comp}). [http://forums.massassi.net/html/wink.gif] As for your questions, yes there has to be a new cog (very simple) for this peticular hotkey assignment (a fire 3, kinda), and disID should be -1. [http://forums.massassi.net/html/wink.gif]

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

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

Completed
Judgement Day (HLP), My level pack
2002-07-20, 9:56 AM #26
Ahaa, screenshots in jed, easy, printscreen, paste into whatever gfx prog you use and a screen you have... I like the ship dude http://www.geocities.com/descent_pilot/Pic0.html.

okay im very impressed with myself for guessing that disID was -1...but then I am wondering about that hotkey cog, what will it comprise of?? are there any other ones I can use as example?

------------------
Blue Spandex.
WHEEEEEEEEEE.
Mischa Design

[This message has been edited by sgt_mischa (edited July 20, 2002).]
2002-07-20, 11:23 AM #27
Here's a cog that allows you to have a 3rd fire. You can change the User0 to the rearm instead of a third fire...
Code:
# Jedi Knight Cog Script
#
# FIRE3.COG
#
# Activates 3rd mode for every weapon
#
# [DP]
#

symbols

thing		player				local

message	activated

end                                                                           

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

code
activated:
player = GetLocalPlayerThing();

SendMessage(GetInvCog(player, GetCurWeapon(player)), user0);
Return;
end
Simple isn't it. Like my new sig. \/ \/ \/

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

The Magician Saber System.

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

Completed
Judgement Day (HLP), My level pack
2002-07-20, 12:23 PM #28
cool thanks, im gonna try it out now, I just put "fire3.cog" in my cog folder with the others and it will work?
2002-07-20, 12:35 PM #29
Need to change Items.dat, and jkstrings.uni. Other then that, put all of those files in with your project and your good to go. Add this line to Items.dat
Code:
reload_fire3            116             0       1       0x120   cog=fire3.cog
and this line to jkstring and update the count.
Code:
   "ACTIVATE17"      0 "Reload/fire3"
There, now you should be able to reload using a new hotkey.

Or you can do it the simplier way.
Add SendMessage user0; between Print("Out of Ammo") and return; in the fire message and you don't have to have the hotkey or items or Jkstrings, so when you run out of ammo, it sorta auto-reloads. [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-07-20, 1:15 PM #30
argh, got in game and my gun didnt stop firing after 30 shots
//back to basic---

ah okay I messed with it, now the gun doesnt shoot, whenever I press fire it just prints the "OUTTA AMMO RELOAD" message

------------------
Blue Spandex.
WHEEEEEEEEEE.

[This message has been edited by sgt_mischa (edited July 20, 2002).]
2002-07-20, 1:35 PM #31
If you did exactly what SaberMaster said it should work.

------------------
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-07-20, 1:46 PM #32
poop.

Code:
int         count=0         local
int         disID=-1        local

that was in symbols
Code:
code

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

  if(count > 30) { Print("Reload!!");        
   Return;  }

and further down:
Code:
   user0:
   disID = jkPlayPOVKey(player, dismountAnim, 0, 0x4);
   SetMountWait(player, GetKeyLen(holsterAnim));
   holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
   if(trackID != -1) { jkStopPOVKey(player, trackID, 0); trackID = -1; }
   Print("Standby...");
   Sleep(1);
   Print("Good to go!");
   StopKey(player, holsterTrack, 0);
   PlayMode(player, 41);
   jkStopPOVKey(player, disID, 0);
   trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
   SetMountWait(player, GetKeyLen(mountAnim));
   count = 0;
   Return;

thats the place I was most likely to go wrong....


------------------
Blue Spandex.
WHEEEEEEEEEE.
2002-07-21, 5:10 AM #33
At the bottem of the Fire: add count = count + 1; SaberMaster made an assumption that you'd put that line in the cog. You have to increase the count otherwise it won't work. It should work, all you did was change what's printed.

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

The Magician Saber System.

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

Completed
Judgement Day (HLP), My level pack
2002-07-21, 5:15 AM #34
I was just about to say that, Pilot. You beat me to it by about half a minute. [http://forums.massassi.net/html/smile.gif] Anyway, I should have said to put that count increment in. [http://forums.massassi.net/html/redface.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited July 21, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-21, 5:54 AM #35
YAY it worked... except the reload part now I am double checking what I did :O

well doom on me...
nothing I do makes the gun reload :@
fire3.cog is right, everything else seems in place I dont kno whats wrong..
------------------
Blue Spandex.
WHEEEEEEEEEE.

[This message has been edited by sgt_mischa (edited July 21, 2002).]
2002-07-21, 8:27 AM #36
Did you bind a key to the hotkey? Did you update the JKStrings.uni count? Add message user0 in the symbols of the weapon cog? If you say no to any of these, go back and change them. Reply with your findings.

------------------
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-07-21, 10:35 AM #37
oh no... I said yes to all the above and double checked!

wait wait wait, you say add user0 to the symbols? AH DOH
int user0 local right?

int user0 local
is in the symbols on the weapons cog... to no avail grrrr
------------------
Blue Spandex.
WHEEEEEEEEEE.


[This message has been edited by sgt_mischa (edited July 21, 2002).]
2002-07-21, 11:43 AM #38
No, no, it should be a message, not an integer. Put this in the symbols:
Code:
message user0


I suspect that your hotkey may not be working. Follow this tutorial to make a hotkey (the DataMaster also includes a hotkey tutorial).

Try that and then see how it works.

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited July 21, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-21, 1:03 PM #39
****.. I did everything you said I remember setting the hotkey up correctly (as you guys told me too) but I realized in items.dat I forgot to save my addition so I did and reload still didnt go... im thinkin I missed a ; or , somewehre :@

wait... could it be the fact of WHERE in the cog I put the user0 reload part? because I put it in the "fire" section under the primary/secondary fire....
should it go under activate? or in its own entirely new section?

nope.. that wasnt it
whew okay bear with me this is gonna be freckin long:
Code:
# Jedi Knight Cog Script
#
# WEAP_MP5SD3.COG
#
# WEAPON 3 script - Machinen Pistole Fünf Schalldämpfer Drei 
#
#
#
# [YB & CYW]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

model       povModel=strv.3do                   local
model       weaponMesh=strg.3do                 local

keyframe    mountAnim=StrVmnt.key               local
keyframe    dismountAnim=StrVdis.key            local
keyframe    povfireAnim=StrVpst1.key            local
keyframe    holsterAnim=kyhlstr.key             local

sound       mountSound=df_rif_ready.wav         local
sound       dismountSound=PutWeaponAway01.wav   local
sound       fireSound=mp5sd3.wav              local
sound       outSound=blank.wav                local
sound       clicksound=click.wav              local

template    projectile=+repeaterball                 local

thing       player                              local

vector      randVec                             local

flex        fireWait=0.04                        local
flex        holsterWait                         local
flex        powerBoost                          local
flex        autoAimFOV=1                       local
flex        autoAimMaxDist=1                    local

int         dummy                               local
int         trackID=-1                          local
int         fireChannel=-1                      local
int         holsterTrack                        local
int         mode                                local
int         count=0                             local
int         disID                               local


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

end

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

code

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

   if(count > 30) { Print(" Reload!!");        
   Return;  }

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

   if(GetInv(player, 11) < 1.0)
   {
      PlaySoundThing(outSound, player, 1.0, -1, -1, 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);
   if(mode == 0)
   {
   dummy = FireProjectile(player, projectile, fireSound, 8, '0.0100 0.1200 0.00', randVec, 1.0, 0x30, autoAimFOV, autoAimFOV*2);
   (dummy, vectorScale(GetThingVel(dummy), 0.01));
   ChangeInv( player, 11, -1.0 );
   count = count + 1;
   }
   else
   {
   PlaySoundThing(clicksound, player, 1.0, -1, -1, 0x80);
   }

   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();
   jkSetWaggle(player, '10.0 7.0 0.0', 350);
   DeactivateWeapon(player, mode);
   Return;

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

selected:
   player = GetSourceRef();

   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, 3);

   Return;

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

deselected:
   player = GetSourceRef();

   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, 3) != 0.0)
   {
      // If the player has ammo
      if(GetInv(player, 11) != 0.0)
      {
         ReturnEx(600.0);
      }
      else
      {
         ReturnEx(-1.0);
      }
   }
   else
   {
      ReturnEx(-1.0);
   }

   Return;

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

   user0:
   disID = jkPlayPOVKey(player, dismountAnim, 0, 0x4);
   SetMountWait(player, GetKeyLen(holsterAnim));
   holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
   if(trackID != -1) { jkStopPOVKey(player, trackID, 0); trackID = -1; }
   Print("Standby...");
   Sleep(1);
   Print("Good to go!");
   StopKey(player, holsterTrack, 0);
   PlayMode(player, 41);
   jkStopPOVKey(player, disID, 0);
   trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
   SetMountWait(player, GetKeyLen(mountAnim));
   count = 0;
   Return;

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

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

end

thats my cheapy example gun cog.. somethin wrong in there?
------------------
Blue Spandex.
WHEEEEEEEEEE.


[This message has been edited by sgt_mischa (edited July 21, 2002).]
2002-07-21, 3:26 PM #40
It's a new "section", its a new message so it doesn't go in Fire or Activated.

------------------
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!