uwadmin12

[K1] Changing Appearances of Characters in Cutscene

Recommended Posts

Sorry if this is asked before. I am very new to modding and was working on a mod to change the appearances of Calo Nord's thugs on Tatooine (tat_m18ac_s.rim --> bp_calo_ambush1 to 4) to assemble a variety of mercs (an assassin droid, a dark jedi, and an iridonian merc). I changed all the proper utc files, but the cutscene played for Calo's spawn (ambush_test.dlg) doesn't show these changes. (The combat afterwards showed the changes, of course).

I then found those constants (below) in k_trg_calonord2.ncs. I am pretty sure this ncs file is responsible for the character appearances in the cutscene, but too bad I cannot find the nss file so that I could modify these values properly?

  • ambush_rider_walrus2
  • ambush_rider_walrus2
  • ambush_rider_rodian1
  • ambush_rider_rodian2

Could someone shed some light on what I need to do to get those characters' appearances in the cutscene changed?

Thanks for any help :)

Edited by uwadmin12

Share this post


Link to post
Share on other sites

Yes, I tried from a save in Sand People Territory that haven't touched Eastern Dune Seas yet. The Calo Nord fresh spawn cutscene still show the rodian and walrus models, but the subsequent combat show the appearance changes.

Share this post


Link to post
Share on other sites
3 hours ago, uwadmin12 said:

the cutscene played for Calo's spawn (ambush_test.dlg) doesn't show these changes

That's because the cutscene uses a workaround to avoid using proper stunt animations. It spawns placeable sitters on the bikes, not creatures.

3 hours ago, uwadmin12 said:

too bad I cannot find the nss file

Only the global scripts have included source. All module-specific scripts are binary-only and need to be decompiled. Use DeNCS for that.

  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, DarthParametric said:

That's because the cutscene uses a workaround to avoid using proper stunt animations. It spawns placeable sitters on the bikes, not creatures.

To clarify, the "placeable" sitters are placeables who appear like Rodian and Aqualish but are sitting down. You see these a lot in Cantinas and the the reason why you cannot interact with them is because they are placeables and not NPCs. Calo Nord, on the other hand, is standing inside the Speeder using a "Computer Use" animation to make it appear as if he was on the bike. 

I'd say you'd want to make "clones" of your NPCs and make them do the same thing Calo does. (And when I say "clones" I mean you need to remove the placeables and replace them with "clones" and just before they get off their bikes you'd need to remove these computer use "clones" so you don't see double)

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks DarthParametric and N-DReW25 for the DeNCS link and detailed explanation, I really appreciate it.

Quote

Calo Nord, on the other hand, is standing inside the Speeder using a "Computer Use" animation to make it appear as if he was on the bike.

Is this and the placeable sitters set in the k_trg_calonord2 script? I'll poke around to see how far I can make the "clone" work.

Sorry I'm not super familiar with dlg files and how it interacts with animations/scripts. From what you described I assume the k_trg_calonord2 script triggers the ambush_test dialogue. The script only has Calo Nord as NPC in the cutscene, and everyone else are sitting decorations (and standing decorations in the second scene?). Please correct me if I am wrong.

Share this post


Link to post
Share on other sites

@DarthParametric @N-DReW25

THANKS SO MUCH, it worked!!! I figured out that two scripts are responsible for the placeable spawns: k_trg_calonord2 creates the placeable, k_ptat_thugjump destroys the placeable (object type 64) and replaces it with actual creature (object type 1). All I did was changing all the placeable tags "sittingrodian", "sittingselkath" to the proper thug tags in k_trg_calonord2, destroy it in k_ptat_thugjump and create the exact same objects again. I know its a dumb workaround but .... what can I do [shrug].

The DeNCS seems to create a lot of template functions "sub, sub1, sub2 ....", and the naming conventions are a bit obfuscated. The code doesn't look nice but hey, it worked!

Screenshot:

image.thumb.png.f47faad3c6db5043f72306d947a36775.png

 

 

Share this post


Link to post
Share on other sites
1 hour ago, uwadmin12 said:

DeNCS seems to create a lot of template functions "sub, sub1, sub2 ....", and the naming conventions are a bit obfuscated

That's because the original names in the source are not preserved in the compiled script. You'll see the same thing with variable declarations. DeNCS just comes up with some labels vaguely suited to the purpose.

Share this post


Link to post
Share on other sites
Quote

That's because the original names in the source are not preserved in the compiled script.

Looks like I'll be working with a lot of "sub"s in the future. 😭

Share this post


Link to post
Share on other sites

I have some more scripting questions related to setting AI behavior

For some background:

As shown in the screenshot there is a dark jedi and an assassin droid. Now, I changed the class of thug3 to Jedi Guardian, and changed the race of thug1 to Droid (and class to Combat Droid etc). I also added a droid hide for the latter and set all the prerequisite feats related to droid (e.g. Combat logic upgrades). I gave the Jedi a bunch of buffing power and gave the Droid a Carbonite Projector Mark II and Adv Gravity Generator.

Initially I changed the OnSpawn script for these thugs (k_def_calospn) to include the following lines at EoF:

// set AI behavior
if (GetLevelByClass(CLASS_TYPE_JEDIGUARDIAN) > 0 || GetRacialType(OBJECT_SELF) == RACIAL_TYPE_DROID) {
	SetNPCAIStyle(OBJECT_SELF, NPC_AISTYLE_JEDI_SUPPORT);
}

Some testing gives me absolute no clue of whether that works or not. What's worse is that at the moment these thugs are spawn, the whole game lagged for like 0.5 second. I had to remoe the k_def_calospn.ncs from the /Override so that it won't lag.

After that, I messed with the k_ptat_thugjump (the one that destroys the placeable and replace it with actual creatures), and in that script where the new objects are created, I assigned any droid / jedi guardian the Jedi Support behavior. The goal is to make the dark jedi buff as much as possible and the droid use the two special weapons more often.

Problem with my situation:

I have no way to test these AI behaviors. The bioware developers have debugger tools and can see the logging of script executions but I can only observe it through game. In game the Dark Jedi never uses any buffing power (but uses a lot of offensive power), and the Droid only occassionally uses special weapon. I have no way of knowing whether their behavior is set.

All I want is to know for sure that these two guys are locked in the droid/jedi support behavior.

Here is the modified decompiled k_ptat_thugjump: https://pastebin.com/nGmP56iA

Could some one verify that's the proper way to set an object's AI behavior? (See line 5-12 in the pastebin link)

Thanks!

 

Share this post


Link to post
Share on other sites

KOTOR is not the place to be looking for complex AI. If you check out GN_RunJediSupportAIRoutine in k_inc_generic.nss you will see what the Jedi Support AI does. There is no specific AI routine that will do exactly what you want. If you want a buff bot, you'll have to strip out all offensive powers from your UTC. Even then, don't be surprised if the very first thing the AI does is charge into melee combat and smack things with its glowstick.

Share this post


Link to post
Share on other sites

Yeah if I give the jedi no offensive power he will never buff ... But like if I set my NPC script to Jedi Support in game, they do use buffing powers occassionally. I meant I just want to make sure that their script is set to NPC_AISTYLE_JEDI_SUPPORT and not default.

Share this post


Link to post
Share on other sites

Since debug messages are disabled in the shipping build, there's no real practical way to tell 100% if your script is working as intended. But like I said, KOTOR is not really geared to do exactly what you want anyway, AI-wise. If you want something specific, you may have to brute-force it via scripting, with ApplyEffectToObject.

  • Thanks 1

Share this post


Link to post
Share on other sites

Yeah looks like only hard-coded buffing does the trick. It's too bad they disabled the debugging feature.

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.