lfnetwork.com mark read register faq members calendar

Thread: Editing Force Powers damage
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 06-08-2008, 04:23 PM   #1
Sneeper
Rookie
 
Join Date: Jun 2008
Posts: 30
Editing Force Powers damage

Could someone tell me if it's possible to edit the damage of Force Powers, particulary the Lightning, Drain life and Choke. If possible could someone explain me how to do this or direct me to a guide?

Thanks in advance.
Sneeper is offline   you may: quote & reply,
Old 06-08-2008, 05:09 PM   #2
TriggerGod
Senior Member
 
TriggerGod's Avatar
 
Join Date: Mar 2008
Location: hiding
Posts: 2,415
Helpful! 
It would require some 2da editing... let me dig up my KOTOR Tool.
After looking at Spells.2da, I can see no way to edit them. Of course, I could be wrong. Anyone care to elaborate?
TriggerGod is offline   you may: quote & reply,
Old 06-08-2008, 07:36 PM   #3
e-varmint
Vapid Pomposticator
 
e-varmint's Avatar
 
Join Date: Jul 2007
Location: Abandoned Subway Car
Posts: 760
Current Game: Dragon Age
Helpful! 
The damage is specified in the script k_inc_force. Having looked through it, I suspect that it is easier to make a new force power than to try to alter en existing one (and have it work right).
e-varmint is offline   you may: quote & reply,
Old 06-09-2008, 06:41 AM   #4
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by TriggerGod View Post
After looking at Spells.2da, I can see no way to edit them. Of course, I could be wrong. Anyone care to elaborate?
The impactscript column in spells.2da determines what script will run when a force power is activated. These scripts determine what a force power actual does (damage, status effects etc). All the standard force powers in the game use the same impact script (k_sp1_generic.ncs) which then checks which force power/spell was activated and do things accordingly.

If you just want to tweak things for your own game and aren't concerned about mod compatibility you can just modify this script directly. The k_sp1_generic script only runs a single custom function, which you can find in the k_inc_force include file (scripts.bif). After changing the include file you need to recompile k_sp1_generic. (You can't compile include files)

It's generally easier to ensure compatibility if you change the impact script of the powers you modify to a custom one, and then copy/paste the relevant bits from k_inc_force over there, and then do your changes to that script. That way your changes are kept separate and you won't have to mess with a standard script. It does require you to know a bit about scripting though.

stoffe is offline   you may: quote & reply,
Old 06-09-2008, 09:11 AM   #5
Sneeper
Rookie
 
Join Date: Jun 2008
Posts: 30
Ah this is far beyond my knowledge, thanks anyway!
Sneeper is offline   you may: quote & reply,
Old 06-09-2008, 08:44 PM   #6
e-varmint
Vapid Pomposticator
 
e-varmint's Avatar
 
Join Date: Jul 2007
Location: Abandoned Subway Car
Posts: 760
Current Game: Dragon Age
Helpful! 
It just takes a little practice. Just to spur you on, here is a script that will put a serious hurtin' on it's target. It uses all the the drain life effects, then adds paralysis, a green glow, and virulent poisoning. I copied the Drain Life code from k_inc_force, and tinkered with it a little.

All you have to do is:

Get all the modding tools.
Learn how to compile the script,
Make an icon,
Add a line to the spells.2da file.
Add two lines to dialog.tlk (name and description)

It is easier than it sounds, and you'll find youself making a passle of custom force powers in no time! You can read through the tutorals to get the specific details. Here is a good one:

http://www.lucasforums.com/showthrea...hreadid=130898

For K1:

Code:
#include "k_inc_force" 
 
void main() 
{ 
  
   effect eInvalid;
   object oSource = OBJECT_SELF;
   object oTarget = GetSpellTargetObject();
   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;
            }
            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);
            effect eVFX1 = EffectVisualEffect(2044, 0);
            //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);
            ApplyEffectToObject(1, EffectPoison(POISON_ABILITY_SCORE_VIRULENT), oTarget, 30.0);
            DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget));
            DelayCommand(0.3, ApplyEffectToObject(1, eVFX1, oTarget, 20.0));
            DelayCommand(0.3, ApplyEffectToObject(1, EffectParalyze(), oTarget, 20.0));
            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);
                }
            }
}
Edit: Removed the eLink stuff from the script.

Now, to address your original question some more. The eDamage effect controls the amount of damage the spell does. A simpler way to script damage would be:

effect eDamage = EffectDamage(50);
//causes 50 hp damage
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);

Last edited by e-varmint; 06-09-2008 at 09:32 PM.
e-varmint 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 > Editing Force Powers damage

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 11:22 AM.

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