uwadmin12

MOD:[K1] Saber Throw Knockdown Effect

Recommended Posts

[K1] Saber Throw Knockdown Effect


Description

This mod adds a climactic Knock Down effect to a lightsaber throw (DC 5 + character level + WIS/CHA modifier against reflex save). Only Adv. Lightsaber Throw can knockdown its primary target; Normal lightsaber throw will NOT have this effect. (Which makes sense, “Advanced” implies more fancy effects)

Installation

  1. Make sure override folder exists at game root directory
  2. Run TSLPatcher to install
  3. (Not recommended: if you really want to install manually, I’m sure you could figure out the procedure by looking at tslpatchdata/changes.ini file)

Compatibility

This mod shouldn’t cause any conflict. (It adds completely new function and modifies an existing line of spells.2da that no normal mod would touch.)

Permissions

Do not claim credit for this mod and do not use assets from this mod without my permission

Special Thanks

  • Fred Tetra for Kotor Tool
  • Stoffe for TSLPatcher

Legal

THIS MODIFICATION IS NOT SUPPORTED BY BIOWARE/OBSIDIAN ENTERTAINMENT, LUCASARTS, DISNEY OR ANY LICENSERS/SPONSORS OF THE MENTIONED COMPANIES. USE OF THIS FILE IS AT YOUR OWN RISK AND THE ABOVE MENTIONED COMPANIES OR THE AUTHOR IS NOT RESPONSIBLE FOR ANY DAMAGE CAUSED TO YOUR COMPUTER FOR THE USAGE OF THIS FILE.


  • Submitter
  • Submitted
    08/02/2019
  • Category
  • K1R Compatible
    No

 

  • Like 1

Share this post


Link to post
Share on other sites

An interesting mod!

From what I understand the primary target is knocked down if it fails a saving throw while additional targets won't be affected?

Have you considered extending the effect to the additional targets too if they'd fail an easier to resist saving throw (ex. DC 0 + character level + WIS/CHA modifier against reflex save)?

Cheers!

Share this post


Link to post
Share on other sites

Thanks for the suggestion! And yeah additional targets won't be affected. My excuse: the momentum of a saber throw should diminish after the first hit to an extent that it can't knock down a target anymore. The main reason, however, is that `EffectForcePushed()` seems to only knock down targets away from the PC, which makes sense for the first target but not for the additional ones (in most situations).

Should there be a way to control the direction that a target is knocked down, I would certainly consider implementing the what you mentioned.

Best.

  • Like 1

Share this post


Link to post
Share on other sites

Hello!

There is a problem with this mod and the AI. The knocked down opponent doesn't resume its attack.

I am showing this in a video here: https://youtu.be/3J0R8SbRcpY

The vanilla behavior is such that the enemy would just attack again instead of waiting for a party member to get closer.

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi Salk, really appreciate the issue report!

I am very intrigued by this behavior and was able to reproduce the issue with Horned Kath Hound, Katarrn, and droids in Marka Ragnos' tomb. However, when I tested it on other combat scenarios, the target only waits until the current round ends and proceeds to charge toward my party regardless of distance.

I'm convinced it's some hidden engine issue, when EffectForcePushed is used as a standalone effect, it does not signal the events properly, (shamelessly blame the engine for everything that's gone wrong🤣). Unfortunately, nwscript.nss' source code isn't available and there is no way I could pin down the very source of this issue. Nonetheless, if I append a very short stun effect after the knockdown, the issue went away (I retested all 3 scenarios to make sure). It becomes clear that when the stun effect is over, it resets/clears the object's state and signals events properly. Since the failure to resume attack only occurs on Human-Subrace-Beast and Droid, I added condition checks in the original script and applied a very short stun/droid-stun effect after the knockdown.

Dropping the attached ncs to your override should now fix the issue, I'll make an update shortly. Let me know if the issue persists, or if there are any other weird behaviors, thanks again!

fp_saberthrow.ncs

  • Thanks 1

Share this post


Link to post
Share on other sites

Hello again!

While going through the game I noticed the same issue (the knocked back opponent not attacking) when I used it on a Selkath in the manm28ac module.

Cheers!

  • Like 1

Share this post


Link to post
Share on other sites

Hey @Salk, thanks for the report! Unfortunately, I no longer have the proper set up to make/test a mod. If you have KOTORTool + the base game, and are interested in fixing the issue, feel free to do so. If one wants, I can make an update and be sure to credit.

Looking at the source code fp_saberthrow.nss, Selkath race is most likely a missed condition check, here:

if (GetRacialType(oTarget) == RACIAL_TYPE_DROID) {
    effect droid_stun = EffectDroidStun();
    droid_stun = SetEffectIcon(droid_stun, 30);
    DelayCommand(2.55, SP_MyApplyEffectToObject(DURATION_TYPE_TEMPORARY, droid_stun, oTarget, 0.5));
} else if (GetRacialType(oTarget) == RACIAL_TYPE_HUMAN && GetSubRace(oTarget) != SUBRACE_NONE) {
    effect sub_stun = EffectStunned();
    sub_stun = SetEffectIcon(sub_stun, 11);
    DelayCommand(2.55, SP_MyApplyEffectToObject(DURATION_TYPE_TEMPORARY, sub_stun, oTarget, 0.5));
}

I am unsure what RacialType/SubRace the problematic Selkath has, it's most likely an edge case. To fix this issue, one needs to:

  • Install this mod (prerequisite)
  • Tweak the second condition check (or insert an additional condition check + stun effect) to catch this special case you mentioned.
  • Compile the fp_saberthrow.nss with KOTORTool
  • Drag the compiled fp_saberthrow.ncs to override.
  • Test in manm28ac module
  • Sanity test to make sure it doesn't break anything else (e.g. test on other basic RacialType/Subrace enemies too to make sure it doesn't break anything)
  • Like 1

Share this post


Link to post
Share on other sites

Hello!

I'd not have any problems testing a modified script but I checked the Selkath and it has RACIAL_TYPE_HUMAN and SUBRACE_NONE and that's why it won't be caught in the second condition check of  yours. I suppose I could just tweak this line:

} else if (GetRacialType(oTarget) == RACIAL_TYPE_HUMAN && GetSubRace(oTarget) != SUBRACE_NONE) {

to:

} else if ((GetRacialType(oTarget) == RACIAL_TYPE_HUMAN && GetSubRace(oTarget) != SUBRACE_NONE) || (GetTag(oTarget) == "man28_inssel")) {

This wouldn't break anything.

I'll test it and then let you know.

Cheers!

  • Thanks 2

Share this post


Link to post
Share on other sites

Hey @Salk, excellent troubleshooting; the tweak looks good. And hey, thanks for offering to test!

I sincerely hope there won't be another Human without a SubRace ... but anyways man, really appreciate it 👌

  • Like 1

Share this post


Link to post
Share on other sites

Hello uwadmin12!

I was wondering if it may actually be a good idea to force your workaround (a very short stun effect after the knockdown) to every enemy that is affected by the knockdown. In this way, there wouldn't be any special case that may fall through the net and after being knocked out it is not so unreasonable to think a short stun effect is appropriate.

Cheers!

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.