lfnetwork.com mark read register faq members calendar

Thread: TSL Force Power Creation Question
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-21-2013, 06:22 AM   #1
Ceane Cilias
Lurker
 
Join Date: Sep 2009
Location: Australia
Posts: 2
Current Game: KotOR 2: TSL
Question TSL Force Power Creation Question

Hi all.

So something I've been meaning to do for a long time is merge Force Lightning and Drain Life into a Drain Life attack that affects the people standing in front of you. I'm new to the whole creating force powers thing, so I've done a mixture of go off of Beancounter's tutorial and the code in the two force powers themselves. However when it came to compiling the code, it game me the following Syntax errors:

Line 6, at "void"
Line 13, at "SWFP_DAMAGE"
Line 27, at "ApplyEffectToObject"
Line 32, at "SignalEvent"
Line 38, at "if"

My code for those who can give me a hand:
Code:
#include "k_inc_force"

int FORCE_POWER_DRAIN_FIELD = 304


void main()
{
    SWFP_HARMFUL = TRUE;
    SWFP_PRIVATE_SAVE_TYPE = SAVING_THROW_FORT;
    int nDice = GetHitDice(OBJECT_SELF);
    float fRange = Sp_CalcRange( 17.0 );

    SWFP_DAMAGE = Sp_CalcDamage( oTarget, nDice, 5 );
    //SWFP_DAMAGE = d6(nDamage);
    SWFP_DAMAGE_TYPE = DAMAGE_TYPE_DARK_SIDE;
    SWFP_DAMAGE_VFX = VFX_PRO_DRAIN;
    SWFP_SHAPE = SHAPE_SPELLCYLINDER;

    effect eBeam = EffectBeam(VFX_BEAM_DRAIN_LIFE, OBJECT_SELF, BODY_NODE_HAND);
    effect eVFX = EffectVisualEffect(SWFP_DAMAGE_VFX);
	
    effect eHeal;
    effect eDamage = EffectDamage(SWFP_DAMAGE, DAMAGE_TYPE_DARK_SIDE);
    object oUse = GetFirstObjectInShape(SWFP_SHAPE, fRange, GetLocation(oTarget), FALSE, OBJECT_TYPE_CREATURE );
    effect eBump = EffectVisualEffect(SWFP_DAMAGE_VFX);

    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);
        }
    }
}
break;
Ceane Cilias is offline   you may: quote & reply,
Old 11-21-2013, 08:25 AM   #2
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Ceane Cilias View Post
Hi all.

So something I've been meaning to do for a long time is merge Force Lightning and Drain Life into a Drain Life attack that affects the people standing in front of you. I'm new to the whole creating force powers thing, so I've done a mixture of go off of Beancounter's tutorial and the code in the two force powers themselves. However when it came to compiling the code, it game me the following Syntax errors:

Line 6, at "void"
Line 13, at "SWFP_DAMAGE"
Line 27, at "ApplyEffectToObject"
Line 32, at "SignalEvent"
Line 38, at "if"

My code for those who can give me a hand:
Show spoiler
Welcome to the forums, Ceane Cilius!

I checked your code. The first thing missing was a semicolon after the "int FORCE_POWER_DRAIN_FIELD = 304". I also moved that inside the void main() section. After that, I had to copy some identifiers from k_inc_force.nss. Lastly, if you're not running this inside k_inc_force.nss or a switch statement, you don't need the "break;" at the end.

The code that compiled is below( Warning: Just because it compiles, doesn't mean it will work. It's happened to me often enough...):
Show spoiler


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 11-23-2013, 02:14 AM   #3
Ceane Cilias
Lurker
 
Join Date: Sep 2009
Location: Australia
Posts: 2
Current Game: KotOR 2: TSL
Quote:
Originally Posted by Fair Strides 2 View Post
Just because it compiles, doesn't mean it will work.
Thanks for your help, but it seems that statement rings true. I'll have a play around with it and see what I can/can't do.
Ceane Cilias is offline   you may: quote & reply,
Old 01-13-2014, 02:44 PM   #4
Malxados
Rookie
 
Malxados's Avatar
 
Join Date: Feb 2009
Location: Mandalore
Posts: 224
Current Game: Warframe, SC Blacklist, KOTOR1
Quote:
Originally Posted by Ceane Cilias View Post
Thanks for your help, but it seems that statement rings true. I'll have a play around with it and see what I can/can't do.
Get it working?


"But God demonstrates His own love toward us, in that while we were still sinners, Christ died for us." (Romans 5:8, NKJV)
"For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord." (Romans 6:23, NKJV)

Ask me about my sig!

Bao-Dur: I'll take the one who was stupid enough to threaten us instead of shoot us when he had the chance.

k_inc_force bothers me.
Malxados 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 > TSL Force Power Creation Question

Tags
drain, force, lightning, syntax

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 07:30 PM.

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