- Quick Links -


Jedi Knight modifying site

Visitor No.72282
Since July 1999

Theme :

Massassi Temple MILLENNIUM
LucasArts Entertainment Company

- Random Picture -

Enhancement Pack 2.1

Enhancement Pack 2.1

Forum Projects Documents Features Extra Links
Creating a Lightstaff

DOWNLOAD


1

In this tutorial we are going to create a togglerable lightstaff for Kyle as an example. The method for creating a Lightstaff needs to edit the 3do model of the character, thus other custom skins do not work with this modification.

As usual, place the files need to be edited in their own folders.

Put original ky.3do, weap_saber.cog, ky.pup, items.dat and jkstrings.uni in appropriate folders.


2

Now, in this part, it will tell to use another part of the 3do as the second blade. (The first and second blade positions are the same by default)

Open ky.pup. In the joints section, change 4=12 to 4=19. So, the lightsaber will appear on 19th node in the 3do.

Tutorial Lightstaff Image 1

That's all for the pup. Save and exit.

This will edit to make the saber toggleable through a new HotKey.


3

Next open up weap_saber.cog.

Add

   int   staff=0   local
   message   user0

in the symbols section.

In the selected message add,

   Staff = 0;      //It's not lightstaff in the first place.

   //Clear the second blade for every selection of lightsaber (just a fail safe)
   jkClearFlags(player, 0x10);

   //Don't let the saber toggle happen so quickly. Wait until the ignition ends.
   SetBinWait(player, 116, GetSoundLen(mountSound));

Now, this is the part to make it toggleable with a variable.

In the user0 message add this, this is the blade appearance and clearing.

   if(!Staff)      //Going to be a Lightstaff.
   {
      jkSetFlags(player, 0x10);      //Set the second blade to come out.
      PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);      //Play another ignition sound.

      //Now, don't let it shrink already! So, give it a wait.
      SetBinWait(player, 116, GetSoundLen(mountSound));
   }
   else      //Back to saber.
   {
      jkClearFlags(player, 0x10);      // If going back to saber clear the second blade.
      PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);      //Play shrinking sound.
      SetBinWait(player, 116, GetSoundLen(dismountSound));      //And give it a wait.
   }

   staff = 1 - staff;      //Change variable, so the cog knows if it's staff or saber at the moment.

If killed, make sure not to carry the second blade effect over.

Add

   jkClearFlags(player, 0x10);      // Clear second saber.

Save and exit.


4

This new cog will make the HotKey to activate the user0 message in the saber cog.

Create a new cog and name it saber_toggle.cog

In the activated message of the cog, send a message to user0 of weap_saber.cog

   if(GetCurWeapon(GetSourceRef()) == 10)      //Only work , if the weapon is saber.

   //Send a message to user0 of the saber cog, and the above cog will be executed.
   SendMessage(GetInvCog(GetSourceRef(), 10), user0);

Preferably use GetSourceRef() for the player.

That's it for the cog. Save and exit.

Now, get ready to make a new HotKey.

Open up items.dat, insert the 116th entry with flag 0x120 and cog=saber_toggle.cog at the bottom. This will give HotKey entry.

   Saber_Toggle   116   0   1   0x120   cog=saber_toggle.cog

Save and exit.


5

In order to create a HotKey entry in the keyboard control option, edit the jkstrings.uni.

Open it up and find where it says,

   "ACTIVATE16"   0 "Field Light"

Copy and paste that line just below it and change the number from 16 to 17. And change the name to whatever you want. Maybe "Saber Toggle" for now.

Save and exit.

Now, this is the most annoying part of all, the 3do must be edited so another blade can come out. Just follow the instruction.

Open up the ky.3do. This part is a bit tough but last.

Find SECTION: GEOMETRYDEF

1. Change GEOSETS 4 to GEOSETS 12. Change MESHES 16 to MESHES 17

Tutorial Lightstaff Image 2

Next, below 15th mesh in GEOSET 0

Add these lines,


   # Mesh definition
   MESH 16

   NAME k_rhandb

   RADIUS  0.066127

   GEOMETRYMODE   4
   LIGHTINGMODE   3
   TEXTUREMODE   0

   VERTICES 0

   # num:   x:     y:     z:     i: 

   TEXTURE VERTICES 0

   VERTEX NORMALS

   # num:   x:     y:     z:

   FACES 0

   # num: material:  type: geo: light:  tex: extralight: verts:

   FACE NORMALS

   # num:   x:     y:     z:

Scroll down to start of the next GEOSET,

# Geometry Set definition
GEOSET 1

From these lines to just before the hierarchy section,

###############
SECTION: HIERARCHYDEF

delete them all.

In the hierarchy section, change this

HIERARCHY NODES 18

to

HIERARCHY NODES 20

Now paste this at the bottom of the file.


   18: 0x0 0x00010 -1 -1 -1 -1 0  0.001632  0.056386 -0.028002  0 0  0 0.0037  0.022  0.0208 $$$dummy
   19: 0x0 0x00004 16 12 -1 -1 0  0.001632  0.003386 -0.028002  0 180  0 0.0037  0.022  0.0225  $$$dummy

Last, change the children entry to 19 and number of children to 1 for the 12th hierarchy.

   12: 0x0 0x00004 15 11 19 -1 1  0.001632  0.003386 -0.028002  0 0  0 -0.002488  0.00912 -0.005542 k_rhand

This is it. Save and exit.

Launch Jedi Knight and you will still have a regular lightsaber. Assign a key and you can now press to toggle.


Resources

ky.3do

weap_saber.cog

saber_toggle.cog

items.dat

ky.pup

jkstrings.uni


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.