Recommended Posts

Posted (edited)

Hello! I officially started on this, so I thought I should post progress in the official WIP channel as opposed to the general help one.

This is my first attempt at making a mod, so any advice or callouts would be greatly appreciated

The outline is to bring a version of TSL’s richer companion interactions to K1. I am a big believer that story and gameplay should effect each other as much as possible, in TSL that is fulfilled by lots of real benefits for engaging with party members. The Exile has a huge effect on their companions, which makes sense given the plot. The same should be true for K1...but the features just aren't there. The bones for what we see in TSL exists as the upgrade system for HK-47, so that is the foundation I am building this mod on.

The mod would give buffs to party members for finishing their sidequests. It would do this by equipping custom “hide” items to their hidden inventory slot when you finish their relevant quest. The goal is to boost the weaker non-jedi characters, while providing some incentive/satisfaction for pursuing their individual storylines.

I have the following basics mapped out:

  • Kotortool + K-GFF Editor - Create new .uti files for the items containing the buffs. 
  • Kotortool + Kotor Scripting Tool - Create a script that equips the item in the “hide” slot (or replace an item already there)
  • DLG_Editor - Attach the script to the dialog event associated with completing the relevant quest
  • DLG_Editor - Change/add text to the last dialog entry associated with that quest to explain to players the nature of the boost [ala HK-47’s repair boosts]

The relevant characters and quests are:

Carth → Finding Dustil
Mission → Mission’s brother
Canderous → Jagi’s Challenge
Zaalbar → Chieftain in Need

The boosts would attempt to make each character closer to the utility of jedi in a narrative consistent way (Hidden in case you want to be surprised):

Spoiler
  • Carth (Saves +3, All Weapon Specializations)
    • The trauma has held back Carth. Finding Dustil helps Carth remember who he was, a battle-trained hero of the republic.
  • Mission (Force Immunity: Fear + Stun & Increased Movement Speed)
    • Mission will become more resistant to force powers due to yet another con job from her brother (and spending time with you).
    • Griff will purposefully leave behind an armband (which will have its own story behind it), this armband will ping a buff to movement speed (making stealth less tedious)
  • Canderous (Ability to equip lightsabers; Plus Focus Feat)
    • Considering his strength build, his association with Jedi, and other Mandalorian lightsaber users, this feels like a unique boost to his character. I also believe he would abandon such a practice as he shifted to his role as Mandalore in TSL. Would pair well with JC’s Darksaber mod for K1
  • Zaalbar (+5 defense)
    • Part of the culmination of his storyline is the implication he will return to lead his people one day. I think this would shift his sense of self-preservation (exiled vs. future leader).


Potential Concerns/Questions:

  • I am planning to have the scripts activate on specific dialog entries that only appear when the sidequest is concluding. Would this have compatibility issues with other mods? If so, how can I best avoid that?
  • Are there any limitations to what kind of bonuses work on "hide" items? These don't seem to be limited to just one kind of object, since Juhani just has an Eriadu Stealth Unit in that slot. A property like "Keen" typically only exists on weapons, could a single item give this property to all attacks?
  • Are there any limitations to what feats/bonuses work between classes? As an example, could a non-Jedi wield lightsabers? In testing, just providing the Lightsaber proficiency feat did not 100% work (it unequipped when moving between areas).

 Progress:

  • After initial testing, I have decided to pivot on one of the characters bonuses. Reasoning below; Details above. [4/29/21]
Spoiler
  • Mission will no longer get the power attack feats as her free bonus. This felt pretty lame in practice, even though it stacks well with one super-powered stealth attack.
  • Successfully tested new hide items, new dialog entries, and scripts to equip said items. Will continue to test.
  • Created uti and scripts files, tracked down relevant dialog entries, wrote out player facing descriptions, and created final versions of dialog files with upgrade scripts.
  • → Changed boosts to Carth and Mission:
    • Keen & Massive Criticals (Too difficult to implement; these properties can only be applied at the item level or through hard coded feats)
      • Plan B is to frame Carth as a hero of battle, any weapon available he can use to its fullest.
      • The unique gameplay is to make him versatile. Most players will only have one weapon type specc'ed out fully, granting all types means some will be additive.
    • Bonus Damage to Dark Alignment (Same as above)
      • Using learning from the above, I am pivoting to power attack feats for Mission.
      • Power attack meshs well with sneak attack since stealth/stun also lowers defense, negating the loss in accuracy.
  • X Researched scripting methods that I could fire off from an item with "activate item" equipped in the hide slot to simulate an attack.
    • While this is an interesting route I will explore, it should be out of scope for this mod.
  • ✓ Proof of concept!!! Used updated dialog file for Carth to fire script to equip custom hide item and (some) bonuses applied.
    • Defense boost, Regeneration, and Bonus Feat all worked
    • "Keen" property didn't seem to apply based on feedback battle data
    • Lightsaber unequip issue still exists.
  • ✓ Fixed "Lookup path root set to: \ Error: Couldn't initialize the NwnStdLoader" error through updating registry as recommended here.
  • ✓ Used KotorTool to pull HK-47 upgrade scripts to understand how they work
  • ✓ Used DLG_Editor to identify dialog entries and relevant scripts for HK-47 upgrade sequence
  • ✓ Used KotorTool to pull hide items for Canderous, T3-M4, and HK-47 for reference

Credits (Will continue to update as I go):

  • Big thanks to @Thor110 for directing me to his video tutorial on Kotor modding!
  • Additional gratitude for @DarthParametric as they talked through the issues I posted in this thread
  • Blue for their Kotor Scripting Tool
  • Fred Tetra for KotOR Tool
  • tk102 for their DLGEditor
Edited by Masamune753
Updating progress 4/29/21
  • Like 3

Share this post


Link to post
Share on other sites

Is there anyone who could help me figure out how to decompile k_sp1_generic.ncs? I am using DeNCS and I have tried with both K1 and TSL's nwsscript.nss included in the folder. I still get a "Decompiling...k_sp1_generic.ncs: failure" error.

For context, I am trying to learn how force powers are scripted so I can attempt to create some kind of effect that can be pinged off a hide item's "Active Item" property (thus pinging a script I have made in the impact script column of an updated spells.2da).

Share this post


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

Look in the NSS folder of the same BIF you got the NCS from.

Oof. Thanks for the callout, I can say that I looked ahead of time and just missed it but that almost makes it worse.

Share this post


Link to post
Share on other sites

So, my hope with digging into the force power scripts was to reverse engineer how the game does force jump, since it is listed in the spells.2da. My plan was to use force jump as a reference for some kind of special attack that could be triggered by using the equipped hide item.

Looking into the "k_inc_force.nss" file... I have a good frame of reference for what force powers look like, but the listings for force jump don't actually lead anywhere. My guess is they are hardcoded into the .exe with the rest of the attacking feats.

As I was doing that I realized I was putting the cart before the horse by not checking whether the "activate item" property could be pinged off a hide item at all. When I tried, it looks like it does not. I assumed it could since that is the premise of the "whereami armband" found here. Looking at that file, it seems like this was something implemented in TSL.

For anyone who has more insight, could something like the "whereami armband" be implemented in K1 at all? If so, could anyone help me with the qualifications necessary to make that work? 

My plan with the pinged script would be as follows (Spoilers for anyone who wants to be surprised by the companion bonuses):

Spoiler

I am hoping to create a spell  that simulates a rapid fire of blaster attacks from Carth. The outline is that this could be loaded exclusively on Carth through the same hide item implementation that I would equip through a dialog entry. You would activate this spell through the equipped item and then I could just attach blaster fire animations to the activation to make it SEEM like a ranged blaster attack. 

In reality, it is just a spell that only Carth would have access to. Incredibly hacky, but that is my current outline given the limitations.

 

Share this post


Link to post
Share on other sites

You need to provide more detail about what it is exactly you want to achieve. I gather you want a scriptable attack animation? What is the scenario you envisage this executing in? What's the goal? Are you looking for some simple combat buff, or some sort of cinematic thing?

Interactive armbands work exactly the same in both games. You give it an "Activate Item" property which links to spells.2da, this in turn fires a script. The script then does whatever you want, within the limits of the engine. So you can start a conversation/cutscene, open/close doors, spawn items/creatures/objects, kill/destroy items/creatures/objects, add/remove party members, jump the player/party to different positions, warp the party to a different module, set plot states, etc. You can also do this with other interactive items the player equips, like medpacs or stims.

You can add an Activate Item property to any item, but a creature hide is not exposed to the player. It is not interactive, so the player can never activate it. The same goes for most other equippable items - there's no way for the player to manually activate them. If you are looking for combat effects, you can apply On Hit status effects to weapons, like slow and stun, etc., but these don't fire scripts. Items can also grant feats, so you could just make a blaster that grants the full Rapid Fire series of feats.

So if you wanted to have a manually activateable item, you could just use an armband. K1 doesn't have a pre-existing user limitation for Carth, so you'd have to jump through some hoops to limit it to only him. You could use this in conjunction with your creature hide idea, where the script checks if the activating creature has the hide equipped and the effect fails if not. But how you go about it goes back to my first quest - what is it you are trying to do exactly?

  • Like 1

Share this post


Link to post
Share on other sites

Hey DarthParametric, I felt like my posts were already pretty longwinded, but I am happy to get more granular in detail.

30 minutes ago, DarthParametric said:

You need to provide more detail about what it is exactly you want to achieve. I gather you want a scriptable attack animation? What is the scenario you envisage this executing in? What's the goal? Are you looking for some simple combat buff, or some sort of cinematic thing?

My overall goal is to provide a gameplay boost/capability for each non-jedi character as a reward for their side quests. For me, those boosts need to have the following characteristics:

  • Consistent with the character
  • Unique in how they affect gameplay
  • Additive such that the player choice/ignorance wouldn't negate it

It would be easy to just add a flat +5 to a different attribute for each character and be done with this, but I feel like that is pretty boring. Adding a bonus feat like Rapid Fire wouldn't work because players could easily choose those feats before finishing the questline, then the whole benefit would be lost.

For Carth, my goal is trying to find any way for him to deal more damage that follows the characteristics listed above. The scenario would be something useful for every battle till the end of the game. Getting started, I had the idea of all of Carth's attacks having Keen+Massive Crit (thus stacking with the crit feats). However, increased crit range is an item property that cannot be applied at the attack action level outside the Crit feats. The armband and "Activate Item" property line of thought was born out of an attempt to create or simulate more critical hits (again, outside of just granting the Crit feats).

When that seemed impossible, I wondered if the same Armband+Script method could instead activate an attack spell that would damage a target 5 times in a single round. If that is true, then the next step would be to associate that custom spell with an animation that looks like Carth firing his blasters. The goal isn't to just make him deal more damage with his regular attacks, that wouldn't be any different than 4-5 other buffs any character could do. 5 attacks per round would be unique for a non-jedi character and would fit a sort of gunslinger theme. More critical hits would fit a theme of being a veteran soldier who is just better at shooting.

If it seems like I am leaping from idea to idea, that is because I am. I am engaging with this whole exercise as a way to learn how all of these systems work, so a lot of what I covered above I learned for the first time by trying it out.

1 hour ago, DarthParametric said:

You can add an Activate Item property to any item, but a creature hide is not exposed to the player. It is not interactive, so the player can never activate it [...] So if you wanted to have a manually activateable item, you could just use an armband. K1 doesn't have a pre-existing user limitation for Carth, so you'd have to jump through some hoops to limit it to only him. You could use this in conjunction with your creature hide idea, where the script checks if the activating creature has the hide equipped and the effect fails if not. 

This is interesting. My thinking about being able to activate a hide item was based on Juhani's Eriadu Stealth Unit. However, that clearly is an exception since stealth is activated in a unique way.

So, if the script simply has to be activated through an armband (which could be limited to Carth through a custom feat granted by the same hide item), could you have an armband that just fires off a modded script of Adv. Lightsaber throw? If that is true, could you just link it to a different set of animations that already exist (like firing blasters)? A modified version of Adv. lightsaber throw could also fit a gunslinger theme by appearing as though Carth is shooting at several targets all at once.

Share this post


Link to post
Share on other sites

You are probably going to wind up disappointed if you expect characters to reliably perform scripted animations during combat. For starters you cannot play arbitrary animations in K1 using PlayAnimation/ActionPlayAnimation. Only TSL can do that. In K1 you are limited to a small pool of anims predefined in nwscript.nns like ANIMATION_LOOPING_DANCE, ANIMATION_FIREFORGET_SALUTE, etc.

There is the CutsceneAttack function, which, as the name suggests, is designed for choreographing cutscene fights. That does let you specify attack animations, but I have no idea if that will even work outside of a cutscene.

void CutsceneAttack(object oTarget, int nAnimation, int nAttackResult, int nDamage);

It also lets you specify whether the attack is a hit or miss, and what the damage is. I suppose you could experiment and see what it does when fired during a regular combat round. I'm not sure if anyone has done that before. There may be a problem with the target not responding with the appropriate animation, assuming it works at all, so they might also need to be forcibly scripted in the same manner.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 4/24/2021 at 12:21 AM, DarthParametric said:

There is the CutsceneAttack function, which, as the name suggests, is designed for choreographing cutscene fights. That does let you specify attack animations, but I have no idea if that will even work outside of a cutscene.

Thank you for the advice! I think I will look into this as its own concept, since I don't want a bunch of exploratory fiddling to bottleneck this mod. Obviously you can pursue this as well, that is your  prerogative. If anyone else is inspired by this thread, I'd say just shout us out if anything comes of it!

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

For anyone tracking this thread, I do have a question about the general etiquette for posting new mods. Right now, I have all the files necessary to make the mod happen in-game. I am planning to spend the night testing this as much as possible. If all goes well, I will start figuring out TSLpatcher to release a 1.0 version.

However, the files I am using are already built off the dialog.tlk from [KotOR] Dialogue Fixes 4.0 and the K1CP 1.8.1 changes to Canderous and Carth's .dlg files, so it would likely be compatible with most people's games since most people use those mods (big assumption?). So, my question is whether it would be considered inappropriate to post a 0.50 version that just had those files without TSLpatcher?

This would let me, potentially, hear feedback on the mod earlier so I could make changes before integrating TSLpatcher. I only ask because I imagine the TSLpatcher research will take a bit, since I have never used it and I will most likely need to make adjustments to this mod based on whether or not players have the dialogue fix and K1CP mods installed to ensure as much compatibility as possible.

Share this post


Link to post
Share on other sites
On 4/26/2021 at 10:14 AM, Masamune753 said:

...whether it would be considered inappropriate to post a 0.50 version that just had those files without TSLpatcher?

As for me -- you can always ask for permission from both the author for using the files/setup taken directly from them. I mean, since you already said that you have it from. Granted, it's not impossible for someone happened to create similarity to what others did, and for that I believe it's fine to release one [without direct permission] -- at least on modding practice, far as my concern. And that's from etiquette perspective. What makes them legit or not from what I see is whether they can provide support to their work. If they can, then it's good -- if not then they better don't.

As from practical perspective I guess it'd be better if you create something that at least at the same level -- both in compatibility as well as quality -- as what it means here at least you don't make new problems that didn't occur previously.

Lastly, consider releasing this or any of your mods using TSLPatcher as possible -- regardless of how difficult for you to pull that one off, you'll find it more rewarding than the other way around. Cheers, and good luck! 🍻

  • Thanks 1

Share this post


Link to post
Share on other sites

As I went through testing this the last few days, the script based equipping and extra dialog worked great, but I really didn't like one of the bonuses I had planned.

I have thus pivoted on one of the characters (I will list out details in the progress section in the OP) and part of my new direction will be to get back into the armband+script method. 

I created the script for the buff, added a new row in spells.2da by copy pasting the basic energy shield row and changing the name and pointing it to the new script, built out an armband edited off of KotorTool to activate the new effect and...it didn't work. One possibility is that this has something to do with the armband, but in game it seems like everything works up until the effect is supposed to take place. That suggests it is just flawed scripting on my part:

void main(){
{
    effect eLink;
    {
            eLink = EffectMovementSpeedIncrease(99);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, 600.0);
        }
    }
}

 

I edited this from the burst of speed force powers, but considering it didn't work I am wondering if there is some glaring error. I removed the reference to a spell target and changed that to OBJECT_SELF, added the eLink within the ApplyEffectToObject, and changed the duration to 10 min (600 sec). The script itself wouldn't compile without the above changes. 

Does anyone have any advice for how to edit this? Or even to just clarify why it is failing?

Share this post


Link to post
Share on other sites

Well for starters your brackets are all over the place. And while it doesn't actually affect anything, you shouldn't use the name eLink if you're not linking effects together.

So what you're actually trying to write is this:

void main()
{
	effect eMove = EffectMovementSpeedIncrease(99);
	ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eMove, OBJECT_SELF, 600.0);
}

If it doesn't work then the problem is probably how you've set up the armband.

  • Thanks 1

Share this post


Link to post
Share on other sites

@TamerBill This script worked! Much appreciated.

I had to do a lot of KotorTool rinse-and-repeat at doing seemingly the same thing with the armband, but eventually it worked.

In the great spirit of learning by doing, I just learned that movement speed during stealth is fixed. Oh well, at least now I have a template for new versions/attempts.

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.