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.

ForumsJedi Outcast and Jedi Academy Editing Forum → Emotes for Dummies
Emotes for Dummies
2003-12-14, 11:23 AM #1
Echoman requested a simple coding tutorial. So I'll post this here for anyone that wants to wade into the ocean of coding.
This is my first tutorial so I hope it works and if it doesn't please post something so I can edit it.
Feel free to ask any questions. [http://forums.massassi.net/html/smile.gif]

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.
2003-12-14, 11:25 AM #2
Adding new emotes to Jedi Outcast

Tools Needed:

ModView ( http://www.massassi.net )
JK2 Editing Tools Update ( http://www.massassi.net )
Modified Batch Files ( http://ugg.codealliance.ca/modbat/ )
Pakscape
Visual C++ (Optional)

This tutorial is a little longer because I have to explain the process of compiling. So just hold in there.

When you download the modified .bat files the website will say they are only for Windows 98 but they work with XP, 2000, ME, NT... as well. And sometimes the Raven ones give you problems. [http://forums.massassi.net/html/rolleyes.gif]

The first thing you need to do is to install the JK2 Editing Tools. This will install the Multiplayer source needed to create a MP mod.

When installed it should create C:\Program Files\LucasArts\Star Wars JK II Jedi Outcast\GameData\code. Go into the code directory and open the folder called game. In that folder there should be a file called g_cmds.c open this file in Notepad or Visual C++.

When it is opened in Notepad do a search (CTRL-F) using "give" with the "" as the search.

Near the end you should find a line that says:

if (!Q_stricmp(cmd, "give"))
{
giveError = qtrue;
}

Under this line add this code:

else if (Q_stricmp(cmd, "hero)
{
giveError = qture;
StandardSetBodyAnim(ent, BOTH_STAND7, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS);
}

Basically what this does is if you type hero into the console. Run the animation code for the curent player.

So the whole thing should look like.

if (!Q_stricmp(cmd, "give"))
{
giveError = qtrue;
}
else if (Q_stricmp(cmd, "hero)
{
giveError = qture;
StandardSetBodyAnim(ent, BOTH_STAND7, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS);
}

Save the file.

In the Modified Batch .zip file there should be a file called game.bat copy this file into you C:\Program Files\LucasArts\Star Wars JK II Jedi Outcast\GameData\code\game folder. This .bat file should replace the old one. Run the .bat file by clicking on it.

This should pop up a dos prompt and scroll some text for a while.

When the window disappears. There should be a new folder in your code directory called base.
Inside this folder there is another folder called vm. And inside that folder there is a file called Jk2mpgame.qvm.

Create a new folder inside your game directory (C:\Program Files\LucasArts\Star Wars JK II Jedi Outcast\GameData\HeroMod) called HeroMod.

Now open Pakscape. Create a new file. Inside that file, create a new folder called vm. Inside that folder put the jk2mpgame.qvm file. Save the whole file as HeroMod.pk3 and place it into your HeroMod directory.

You’re done the hard stuff.

Run Jedi Outcast. Go to the Mods Setup Menu. Select HeroMod. The game should load again. Create a new game. Once it loads press SHIFT- ~ to bring up the console.
Then type in

bind h hero

press enter.

Now press H and your character should do the hero animation.

Extra Credit:

If you want to add different emotes then you need to get the animation code for the specific animation. And change this line

StandardSetBodyAnim(ent, (YOURANIMCODE HERE), SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS);

Some sample animations codes:

BOTH_DODGE_BL (Does a Matrix Style Dodge)
BOTH_ENGAGETAUNT (Does the challange taunt)
BOTH_EXAMINE1 (Makes you fiddle with your weapon)
BOTH_MELEE1 (Does a punch)

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.

[This message has been edited by Freyr (edited December 14, 2003).]

[This message has been edited by Freyr (edited December 15, 2003).]
Free your mind, use Open Source.
2003-12-14, 12:42 PM #3
Hey you can actually submit this to the tutorial section on this site (with pics) [http://forums.massassi.net/html/smile.gif]

good work. Make sure to elaborate in any parts you might consider confusing.

Here is the tutorial submission guide:
Quote:
<font face="Verdana, Arial" size="2">
Tutorials:
Submitted tutorials remain copyrighted by the author first, and Massassi second. We have not, in the past, released our tutorials for posting on other sites. However, we may do this in the future, so when you submit a tutorial, please let us know if it is okay for us to release your tutorial to other sites for posting. Please submit tutorials in HTML format if possible. Include all images in web-ready graphics such as GIF or JPG. If you do not know HTML, but want to submit a tutorial, write it in plain text format (Notepad), and make arrangements for one of our staff to convert it. We reserve the right to edit for spelling, grammar, and formatting. We now format all tutorials to the Massassi format, but the formatting in the copy you originally submitted it in will remain intact in the ZIP we offer for download.

Send tutorial submissions to tutorials@massassi.net.
</font>



------------------
Snail racing: (500 posts per line)
---@%
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-14, 1:33 PM #4
I was hoping someone would try it out first and tell me if it worked. It's hard to predict the actions of someone who knows nothing of code from a person who knows a lot. Then I'll "officilize" it. [http://forums.massassi.net/html/smile.gif]

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.
2003-12-14, 1:39 PM #5
Ok. I'll test it. I'll pretend I'm a complete dumba** [http://forums.massassi.net/html/wink.gif]

------------------
Snail racing: (500 posts per line)
---@%
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-14, 1:44 PM #6
Works for me [http://forums.massassi.net/html/smile.gif]


------------------
Snail racing: (500 posts per line)
---@%
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-14, 1:48 PM #7
Can you answer some of these questions for me when your done?

Have you ever coded JO/JA before?
What parts were difficult to understand?
Should I add more?

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.

[This message has been edited by Freyr (edited December 14, 2003).]

[This message has been edited by Freyr (edited December 14, 2003).]
Free your mind, use Open Source.
2003-12-14, 2:16 PM #8
1-I don't have C++. I have Notepad. I barely into coding (but learning)

2-Finding

if (!Q_stricmp(cmd, "give"))
{
giveError = qtrue;
}

I was uneasy when I saw this and the other file contents. I had to check if I got the right one. I didn't what to screw the whole thing up.

When I typed the link of http://ugg.codealliance.ca/modbat/ the page said

"This is for Windows 98 users who cannot get the original batch files to work.
It replaces the batch files in the game, cgame, and ui folders. It also adds a backup folder containing the original batch files."

I was uneasy about this because I have XP.

I got through it (and used logic and the tutorial)

3-A person might say to himself, "Is this for JO MP or SP?"

What about the other emotes (like dancing and such?)


------------------
Snail racing: (500 posts per line)
---@%

[This message has been edited by Echoman (edited December 14, 2003).]
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-14, 3:01 PM #9
Glad it worked for you. I'll be fixing/adding it tommorow. Your feedback really helped. Hopefully I'll be able to make more tutorials. [http://forums.massassi.net/html/biggrin.gif]

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.
2003-12-14, 11:54 PM #10
Cool , maybe i should make some mapping tutorials , cause i don't see to much on massassi
2003-12-15, 1:44 AM #11
Actually there are a lot of tutorials online :/

------------------
Snail racing: (500 posts per line)
---@%
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-15, 2:17 AM #12
Well yeah , but massassians mostly check out here , or they still ask here
2003-12-15, 9:13 AM #13
I updated the tutorial take a look and see if I missed anything. [http://forums.massassi.net/html/smile.gif]

I've also emailed it to Massassi I can only hope they'll post it.

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.

[This message has been edited by Freyr (edited December 15, 2003).]
Free your mind, use Open Source.
2003-12-15, 9:18 AM #14
Looks nice. Good examples too.

------------------
Snail racing: (500 posts per line)
---@%
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-15, 12:26 PM #15
Nice tutorial, although I dispise emotes. They are abused so much in mods.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-12-15, 12:33 PM #16
You can limit the use of emotes in mods by adding code like :

Make them holster their saber everytime they use an emote:
client->ps.fd.saberIsHolstered = qtrue;

Only 1 emote every minute:
&& pmove->ps->commandTime = lastemotetime - 6000;


------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.

[This message has been edited by Freyr (edited December 15, 2003).]
Free your mind, use Open Source.
2003-12-16, 11:16 AM #17
I sent the tutorial off today with images like requested. Hopefully it will be added soon. My next tutorial:

Basic Weapon Editing

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

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.
2003-12-16, 11:47 AM #18
Changing Weapon Characteristics

If you haven’t done the Adding new Emotes to JO. Then do that tutorial before this one.

This is really shocking how much you can change the game in just a few minor changes.

Go into C:\Program Files\LucasArts\Star Wars JK II Jedi Outcast\GameData\code. Go into the code directory and open the folder called game. In that folder there should be a file called g_weapon.c open this file in Notepad or Visual C++.

At the top there should be a block of code that looks like this:

// Bryar Pistol
//--------
#define BRYAR_PISTOL_VEL 1600
#define BRYAR_PISTOL_DAMAGE 10
#define BRYAR_CHARGE_UNIT 200.0f
#define BRYAR_ALT_SIZE 1.0f

Extra Note:
Anything after this symbol // is ignored by the game. Programmers use to leave notes for themselves and others. It also makes code easier to edit.

Let’s say we want to make the Bryar Pistol into a Rapid Fire Blaster. There are several things we need to change.

1. How many blasts get fired in a minute.
2. How much ammo it takes.
3. How much damage it inflicts per shot.

There should be a line that says:

#define BRYAR_PISTOL_DAMAGE 10

Change it to:

#define BRYAR_PISTOL_DAMAGE 4

Basically we want a single bullet to do less damage because we’re firing more bullets.

Now save and close g_weapon.c And open up bg_weapon.c

Go down to this line:

{ // WP_BRYAR_PISTOL,
// "Bryar Pistol", // char classname[32]; // Spawning name
AMMO_BLASTER, // int ammoIndex; // Index to proper ammo slot
},

Beneath it there should be a line that says:

400, // int fireTime;

This tells the game how long to wait before firing a bullet.

Change 400 to 200.

Again there should be a line that says:

2, // int energyPerShot;

This tells the game how much ammo to use.

Change 2 to 1.

Save and close bg_weapons.c

Now run the game.bat file and place the jk2mpgame.qvm file in the HeroMod pk3 we made in the last tutorial.

Run Jedi Outcast. Go to the Mods Setup Menu. Select HeroMod. The game should load again. Create a new game. Once it loads press SHIFT- ~ to bring up the console.

Fire your blaster and it should fire faster and use less ammo.

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.
2003-12-17, 12:19 PM #19
Yay. I'll test it [http://forums.massassi.net/html/smile.gif]

------------------
Snail racing: (500 posts per line)
---@%
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-18, 8:37 AM #20
I was hoping someone would test it. [http://forums.massassi.net/html/biggrin.gif] This is a rather fun tutorial.

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.
2003-12-18, 9:27 AM #21
What a minute, couldn't just edit the weapon.cfg files in the ext_data folder?

------------------
Snail racing: (500 posts per line)
---@%
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-18, 11:49 AM #22
This is for JO. [http://forums.massassi.net/html/biggrin.gif]

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.
2003-12-18, 2:02 PM #23
Hmm. There is a weapons.cfg file in the ext_data folder in the base folder of JO. [http://forums.massassi.net/html/smile.gif]

------------------
Snail racing: (500 posts per line)
---@%
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2003-12-19, 9:36 AM #24
That's strange the code doesn't use an include for that file. Nor does it call it in the code. ??? I'll look into that.

Yes, My 100th Post!!!

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.

[This message has been edited by Freyr (edited December 19, 2003).]
Free your mind, use Open Source.
2004-01-09, 10:13 AM #25
Quote:
<font face="Verdana, Arial" size="2">There is a weapons.cfg file in the ext_data folder in the base folder of JO?</font>


Echoman, I finally figured it out that file contains all the graphical elements of weapons, how far to fire, what .efx file to play...

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.
2004-01-09, 11:11 AM #26
Okay, I code sometimes but I still didn't understand a word you said in EITHER of your Tutorials in this forum. Help please.
If every mod was like ours...no mod would get a "two"

Proud member of the Co-Op
2004-01-09, 1:27 PM #27
Do #1 first then #2.

------------------
I munch C code for breakfast and have enough room left over for a kernel debugging.
Free your mind, use Open Source.

↑ Up to the top!