Jump to content

Home

spells 2da and force power scripts


spyblade

Recommended Posts

I have been working on the spells.2da file and I am copying and pasting the existing lines of the functioning force powers to new lines at the bottom, then I have changed the new '(row labels)' and the prerequisites to match.

 

For a mod I am working on, I am making each jedi class have its own grouping of force powers. They are intended to operate the same as the original powers the only thing I want to effect is the amount of points each force power costs for each class exclusively. The problem is that when the character uses the power it does not actually do anything except take away the force power points.

 

I changed the numbers in 'row labels' column, but I have left the 'label' column the same. The 'impactscript' reference in the lines is left the same as well. I have read through the k_inc_force.nss and could find no refences to line numbers within that file. I don't know how the game reads the different force related scripts. Could someone please point me in the right direction.

 

Also, How many files handle the original force powers and how enemies save against them or use the powers themselves? Any help would be greatly appreciated.

 

P.S. pretty noobish at scripting

 

Thanks

Link to comment
Share on other sites

The problem is that when the character uses the power it does not actually do anything except take away the force power points.

 

The main force power script used for all the standard powers, k_sp1_generic, check the line number in spells.2da of the force power that was just used when determining what to do. This is done in the huge switch/case statement in the Sp_RunForcePowers() function in k_inc_force. As such your new lines do not match any cases and nothing will happen.

 

Thus you'd either have to modify k_sp1_generic to check for your lines as well (not recommended), or make a separate copy of it and k_inc_force and make it check for your line numbers instead of the standard ones, and assign this new script as impact script of your new lines.

 

Do keep in mind though that the generic combat AI scripts won't use your new force powers unless you rewrite that as well, since it is written to use the standard line numbers for the force powers when checking if an NPC has a talent and making them use it. Otherwise your characters wouldn't use those powers unless you directly tell them to.

 

Also, How many files handle the original force powers and how enemies save against them or use the powers themselves? Any help would be greatly appreciated.

 

The k_sp1_generic is the general impact script that's used for all standard force powers in the game. This script does not contain much code in itself though, pretty much all of it is found in the k_inc_force include file instead.

 

There is nothing that forces you to use this file if you make your own force powers though. I'd recommend that you use your own scripts for those instead (set the name of the script in the impactscript column in spells.2da), makes it much easier to keep your mod compatible with other mods.

Link to comment
Share on other sites

Thanks for the help.

 

Thus you'd either have to modify k_sp1_generic to check for your lines as well (not recommended), or make a separate copy of it and k_inc_force and make it check for your line numbers instead of the standard ones, and assign this new script as impact script of your new lines.

 

If I make a separate copy of k_inc_force and k_sp1_generic files, where would I put the new line number? Would I put it in where it normally says FORCE_POWER_FORCE_IMMUNITY or where it says GetSpellId. If I have basically no knowledge of scripting, should I try to learn a bit more before I do this?

 

 

There is nothing that forces you to use this file if you make your own force powers though. I'd recommend that you use your own scripts for those instead (set the name of the script in the impactscript column in spells.2da), makes it much easier to keep your mod compatible with other mods.

 

Yeah. I am copying each force power twice, so that each power can have its own cost for each class. It is for a mod that alters the character creation process so that the 20 levels are squeezed into 4 levels. But since we can not grant force points with scripts in K1, I am using the force sensitivity feat as the base for those 20 levels for each class. The force point cost is what I am trying to alter with this quite large workaround.

 

Just had a thought... Is there a way to add an include script or a new portion in k_inc_force that tells each power to cost a particular more amount for each of the sentinel and guardian classes?

 

Thanks.

Link to comment
Share on other sites

If I make a separate copy of k_inc_force and k_sp1_generic files, where would I put the new line number? Would I put it in where it normally says FORCE_POWER_FORCE_IMMUNITY or where it says GetSpellId.

 

You put it as the case value for each case in that huge switch statement... i.e. you replace case FORCE_POWER_FORCE_IMMUNITY: with case 310: for example (if your new force power is on line 310 in spells.2da). The FORCE_POWER_* are constants that represent line numbers in spells.2da.

 

Make a copy of k_inc_force.nss and k_sp1_generic.nss and rename them to something else, and then set the new name of the include file in the #include directive at the top of the k_sp1_generic.nss script code.

 

Just had a thought... Is there a way to add an include script or a new portion in k_inc_force that tells each power to cost a particular more amount for each of the sentinel and guardian classes?

 

No, unfortunately you can't dynamically modify the casting cost of a force power (other than by adjusting the light/dark alignment of the character), the base costs are set in the spells.2da file. You could modify the impact scripts of all powers to either drain some more force points, or give some back, when the power is used. But that wouldn't prevent the character from using the power even if they don't have enough FP left with the additional cost (or make them able to use it if they have less than the base FP cost left in their pool, but would have had enough to use it with a reduced cost).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...