- Quick Links -


Jedi Knight modifying site

Visitor No.72282
Since July 1999

Theme :

Massassi Temple MILLENNIUM
LucasArts Entertainment Company

- Random Picture -

MotS Shotgun

MotS Shotgun

Forum Projects Documents Features Extra Links
Creating New Variable BM Status

DOWNLOAD


1

Now, what if you want to make an indicator when your arm is damaged and/or legs are damaged, or maybe when you want to give some indicator of yours. In this tutorial I'm going to explain the way of how it's going to work, but since it will be really complicated to show you the whole process to give you a good example, rather I won't show you the example, but show you how this can be achieved.


2

First, I'll get my Sniper Arena as the example of this tutorial. If you have played it you know you've seen a gun icon was showing at the right top corner of the screen. It shows which device was attached(used) by the Sniper Rifle.

Tutorial Bm Image 1 Tutorial Bm Image 2 Tutorial Bm Image 3 Tutorial Bm Image 4 Tutorial Bm Image 5

Like these. The enabled devices are highlighted in this example. Now onto how this is done.


3

The only way to show images on screen is by using SetInvActivated(), you know this works from the force powers you have used in original JK. When you activate forces, icons will appear on the top right corner. This example just have a few original images shown.

The images are all independent, so I made 8 images altogether. To show the appropriate images from your BM, you must edit "items.dat" and the name of the BM files. If you know how to match SetInvActivated() with your original BM, skip the section 4 and go to section 5, otherwise section 4 will explain it.


4

To match the BM file, so you can show the BM you want with SetInvActivated, open your items.dat and add as much entries as the number of the BM you want to add, in this case add 8. You can just copy and paste the last line you see in items.dat to entries from 116 to 123.

The important part in this file is the name of the entry and the flags. The procedure might sound confusing but once you read through, it should make sense.

*Name of the BM files has to include the first 5 letters from each entries after "ic" and has to have "8" or "16" to indicate if the image is in 256 colors or in full color.*

For example "silencer" was the entry name, the BM file has to be named "icsilen8.bm" and "icsilen16.bm". You should also make "8" version by decreasing the color of your original full color image, or people with no 3D accelerator won't be able to see the image, or even cause crashes for them.

*Flag the entries as items (0x42)*

If you don't do this, it won't get activated with SetInvActivated(), thus images never show.


5

Once you got the BM matched with items.dat, just use SetInvActivated(player, EntryID, 1); , where EntryID is the entry in items.dat you want to activate the image of.

Place "0" instead of "1" to let the image go. In my example, I've got the image with nothing enabled and showing it all the time except if any of the device is activated, so 1 of the images is always showing as an indicator.


6

Now you know how to show indicators as you want. Now onto the next step on how to change them accordingly to your status. It sounds simple as you only need to change the BM when certain events happen, but what I want to show here is how to show multiple conditions in 1 image as shown above. If "A" show "a". If "A" and "B" show "c", stuff like that.

There is a simple way which makes the cog real complicated by doing

if(A && B) do "a" else if(A && C) do "b" else etc etc...

but let's find a better method for simplifying purpose.


7

To accomplish this, you must know that there are 8 possibilities of the status in this example. They are either none, all or the combination of silencer, zoom scope or laser pointer activated. So I'll list them up so it will be easy for your reference and for mine.

   none    0  //none activated    items.dat bin is 116
   silencer    1 //silencer - 117
   laser    2 //laser pointer - 118
   si_laser    3 //silencer and laser pointer - 119
   zoom    4 //zoom scope - 120
   si_zoom    5 //silencer and zoom scope - 121
   la_zoom    6 //laser pointer and zoom scope - 122
   all    7 // all of the 3 activated - 123

You can use ChangeInv() with a new bin below it which is 124 for this case to store the status for which BM to activate. When the silencer is activated, do

   ChangeInv(player, 124, 1); //124 shows the status of now
   SetInvActivated(player, 116 + GetInv(player, 124), 1); //activate the BM according to the status,
116 is the base bin entry, add the 124 bin value for the status

If zoom scope and laser pointer are activated do this in cogs

   ChangeInv(player, 124, 4);
   ChagneInv(player, 124, 2);

   //This will be 122 activated, which is on the above list, laser pointer and zoom scope BM
   SetInvActivated(player, 116, + GetInv(player, 124), 1);

When you deactivate zoom scope from that, do

ChangeInv(player, 124, -4);
SetInvActivated(player, 116, + GetInv(player, 124), 1);

This way you don't have to have so many "if" lines everywhere to check for every situation, but make sure to put this in every status change, so the former status indicator will be gone and won't show multiple of them on your screen.

for(i=116; i<=123;i=i+1) SetInvActivated(player, i, 0);


8

Well... it was a long story, and my writing wasn't too clear as well. I hope you get what I wanted to tell you and use it if you ever need this technique.


Forum Projects Documents Features Extra Links

Top - Home - Back

PHP Apache Valid XHTML 1.0! Valid CSS!

This site is developed using PHP under Apache server
with XHTML, JavaScript, CSS and Cookie technology.

Certain parts of this site require Cookie support.

This site is best viewed with Internet Explorer 5.5, Netscape 6.0, Opera 6.0 or Mozilla 1.0 and above
at resolution 800 * 600 and higher.

Nothing on this site is made, distributed, or supported by LEC.
Please use and download all materials at your own risk.

© 1999-2004 Hideki.

This page was last modified on Sat, 30 Jul 2011 17:28:41 +0000.