Sign in to follow this  
Roth9

HK unit at the Leviathan

Recommended Posts

I want to change the experimental assault droid at the Leviathan to a HK unit, but I am having some trouble at the presentation. I want it to look damaged until I activate, but I can't do this. Can someone give any tips?

Share this post


Link to post
Share on other sites

You need to be more descriptive when you ask questions like this. Generic in-game labels are useless. You need to specify the resref of the creature and the module name. In this case, I am guessing you mean lev40_assaultdrd.utc in LEV_M40AB.

 

If you look at the scripts assigned to that creature, you'll see it has two non-standard ones, the OnSpawn script k_plev_altdrd_sp and the OnUserDefine script k_plev_altdrd_ud. If you decompile those two scripts, you'll see that it calls specific animations. The OnSpawn script has the following:

ActionPlayAnimation(20, 1.0, (-1.0));
If you look in nwscript.nss, where the animation constants are defined (should be a copy in your K1 Override folder after using KOTORTool, or check the source section of scripts.bif), you'll see anim 20 is:

int ANIMATION_LOOPING_DEACTIVATE    = 20;
Interestingly, there is no "deactivate" animation in the C_Drdmkone model that lev40_assaultdrd uses by default. There is a "disabled" animation, which must be what this constant actually refers to. The problem is that the K1 version of the HK model doesn't have a disabled animation. Obsidian added it to the TSL version of HK (it's the state you first find him in on the Ebon Hawk), but you can't use that without porting, which is obviously a no-no.

 

However, K1's HK model does have the pausepsn animation, of which the first and last frames (being identical) could serve as a viable custom disabled animation. So what you need to do is to grab a copy of the HK model, P_HK47.ndl/mdx and decompile it. Open it in a text editor. You'll probably want something like Notepad++ for this type of thing. Do a find and replace on "P_HK47" and change it to a custom name. For this example, I'll use C_HKAss. Now at the top of the file where it says

setsupermodel C_HKAss NULL
change that to

setsupermodel C_HKAss P_HK47
Under the animation section of the file, after the endmodelgeom line, you can delete everything except the pausepsn animation. For the bookends of that block, change

newanim pausepsn C_HKAss
[...]
doneanim pausepsn C_HKAss
to

newanim disabled C_HKAss
[...]
doneanim disabled C_HKAss
You'll see at the start of the block that the length of the animation is 1.33333 seconds. Because we want HK to be static, we only want the first and last frames, so delete any frames that have time codes besides 0.0 and 1.33333. For example:

    node dummy InnerTorso
      parent rootdummy
      orientationkey
        0.0 -1.0 2.05000e-006 7.40000e-007 0.394443
        0.3 -1.0 2.05000e-006 7.40000e-007 0.394443
        0.466667 -1.0 3.77000e-006 1.00000e-006 0.21991
        1.0 -1.0 3.77000e-006 1.00000e-006 0.21991
        1.33333 -1.0 2.05000e-006 7.40000e-007 0.394443
      endlist
    endnode
would become

    node dummy InnerTorso
      parent rootdummy
      orientationkey
        0.0 -1.0 2.05000e-006 7.40000e-007 0.394443
        1.33333 -1.0 2.05000e-006 7.40000e-007 0.394443
      endlist
    endnode
Once that is done, find the entry for Mesh01, which is the (poorly named) eyes mesh. We want to turn off the self-illumination for this animation so the eyes aren't glowing. Fortunately, the game has provision for that. Change:

    node dummy Mesh01
      parent talkdummy
      orientationkey
        0.0 1.0 0.0 0.0 0.0
        1.33333 1.0 0.0 0.0 0.0
      endlist
    endnode
to:

    node dummy Mesh01
      parent talkdummy
      orientationkey
        0.0 1.0 0.0 0.0 0.0
        1.33333 1.0 0.0 0.0 0.0
      endlist
      selfillumcolorkey
        0.0 0.0 0.0 0.0
        1.33333 0.0 0.0 0.0
      endlist
    endnode
With that done, you can save the file, changing the filename afterward to reflect the change in name (for example, C_HKAss.mdl.ascii). Now if you were to load the model into Max/GMax, you'd see an HK with single animation of a static pose, like so:

 

K1_HK_Disabled_Animation_TH.jpg

 

Now you can compile your ASCII model. Because the supermodel has been set as P_HK47, you'll need a copy of that binary model in the same folder to compile against. Save your binary model with an appropriate filename (for example, C_HKAss.mdl/mdx). While you are at it, you may have noticed that your find and replace operation changed the texture name your new model uses to something like C_HKAss_01 (or whatever name you used). Make a copy of the existing HK texture (P_HK47_01) and rename it to your custom texture name. I'd suggest editing it to distinguish it from HK-47. A simple change would be a hue change to something blue-ish, then desaturate as appropriate to get a bare metal look, similar to the HK-50s in TSL. You can then pop your model and texture into the Override folder.

 

With that done, you need to add an appearance.2da entry for your new droid. Make a duplicate of HK-47's row at the bottom of appearance.2da, changing the two instances of P_HK47 to your model's name (C_HKAss as used so far in this example). Also increment the row ID number (509+, depending on whether you have existing custom appearance.2da entries or not). Give it a custom label so it is easy to recognise (for example, Droid_HK_Assassin_Roth9). Save appearance.2da and put in your Override (if not there already).

 

Now in KTool you should be able to edit lev40_assaultdrd.utc, changing the appearance drop-down to match your new droid. Then save a copy of the UTC and place it in your Override folder. You'll need to test with a save prior to entering the level.

 

Here are the model files I came up with, if you want to use them - https://www.darthparametric.com/files/kotor/k1/[K1]_HK_Droid_Disabled_Animation.7z

 

A not regarding animations called in k_plev_altdrd_ud. It lists animations 1, 24, 100, 101, 102, 103. These correspond to

int ANIMATION_LOOPING_PAUSE2        = 1;
int ANIMATION_LOOPING_PAUSE3        = 24;
int ANIMATION_FIREFORGET_HEAD_TURN_LEFT     = 100;
int ANIMATION_FIREFORGET_HEAD_TURN_RIGHT    = 101;
int ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD = 102;
int ANIMATION_FIREFORGET_PAUSE_BORED        = 103;
The interesting thing is that C_Drdmkone doesn't have a "pause3", or "pauseinj", which I thought it might be referring to. Same with the scratch head and bored animations. I'm not sure how relevant these are. It may require playing through the vanilla version multiple times to see if you spot anything relevant.
  • Like 1

Share this post


Link to post
Share on other sites

Mod edit 1/4/18: <Snip!> No need to quote such a long post. You can reply by using the box at the bottom of the page if you don't intend to use parts of someone else's post.

-----------------------------------------------------------------
 

Thanks to you I was doing fine, but now I have problems with the dlg of the terminal. I wanted to change assaut droid to hunter killer, but it seems that dlg_editor doesnt change texts, I tried to change using kotor tool but it corrupts the dlg.

Share this post


Link to post
Share on other sites

Please don't quote entire walls of text for no reason. It's really obnoxious. It just makes the thread difficult to navigate.

 

Once again, you say you have a problem, but you don't provide specifics. What's the file? I assume either lev40_droid17a.dlg or lev40_droid17b.dlg. What entry number/s?

 

You can't change the text because it is using standard lines from dialog.tlk. You should use tk102's DLGEditor instead. It is much more full-featured.

 

http://www.starwarsknights.com/mtools/dlgeditor_232.zip

Share this post


Link to post
Share on other sites

Thanks for everything. I opted to not change the dlg, but I believe the final result was good.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this