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.