lfnetwork.com mark read register faq members calendar

Thread: Need help w/ P1 - P5 params in DLG Editor for script
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 11-25-2012, 10:00 AM   #1
Darth Newbie
Lurker
 
Join Date: Nov 2012
Posts: 3
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 Newbie is offline   you may: quote & reply,
Old 11-25-2012, 11:13 AM   #2
Darth InSidious
A handful of dust.
 
Darth InSidious's Avatar
 
Join Date: Feb 2005
Location: The Eleven-Day Empire
Posts: 5,769
Current Game: KotOR II
KotOR Tool --> KotOR II --> BIFs --> Scripts --> Scripts, Source --> k_sp1_generic.nss .



Works-In-Progress
~
Mods Released
~
Quid existis in desertum videre?
Darth InSidious is offline   you may: quote & reply,
Old 11-25-2012, 11:38 AM   #3
Darth Newbie
Lurker
 
Join Date: Nov 2012
Posts: 3
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?

Last edited by Darth Newbie; 11-25-2012 at 12:35 PM.
Darth Newbie is offline   you may: quote & reply,
Old 11-26-2012, 08:53 AM   #4
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 560
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'...
Hassat Hunter is offline   you may: quote & reply,
Old 11-26-2012, 11:25 AM   #5
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 594
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Hassat Hunter View Post
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.
Fair Strides 2 is offline   you may: quote & reply,
Old 11-26-2012, 06:27 PM   #6
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 560
Playing animations is different from actually casting the spell.
Hassat Hunter is offline   you may: quote & reply,
Old 11-26-2012, 07:01 PM   #7
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 594
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Hassat Hunter View Post
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!!!
Fair Strides 2 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Need help w/ P1 - P5 params in DLG Editor for script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:02 PM.

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