Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

How to create a custom force power

Page: 1 of 1
 tk102
06-28-2004, 2:06 PM
#1
How to Create a Custom Force Power (by tk102, Darth333, and svцsh)

Basically a Force Power is just another way to execute a script in the game with some casting animations. It's recommended that you write your own script rather than trying to customize the k_inc_force.nss. That .nss is a good place to see examples of how the existing force powers work, along with saving throws and resistances.


Writing Your Custom Script
Not covered here.
beancounter describes how to make a buff up force power in this thread (http://www.lucasforums.com/showthread.php?s=&threadid=137498).



Creating Your Custom Icon

First thing open up you paint program, I will be using Photoshop for
this, because it’s the industry standard and nothing beats it. All
short
cuts I use are for Photoshop it’s possible they work in psp as it has
copied most of Photoshop’s functionality.

Ok first thing open Kt > ERF’s > swpc_tex_gui.erf most force power
icons and feats are in the I dir\

Ok find a few icons that could work for your force power the object
here is to make an icon that fits in with the game and depicts your
powers
function so lets get started. We start with a default so you don’t have
to mess around with image size and what better way to learn to do
something then look at the originals, I strongly suggest looking at the
alpha channel as well this hill help you understand how they work.
> Black is transparent and white opaque on the alpha channel

So save some of the icons to a new dir\ or to your desktop by hitting
the write file button

Now back to your paint program.
1. file >open > desktop and open your image or images.
2. Copy the first layer by hitting ctrl +j (duplicate your layer) keep
the
original layer safe and any others that you are about to make a drastic
changes to -- while making your icon it will save you headaches latter
on.
3. Make a new layer solid black paint using bucket fill. Grab the layer
in the
layers pallet and drag it down between the "background" and background
copy. Now with the solid black as a separator, we are ready to begin.
4. Go back to you background copy layer and start editing it -- be
creative and innovative. Cut the original out so that all that remains
is your focal design. If your original design has solid background fill
an easy way to cut it away is use the wand tool. Press W on the
keyboard and click the background of the layer. All pixels the same colour are
selected. Now ctrl +x to cut them away. If it’s a busy background then
using the selection lasso will suit you better. Use the straight-lined
lasso clicking at every curve to cut away the background fast. When the
selection is closed hit shift + ctrl + I (invert selection ) to cut
away the bg, not the main design.
5. Now in this case lets say you have a design that is red and you want
to be a light side power. Ctrl + click the thumbnail Icon of the layer
and you will see an instant selection only around the design. This is
the reason we just cut it out. Now hit ctrl + u (hue /saturation ). Use
the eyedropper tool from the hue saturation window to select the red.
Now use the top slider to change all the red to blue. (Use another
light side icon to match colour tones.) Once you happy with it hit ok
and now
you have your blue icon. On to the last step...
6. Make your new alpha channel with the selection still active on you
new blue icon layer. Do this by going to > selection drop down and
choosing save selection. Don’t name it, just hit ok. Now go to the channel
palette that is behind the layers palette. At the bottom of the
channels you should see your new channel. Now delete the original alpha
channel and rename yours to alpha1 .
7. Duplicate you image by right clicking the title bar of your canvas
and choosing > duplicate image save the original as ???.psd to fix any
thing you
want later on, and flatten the copy make sure you only have the one
alpha channel save it as (name of your force power= blahblah)
ip_blahblah.tga at 32 bit with alpha channel.


Editing Spells.2da

Create a new row.

For the Label field, start off with "FORCE_POWER_"

In the Name and Spelldesc fields, you're stuck with having to enter a dialog.tlk entry number. I recommend using ktlk.exe to search for a pertinent entry. You'll probably find something close. You can download ktlk.exe from pcgamemods.com.

Forcepoints is the number of forcepoints expended per casting, before bonuses/penalites are applied.

GoodEvil-- enter G or E or a single dash depending on whether bonuses/penalites should be granted, depending on the alignment.

Usertype=1

Prerequesites -- these are the row numbers of the force powers that the player must have before gaining access to your new force power. If more than one are needed, separate them with an underscore. If no prerequisites are needed, enter four astrisks.

Masterspell isn't used (****).

Guardian/Consular/Sentinel -- this is level of experience required for the jedi class to gain access to the spell.

Inate -- the global level of the creature required. Just make it the same as the other classes.

Maxcr -- ? Put 3, 6, or 9 down depending on how powerful you think your spell is and the levelof the force power.

Category -- ? I don't know, put down a category entry of another force power that you think is similar. I haven't seen this field affect how the script is executed. Here are the values used by other powers:
- 1808: apply to force powers and stimulants that boost the attributes
- 1201: to force powers and items (gravity generator) that stun the ennemy but where no damage is made
- 2201: similar to 1201: droid destroy and insanity
- 2301: don't ask me...droid destroy, knight valor, valor ?????
- 1011: force powers that affect the ennemyies attributes: affliction, plague, force suppres, slow
- 1028: only used for breach
- 1101: jump, adv. jump, kill, throw lvl 1 (offensive fp)
- 1301: choke, push, whirlwind, wound: fp that cause damage and have a stunning effect at the same time ( one single ennemy only)
- 1501: drain life (targets one single ennememy) ???
- 2101: death field (targets multiple ennemies) ???
- 2111: storm
- 2302: wave
- 2441: cure and heal
- 4101: shock and adv throw...???
- 8101: lightning

Range --
T : is used for heal, cure, shields, serums, repair kits and the Sand Person disguise! (items that can be used and FP that can be casted that have protective, regeneration effects). Actual range will be determined by the script.
W : Weapon range? (eg. throw lightsaber)
P : personal/party range. FP that boost attributes (valor, aura, immnunity)
S : Spherical range of effect. The actual range will be determined by the script. (eg. Force Wave, Death Field, Force Storm)
M : Medium range, used for offensive FP like Shock, Choke.
L : Long range, as far as can be targeted by reticle? used for grenades, but why not force powers?
****: passive FP force powers: master sense, regeneration, dominate and affect mind, Cathar reflexes...(stuff that can't be selected during Battles)

Iconresref -- the name of your custom icon.

Impactscript -- the name of your custom script

Conjtime -- milliseconds to cast spell(?). 170 is as good a number as any.

Conjanim -- hand, up, dark, throw. I think this is where a glow occurs when casting.

conjheadvisual,conjgrndvisual,conjsoundvfx,conjsou ndmale,conjsoundfemale -- don't appear to be used (**** for all).

castanim -- self, throw, dark, jump, up. This is the animation the character will perform when using the force. Self is the most common with the outstretch arm. Dark is the 'underhanded' motion (eg. Drain Life). Up is the raising the arm upwards (eg. Force Wave). Throw and jump are used with Lightsaber throw and Force Jump.

casttime -- 1330 milliseconds is standard

castheadvisual -- Not used for other force powers but in theory, you could use v_con_dark, v_fpush_cas, or v_con_light.

casthandvisual -- visual effect on the hand when casting. options are v_con_dark, v_fpush_cas, or v_con_light.

castsound -- any sound in sounds.bif can be used here. v_useforce is the most common.

catchtime, catchanim, proj, projmodel, projtype, projspwnpoint, projsound, projorientation, immunitytype, itemimmunity -- enter 0 or **** just as in the other rows in spells.2da.

forcehostile -- If your force power is to be used on an enemy, you must specify an index number in this field. If two or more spells have the same index number, the one with the highest value in 'pips' is displayed in the hostile reticle.

forcefriendly -- If your force power is to be used outside of combat, you must specify an index number in this field. If two or more spells have the same index number, the one with the highest value in 'pips' is displayed in the friendly force power selection window.

dark_recom, light_recom -- this is the order in which 'auto-level up' will select your force power in relation to other possible force powers. No numbers in these fields should have duplicates.

exclusion -- ? I believe this represents who gets excluded from the force power's effect. 0x00=no exclusion. 0x01 = humans are excluded. 0x02 = droids are excluded.

requireitemmask, forbiditemmask -- these are bit masks representing which items are required or are forbidden when using this force power. Both the forbiditemmask and the requireitemmask use the same bits to describe which baseitems have permissions to work for a spell. Those bits are defined as follows:
0x0001 - Armor_Class_4
0x0002 - Armor_Class_5
0x0004 - Armor_Class_6
0x0008 - Armor_Class_7
0x0010 - Armor_Class_8
0x0020 - Armor_Class_9
0x0040 - Lightsabers
If there aren't any item requirements or restrictions, enter 0x0000 in both colums.

Pips -- as mentioned in forcefriendly and forcehostile, pips are used to determine which force power is the highest priority.

Itemtargeting -- set to **** for force power (this is only used for armbands/droid utilities).

Hostilesetting -- if your force power is hostile, enter 1 here. Otherwise enter 0.


Testing Your Force Power

The easiest way to test your force power is to use the KotOR Savegame Editor to grant the force power to your character. To do this, first copy your modified spells.2da and your compiled script and your custom icon to override folder. Then launch KSE v1.4.1 and browse to a savegame for modification. Select your characters' force powers on the left side and make sure the "Show All Force Powers" checkbox is checked on the right pane. You should now be able to see your newly added Force power listed as you typed it in the Label field of spells.2da. Grant it your character. Hit Apply and Commit Changes. Then launch the game and go try it out.

You may find that you need to fix the script, since no one gets it right on the first try. No problem, just fix it, recompile and put it into the override. You can even do this while the game is still running.
 Darth333
06-28-2004, 2:40 PM
#2
Hope this will help people making their own FP :)

Here is another method i use to test the FP and to see how the whole thing looks in the level up screen: I use KSE to add the required number of experience points to level up to the proper level (you can't do that with a lvl 20 character) and then select the FP.


You may find that you need to fix the script, since no one gets it right on the first try. That is completely true :rolleyes: :D
No problem, just fix it, recompile and put it into the override. You can even do this while the game is still running. ...not with a 1.6 GHz CPU :crybaby:
 Darth Khasei
06-28-2004, 2:43 PM
#3
Great guide! :D
 Lorden Darkblade
06-28-2004, 5:13 PM
#4
If I only knew how to script...
Anyone knows a site or anything that may teach me how to do it?
I would apprecitate very much.

Thanks in advance,
ReLoaD2K
 Darth333
06-28-2004, 5:18 PM
#5
Look at T7's sticky: Do you Want to mod SW-KotOR? Then Start here. (http://www.lucasforums.com/showthread.php?s=&threadid=124284&perpage=40&pagenumber=1)
Under the web links section.
 Lorden Darkblade
06-28-2004, 5:32 PM
#6
I looked but... Hmmmm..... Kinda greek to me.
I think I'll leave the Force Powers to you guys :p
Is the scripting based on what scripting language? I'll try to buy a book or something...
Maybe if I look into the scripts of other powers, but I dont think I'll learn much.
 Darth333
06-28-2004, 5:34 PM
#7
Start with something simple. Like recruiting an npc, adding items and stuff like that and at the same time look at the other available .nss files, especially nwscript.nss.
 Lorden Darkblade
06-28-2004, 5:53 PM
#8
I heard a lot of people saying about that newscript.nss but I never saw that file.
What is it?
I know how to make a file appear in talking with someone but a Force Power is too different.
 tk102
06-28-2004, 7:17 PM
#9
That's nwscript.nss, not newscript.nss, as in Neverwinter. It in the scripts.bif file.
 Mav
06-28-2004, 8:02 PM
#10
WOWSER'S nice guide tk I'm sure this will lead to some good mods.
 tk102
06-29-2004, 1:30 AM
#11
Just added svцsh's instructions on how to make a custom icon. Thanks svцsh -- just got your email.
 svцsh
06-29-2004, 1:41 AM
#12
That’s great Tk Sorry about the delay , computer trouble and all ;) glad to help out.

svцsh
 Mono_Giganto
08-05-2004, 1:28 PM
#13
I apologize for digging up this old thread, but would this work for making a grenade? Cause I kinda always wanted a grenade with an effect like force storm. Is that possible?
 Darth333
08-05-2004, 2:00 PM
#14
You can add an existing force power to an item by simply editing it's properties: http://www.lucasforums.com/showthread.php?s=&postid=1589165#post1589165)

However, if you want to create a custom power (different effects than the force powers that are already available) and add it to a grenade, you will have to use spells.2da to refer to your new force power custom script .
 Darth_ToMeR
08-05-2004, 2:33 PM
#15
Nice. Thanks!
 Mono_Giganto
08-05-2004, 2:43 PM
#16
Well, okay I did that, but my grenade doesn't do anything when I throw it. what did I do wrong? I set the property to activate item:force storm instead of activate item:grenade:fragmentation.

Is there something else as well?

Edit: I took another look at it, seems that every grenade type has a different baseitem. Does that mean I'll need to add a baseitems.2da entry?

2nd Edit:Okay that's an improvement, but it still does not help. The grenade's a dud.
 maddogsz
08-21-2004, 11:54 PM
#17
ben looking around alot but cant find or figur out how to + or - the dam done by a force power

is it in the k_inc_force.nss file ?

or is it some were els?
 Darth333
08-22-2004, 12:01 AM
#18
Yes, you'll find examples in k_inc_force.nss. If you create a custom fore power, you will also have to create a custom script which will include the damage.
 maddogsz
08-22-2004, 1:41 PM
#19
ok whats the script i use for dameg iv ben looking and i cant quit figur it out

i think its some thing alon the line of int SWFP_DAMAGE

theres int SWFP_DAMAGE_TYPE that dos dameg typ but i cant fuiger how to do dameg

i noticed that all the other fp go by lvl you are like lvl 4 push dos like 9 dam lvl 16 dos 24 dam no matter what stats you have

so how do i do this and modify it iv looked at the stikys and cant fig it out


also is there a way to make force asorb?

like you take 100 SWFP_DAMAGE_TYPE = DAMAGE_TYPE_DARK_SIDE;

it stops 50 of the dam and regans 50 force power

basicly the exat oposet of wat drain dos dose dameg and heals you
this would stop dameg and heal your fp
Page: 1 of 1