View Full Version : Editing feats with scripting

11-09-2005, 11:38 AM
Everyone would love to be able to edit some of the feats in K1 and TSL, but haven't been able to as the feats are hardcoded into the game. But would it be possible to with scripting?

I am no scripter, but i do understand some of the basics, and have read a few threads relating to this. just recently someone asked if the dueling feat could be altered, so lets go with that for now.

If the apropriate variables were set, as in do they have the dueling feat/are they using a one handed weapon only, it would be fairly easy (for actual scripters anyway) to add a trigger that gives an additional att and def bonus. This script would probably have to be the onheartbeat script, so to prevent repeated bonuses, what if another trigger was added that fired a different script in its place, or activated a different part of the same script while disabling itself? One that drops your att/def, if you are not using the appropriate weapon, and then fires the original script/section, so the process is looped.

The pc .utc files would have to be updated, but i doubt anyone would care if the npc's missed out on this. The biggest drawback of this system, if it couldn't be contained all in one script, is that it would only be feasible to change one or two feats. it would end up requiring hundreds of files otherwise, which makes editing a real nightmare. With a simple tutorial, even noob scripters like me, could find and alter the effects this script has.

Anyway, like i said, I'm a noob, so i could be way off. If not however, this would make a brilliant mod. Each character could use different scripts, and gain different bonuses so suit their class/personality/alignment.

Well thats all i guess, so Rictus135 signing off!

Det. Bart Lasiter
11-09-2005, 06:36 PM
I think I may have a workaround for the feat system if the following works and can be triggered when the PC leaves or enters a module.

void main()
declarations, ect, ect

while (GetHasFeat(nFeat, OBJECT_SELF))
ExecuteScript("feat_script", OBJECT_SELF);

Although that may slow the game down some, seeing as it would constantly execute.

11-10-2005, 10:15 PM
There are two problems with that approach. First, you would have to change every on enter script in the game. There are a lot of them and it would also probably interfer with other mods. Second, the feat effects would not take effect until you entered a new module.

However, changing the on enter script would not really slow the game down, since it would only fire once you enter a module. Changing the Heartbeat script would slow the game down because it fires roughly every 6 seconds.

In my personal opinion the best way to try to introduce a new feat is to make a custom armband or droid utility item that can be used to grant the bonuses that you want. Either by a script or a item property. If you use a script, just set the duration to permament. Of course you would have to check that the character had the required feat.