Prime Posted July 12, 2005 Share Posted July 12, 2005 Is there any difference between Lightsaber forms and and other force powers specified in spells.2da (apart from the settings in fields, etc.) I was thinking of trying to create some new forms, and I'm wondering whether their creation would be more or less the same as normal force powers. Has anyone tried this already? Link to comment Share on other sites More sharing options...
tk102 Posted July 12, 2005 Share Posted July 12, 2005 Hi Prime, Lightsaber forms are pretty different from other force powers, most notably in their lack of impactscript. They are not quite as passive as Feats, but are used the same way -- a script function IsFormActive would have to be called during combat to determine if the Form is selected by the PC. The nFormId paramter of this function should just be the row number of spells.2da. I believe this would require modification of the k_ai_master.nss to get the desired effect and stoffe -mkb- probably has suggestions in this regard. There is a field called formmask in spells.2da that is used to determine how other spells are affected by your form. The pertinent function here is GetSpellFormMask... example from k_inc_force.nss: // from Sp_BlockingChecks... // Users of the Power of the Dark Side III Consular Form // are immune to any spell with the Form Mask for that Form. if( GetSpellFormMask( GetSpellId() ) & FORM_MASK_POWER_OF_THE_DARK_SIDE ) { if( IsFormActive( oTarget, FORM_CONSULAR_POWER_OF_THE_DARK_SIDE_III ) ) { DisplayFeedBackText(oTarget, 1); nReturn = TRUE; } } */ Finally, you can automate the use of a form with SetCurrentForm function. I have no idea if any of this info helped. Link to comment Share on other sites More sharing options...
Maxstate Posted July 12, 2005 Share Posted July 12, 2005 Well if youre going to add some new forms maybe this can help: http://en.wikipedia.org/wiki/Lightsaber_combat Link to comment Share on other sites More sharing options...
stoffe Posted July 12, 2005 Share Posted July 12, 2005 While I'm no expert on this since I've only played with it briefly, I believe that the lightsaber forms are hardcoded, like the AI styles are. You can grant them and they show up on the Force Powers screen like a passive force power, but I haven't been able to get new Saber/Force Forms to appear in the form selector GUI box. Most effects of the lightsaber forms and some of the Force Forms are hardcoded as well. The only thing I can see about lightsaber forms that is not hardcoded is Saving throw bonus/penalty vs. Force powers, which are determined in k_inc_force.nss. The engine seems to handle everything else internally, especially since some forms grant bonuses that there are no corresponding script Effects for. As for Force Forms, bonuses to damage, duration and saves are handled in k_inc_force.nss, by the CalcDamage() and CalcDuration() functions. Modifications to FP costs aren't scripted as far as I can tell. As tk102 said, AFAIK the best you could do would be to use IsFormActive() in the Force Powers script to check for if your form is active and then apply whatever force-related effects or changes that is associated with it. As for lightsaber forms doing things not force power related, you likely can't make new ones that work just like the standard forms. You could probably fake it by adding a IsFormActive() check in the party member heartbeat-script. It would check if the form is active and if so apply appropriate effects with a PERMANENT duration to the creature, if effects from that form isn't already present. You'd also need to remove effects from any inactive forms if present. That's a rather clumsy way of doing it though, and unlike normal forms your effects would disappear if a script calls ClearAllEffects(), which is commonly used in cutscenes. That would all be moot however unless you can figure out a way to get custom forms to show up in the GUI. I haven't been able to, but I'm by no means an expert at this sort of thing. Link to comment Share on other sites More sharing options...
Prime Posted July 12, 2005 Author Share Posted July 12, 2005 Thanks guys. I was just thinking about having "mastery" lightsaber forms that expand on the forms that are already there. In essense, the default ones would be proficiency in those forms, and the new ones would be mastery in a particular form. I'd probably limit the player to being a master in only one or two which they can select at a certain level. I hope that makes sense. I knew that the abilites for each form were hardcoded, so I had thought of implementing it as a disquised force power. I was hoping that I could just mimic the entries of the lightsaber forms in spells.2da and have it put in the right GUI slot. Does it not work this way? Originally posted by stoffe -mkb- As for lightsaber forms doing things not force power related, you likely can't make new ones that work just like the standard forms. You could probably fake it by adding a IsFormActive() check in the party member heartbeat-script. It would check if the form is active and if so apply appropriate effects with a PERMANENT duration to the creature, if effects from that form isn't already present. You'd also need to remove effects from any inactive forms if present. That is probably the best way to go. Since I am really only trying augment one of the current forms, I can check to see if it is selected and if so apply additional bonuses as a permanent force power. At least that is what I understand from what your are saying. Originally posted by stoffe -mkb- That's a rather clumsy way of doing it though, and unlike normal forms your effects would disappear if a script calls ClearAllEffects(), which is commonly used in cutscenes. Since I assume the heartbeat script runs regularly, wouldn't the form/power get reapplied after ClearAllEffects() the next time the heartbeat script runs? Link to comment Share on other sites More sharing options...
tk102 Posted July 12, 2005 Share Posted July 12, 2005 Originally posted by Prime I was hoping that I could just mimic the entries of the lightsaber forms in spells.2da and have it put in the right GUI slot. Originally posted by stoffe -mkb- You can grant them and they show up on the Force Powers screen like a passive force power, but I haven't been able to get new Saber/Force Forms to appear in the form selector GUI box. Getting the new icon to show up the Form Selector GUI may be the biggest obstacle here it seems. It appears the naming convention for the icon's .tga is ifrm_* ... I have not tried doing any modding in this regard, but I suppose I'd start by duplicating row 258 for example of spells.2da, chaning the iconresref to my own .tga, and forcefriendly to 34. Then use KSE to grant the lightsaber form and see if you can select it in the GUI. Link to comment Share on other sites More sharing options...
Prime Posted July 12, 2005 Author Share Posted July 12, 2005 Originally posted by tk102 Getting the new icon to show up the Form Selector GUI may be the biggest obstacle here it seems. It appears the naming convention for the icon's .tga is ifrm_* ... I have not tried doing any modding in this regard, but I suppose I'd start by duplicating row 258 for example of spells.2da, chaning the iconresref to my own .tga, and forcefriendly to 34. Then use KSE to grant the lightsaber form and see if you can select it in the GUI. I'll give that a try. Link to comment Share on other sites More sharing options...
The_Maker Posted July 12, 2005 Share Posted July 12, 2005 Originally posted by Prime I'll give that a try. If you could make new Force/Lightsaber forms and release it... I bet a lot of people would become your freind really quick Link to comment Share on other sites More sharing options...
Maxstate Posted July 12, 2005 Share Posted July 12, 2005 I would just like to see some buffs to current ones, they really dont make that much of a difference Link to comment Share on other sites More sharing options...
stoffe Posted July 12, 2005 Share Posted July 12, 2005 Originally posted by Prime I knew that the abilites for each form were hardcoded, so I had thought of implementing it as a disquised force power. I was hoping that I could just mimic the entries of the lightsaber forms in spells.2da and have it put in the right GUI slot. Does it not work this way? There are two main problems with this as I see it. First as mentioned I don't know if it's possible to make a passive force power actually count as a saber form for the game. Just copying one of the existing lines in spells.2da and updating the relevant fields is not enough. It'll show up on the force powers screen but not on the GUI button where you select forms. I would imagine that if you implement the form as a force power instead it wouldn't count as a form for the IsFormActive() function, and you'd need to use a variable to keep track of wich custom form is active as well. Since forms have no impact scripts the game keeps track of which one is active internally. The second problem is that not all bonuses granted by saber forms can be duplicated through scripting. There are for example no available effects for things like increasing the Critical Hit multiplier or critical threat range, AFAIK. Originally posted by Prime Since I assume the heartbeat script runs regularly, wouldn't the form/power get reapplied after ClearAllEffects() the next time the heartbeat script runs? Yes, the heartbeat script (usually) runs once per round. This is why I suggested handling the adding/removal of effects on heartbeat rather than when the form is first activated. It's a bit more work for the scripts to do, but it'll ensure that the effects stay on even after being cleared by other scripts. Link to comment Share on other sites More sharing options...
Prime Posted July 13, 2005 Author Share Posted July 13, 2005 Thanks for the tips. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.