LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   Holowan Laboratories (http://www.lucasforums.com/forumdisplay.php?f=324)
-   -   Need help w/ P1 - P5 params in DLG Editor for script (http://www.lucasforums.com/showthread.php?t=211498)

Darth Newbie 11-25-2012 10:00 AM

Need help w/ P1 - P5 params in DLG Editor for script
 
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

Darth InSidious 11-25-2012 11:13 AM

KotOR Tool --> KotOR II --> BIFs --> Scripts --> Scripts, Source --> k_sp1_generic.nss . ;)

Darth Newbie 11-25-2012 11:38 AM

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

Code:

//:: 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:

Code:

        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?

Hassat Hunter 11-26-2012 08:53 AM

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'...

Fair Strides 2 11-26-2012 11:25 AM

Quote:

Originally Posted by Hassat Hunter (Post 2823772)
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.

Hassat Hunter 11-26-2012 06:27 PM

Playing animations is different from actually casting the spell.

Fair Strides 2 11-26-2012 07:01 PM

Quote:

Originally Posted by Hassat Hunter (Post 2823804)
Playing animations is different from actually casting the spell.

Unless you know how to edit the script to make it work...

Dang it! If only I had my modding comp up and running!!!


All times are GMT -4. The time now is 07:50 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.