Jump to content

Home

Need help w/ P1 - P5 params in DLG Editor for script


Darth Newbie

Recommended Posts

Hello,

 

I want to call a force power from an armband in-game but I'm not sure how to do this. From what I can tell, I'm supposed to use the k_sp1_generic.ncs script. However, I'm not very good at reading hex once the script decompiles, so I've been unable to tell what I need to plug in to the P1 - P5 parameters and the String parameter in DLG Editor to get the force power(s) to activate once firing the script. I've only gotten as far as putting k_sp1_generic in Script #1.

 

Any help would be appreciated.

 

Thanks!

 

~DN

Link to comment
Share on other sites

I've come across this already, but k_sp1_generic.nss just gives me:

 

//:: k_sp1_generic
/*
   Runs all force powers in the game
*/
//:: Created By: Preston Watamaniuk
//:: Copyright (c) 2002 Bioware Corp.

#include "k_inc_debug"
#include "k_inc_force"
void main()
{
   Sp_RunForcePowers();
}

 

Digging further within that, the "meat" appears to be in k_inc_force.nss, but I'm still having trouble determining the parameters to use for P1-P5 and the String param from that. For instance, if I wanted to drain life, here's what it shows:

 

        case FORCE_POWER_DRAIN_LIFE:
       {
           SWFP_HARMFUL = TRUE;
           SWFP_PRIVATE_SAVE_TYPE = SAVING_THROW_FORT;
           int nDam = GetHitDice(OBJECT_SELF);
           int nDamTest = GetHitDice(OBJECT_SELF);
           if(nDamTest > 10)
           {
               nDamTest = 10;
           }

           // DJS-OEI 3/25/2004
           SWFP_DAMAGE = Sp_CalcDamage( oTarget, nDamTest, 4 );
           //SWFP_DAMAGE = d4(nDamTest);
           SWFP_DAMAGE_TYPE= DAMAGE_TYPE_DARK_SIDE;
           SWFP_DAMAGE_VFX = VFX_PRO_DRAIN;
           //Set up the drain effect link for the target
           effect eBeam = EffectBeam(VFX_BEAM_DRAIN_LIFE, OBJECT_SELF, BODY_NODE_HAND);
           effect eVFX = EffectVisualEffect(SWFP_DAMAGE_VFX);
           //Set up the link to Heal the user by the same amount.
           effect eHeal;
           effect eDamage = EffectDamage(SWFP_DAMAGE, DAMAGE_TYPE_DARK_SIDE);

           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, fLightningDuration);
           DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget));

           int nResist = Sp_BlockingChecks(oTarget, eDamage, eInvalid, eInvalid);

           SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), SWFP_HARMFUL));
           if(GetRacialType(oTarget) != RACIAL_TYPE_DROID)
           {
               if(nResist == 0)
               {
                   int nSaves = Sp_MySavingThrows(oTarget);
                   if(nSaves > 0)
                   {
                       SWFP_DAMAGE /= 2;
                   }
                   eDamage = EffectDamage(SWFP_DAMAGE,  DAMAGE_TYPE_DARK_SIDE);
                   if(GetCurrentHitPoints(OBJECT_SELF) < GetMaxHitPoints(OBJECT_SELF) && SWFP_DAMAGE > 0)
                   {
                       eHeal = EffectHeal(SWFP_DAMAGE);
                       ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF);
                   }
                   ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
               }
               else
               {
                   ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectForceFizzle(), OBJECT_SELF);
               }
           }
       }

 

Are the parameters I need for P1-P5 in there somewhere? I assumed one parameter I'd need would be from the spells.2da file. I've seen other scripts use the row or name for P1. If this holds true here, for Drain Life, this would be either 15 or 274, respectively. Assuming P1 is used for the force power, then I also assumed the delay, duration, etc. would be used in the P2-P5 parameters. These were my assumptions, but nothing I've tried thus far has worked, so that's why I'm trying to dig into the scripts and seek some help from the forums.

 

Sorry, I'm very new to this! Any clues I should be looking for?

Link to comment
Share on other sites

I'm pretty sure there's no pre-defined "cast force power" script in either KOTORs. You should have to create one yourself.

And I am not sure it's even possible to cast one in dialogue instead of during 'gameplay'...

 

Actually, it is very possible to do this. Follow the KT path above and look at "a_play_anim.nss", without the quotes.

 

These are already defined. If you wish to modify it to suit your needs, please post the text for that up here please. My modding comp's down, so I can't myself.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...