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.

Non-Jedi feat/powers question... (Wookie Rage in mind)

Page: 1 of 1
 darthrevanrlz
06-16-2006, 9:35 AM
#1
Is there a way to give non-Jedi NPCS (I'm thinking Mandalore, mostly) a feat/power like Wookie Rage?

That being said, is it even possible to mod/add feats (I'm thinking passive ones, not combat!!, like, let's say, buff up dueling...) or are they simply just too much hardcoded in the game? If there is such a script foundable with KT concerning feats, I haven't found it yet...

Anyway, about non-Jedi "Rage" thingie... Is it possible? Or should I just bite the bullet on making it look cool (rage animation) and just put the non-Jedi feat/power on an armband?

Already can do the latter (armband with Valor animation, lol), but I'd rather go the non-item route...
 stoffe
06-16-2006, 9:44 AM
#2
Is there a way to give non-Jedi NPCS (I'm thinking Mandalore, mostly) a feat/power like Wookie Rage?
That being said, is it even possible to mod/add feats (I'm thinking passive ones, not combat!!, like, let's say, buff up dueling...) or are they simply just too much hardcoded in the game?


The functionality of feats is hardcoded in the game engine, there is no way to alter that. You can add new feats, but in themselves they would do nothing. You could, however, check if the character knows a particular feat in a script running from some other source. Though you can't make a feat run a script directly.

Unfortunately I think custom items are the easiest way of doing this (adding something Rage-like) for characters unable to use force powers. Add three "dummy" feats for Rage to the character, then make the item/armband script check which feats the character has and initiate the proper level of Rage accordingly. This way the armband would do nothing if you give it to some other character who doesn't know any of the Rage feats. :)


Theoretically you could also rename the Wookiee Rage feats to remove the "Wookiee" bit and grant those feats to Mandalore as well. I don't think the feats check the race of the creature attempting to use them.
 darthrevanrlz
06-16-2006, 10:51 AM
#3
Gues I'll just go with PC-specific armbands...

Oh, and about Wookie Rage, I was just using as an example for the +1 attack feature... The new "power" is customized and reflects the prowess of a battle-hardened warlord, not an homicidal crazed furrball... :D

So far, I can't get the animation right through spells.2da, though... Will compare scripts and see if/where the Rage/Fury effect is in inc_force.nss
That would be the way to go, right?

I'll take the "easy" (gaaah) script/power route, but what do you mean by "dummy" feats? And how/where would I add them anyway?

Curiosty, eh.

Anyway, I *should* be getting back to work :D
 Lit Ridl
06-16-2006, 1:09 PM
#4
Did you mean to add power/feat? There is a script for doing this. To grant force power use this:
void main() {
GrantSpell(000, GetFirstPC());
}

000, - is row nunber in spells.2da
Here is the way to add feat:

void main() {
GrantFeat(000, GetFirstPC());
}

000, - is row number in feat.2da.
Here is sript to add all three levels of wookie rage to the PC:

void main() {
GrantFeat(231, GetFirstPC());
GrantFeat(232, GetFirstPC());
GrantFeat(233, GetFirstPC());
}

If you want to grant feat or power to non-main character (mira for example) then type their's name instead of GetFirstPC. If you meant about changing them, they are hardcoded. If you want to boost feats or powers a little make changes in k_inc_force for force powers. something like k_inc_feat is unknown to me. I belive feats are hardcoded. Sorry if I am wrong.
Oh I have forgot to say you to compile your script and attach somewhere (in dialog or on trigger for example, they are many ways.).
 stoffe
06-16-2006, 1:11 PM
#5
So far, I can't get the animation right through spells.2da, though... Will compare scripts and see if/where the Rage/Fury effect is in inc_force.nss
That would be the way to go, right?


I'm not sure you can modify the "armband activation" animation for a single armband, it would be an "all or nothing" deal. Technically you aren't really "casting" the force power when firing it from an armband, you just trigger it, so the casting animations set in spells.2da would not be used.


I'll take the "easy" (gaaah) script/power route, but what do you mean by "dummy" feats? And how/where would I add them anyway?


By "dummy" feats I meant adding new feats to the game to represent your "Rage" ability or whatever you wish to call it. Since those feats won't do anything on its own they would be window dressing mostly. They would just keep track of what "power level" the ability should be used at. The advantage of doing it like this, rather than just have the armband script check the level of the party member, is that you can let the party member pick those upgrades at levelup just like other feats, and they would have a clear indication (with proper description) of the current power level of the ability by checking the Feats screen for the character.

A simple example to illustrate way I mean:
Say you want to add three new feats, "Combat Awareness", "Combat Intuition" and "Combat Omniscience", that would be part of the same "chain", i.e. CA upgrades to CI which upgrades to CO at certain levels. They would be laid out something like this:

Combat Awareness
Granted at level: 1
Bonus: +2 to Attack
Duration: 30 sec.

Combat Intuition
Granted at level: 6
Bonus: +4 to Attack
Duration: 45 sec.

Combat Omniscience
Granted at level: 12
Bonus: +6 to Attack
Duration: 60 sec.

You add these as new feats at the end of your feat.2da file, give them their names, descriptions, icons and set at what levels they become available. Most column labels give a good idea what the column value is for. In this example, we assume the new feats were added at line 245, 246 and 247 respectively in feat.2da.

You would then create your armband (or whatever other activatable object you choose to use) like normal, which would be used to trigger the effects. The activation script in our example could look like this, keeping it simple:


void ST_RemoveOldEffects(object oTarget);

void main() {
object oTarget = GetSpellTargetObject();
effect eBonus;
float fDur;

// ST: Has Combat Omniscience feat
if (GetFeatAcquired(247, oTarget)) {
eBonus = EffectAttackIncrease(6);
fDur = 60.0;
}
// ST: Has Combat Intuition feat
else if (GetFeatAcquired(246, oTarget)) {
eBonus = EffectAttackIncrease(4);
fDur = 45.0;
}
// ST: Has Combat Awareness feat
else if (GetFeatAcquired(245, oTarget)) {
eBonus = EffectAttackIncrease(2);
fDur = 30.0;
}

if (GetIsEffectValid(eBonus)) {
// ST: If the ability is already active, remove existing effects
// before re-applying new ones.
ST_RemoveOldEffects(oTarget);

// ST: Apply the effect
effect eVis = EffectVisualEffect(9013);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonus, oTarget, fDur);
}
}

void ST_RemoveOldEffects(object oTarget) {
int nPower = GetSpellId();
if (GetHasSpellEffect(nPower, oTarget)) {
effect eEff = GetFirstEffect(oTarget);

while (GetIsEffectValid(eEff)) {
if( GetEffectSpellId(eEff) == nPower) {
RemoveEffect(oTarget, eEff);
}
eEff = GetNextEffect(oTarget);
}
}
}

This would check for the highest of the custom feats we just added that the character knows, and apply bonus effects accordingly when the armband is activated. If the character knows none of the feats, nothing happens when they activate the armband.
 Lit Ridl
06-17-2006, 2:34 AM
#6
Cool. May I use your script, Stoffe?
 darthrevanrlz
06-17-2006, 8:51 AM
#7
1 - I get a "getfeatacquired" mistake when trying to compile...

Oh, and I did add the dummy feats in feat.2da, added the Item_Use in spells.2da, edited the dialog.tlk and created item with proper script info...

I just copied/pasted your script for testing... What am I supposed to change besides the feats numbers and description?

2 - And by the way, is there any way to enter a "increase/decrease threat range and/or critical modifier? Only thing I can find to work with is items with keen and that's not of much use for a "power", eh?

Oh, and, yeah, I'm thinking "forms" modded for other classes and weapons

3 - Which leads me to another question...

Is there any way to make sure the bonus will only work when using a specific type of weapon? The tragic problem here is that feats dealing with such situations are hardcoded into the game... Couldn't find any ref with KOTOR tool on forms, or force redirection/deflection (a long shot, but, still...)

But still, I can live without that last part. I'm mostly interested in the threat range/modifier part... What would be command line if such a thing exists?

Edit: Great, now I can't even get the feat's descriptions match what I put in in the dialog.tlk although the numbers match. Am gonna check a few mods to see if modded version of said file is supposed to be in override or otherwise altered... sigh...
 stoffe
06-17-2006, 1:08 PM
#8
1 - I get a "getfeatacquired" mistake when trying to compile...


Make sure you have a nwscript.nss file for the correct game (or use the proper commandline flag to define which game to use if you use newer versions of the Fred Tetra/KotorTool variant of nwnnsscomp). That function is new in KotOR2, and thus won't be found if you try to compile the script for KotOR1.


Oh, and I did add the dummy feats in feat.2da, added the Item_Use in spells.2da, edited the dialog.tlk and created item with proper script info...

I just copied/pasted your script for testing... What am I supposed to change besides the feats numbers and description?


If you just want to test and see if it works like in the example I posted you should only need to check for the proper line number of your feats. Remember that feat.2da, like spells.2da, is indexed by line number and not rowlabel. Usually the two match, but if they don't for some reason (some versions of KotorTool liked to modify the row labels automatically, reindexing them to start at 1 instead of 0), it's the line number you need to use in the script.

Other than that, add a new spell to spells.2da and set the script in question as the impact script. Then assign the new spell to be triggered by the item property in the UTI file for the armband (or whatever other type of item you use).


2 - And by the way, is there any way to enter a "increase/decrease threat range and/or critical modifier?


No, there are no scripted effects for those things, unfortunately. Only item properties may modify the threat range or damage multiplier.


Is there any way to make sure the bonus will only work when using a specific type of weapon?


You can modify the script to only trigger if a weapon of a particular type is wielded when the ability is activated. This won't prevent the character from switching to another weapon though after the ability is activated. To prevent that too you'd have to continually check what weapon the character has equipped, and cancel the ability if they have switched to one that isn't allowed.

As an example, expanding upon the script in the original example it might look like this to make sure the ability only works while the character is wielding a light or heavy repeating blaster:



void ST_RemoveOldEffects(object oTarget, int iSpellId);
int ST_HasEquippedWeaponType(object oTarget, int iType);
void ST_EnforceWeaponRequirements(object oTarget, int iSpellId, float fTimer);

void main() {
object oTarget = GetSpellTargetObject();
effect eBonus;
float fDur;

// ST: Only allow the ability to work if the character has a type
// of repeating blaster equipped as weapon.
if (!ST_HasEquippedWeaponType(oTarget, BASE_ITEM_HEAVY_REPEATING_BLASTER)
&& !ST_HasEquippedWeaponType(oTarget, BASE_ITEM_REPEATING_BLASTER))
{
return;
}

// ST: Has Combat Omniscience feat
if (GetFeatAcquired(247, oTarget)) {
eBonus = EffectAttackIncrease(6);
fDur = 60.0;
}
// ST: Has Combat Intuition feat
else if (GetFeatAcquired(246, oTarget)) {
eBonus = EffectAttackIncrease(4);
fDur = 45.0;
}
// ST: Has Combat Awareness feat
else if (GetFeatAcquired(245, oTarget)) {
eBonus = EffectAttackIncrease(2);
fDur = 30.0;
}

if (GetIsEffectValid(eBonus)) {
// ST: If the ability is already active, remove existing effects
// before re-applying new ones.
ST_RemoveOldEffects(oTarget, GetSpellId());

// ST: Apply the effect
effect eVis = EffectVisualEffect(9013);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonus, oTarget, fDur);

// ST: Make sure the character doesn't switch to a disallowed weapon.
// If they do, cancel the effects of the ability.
ST_EnforceWeaponRequirements(oTarget, GetSpellId(), fDur);
}
}


void ST_EnforceWeaponRequirements(object oTarget, int iSpellId, float fTimer) {
if (GetIsObjectValid(oTarget) && GetHasSpellEffect(iSpellId, oTarget)) {
if (!ST_HasEquippedWeaponType(oTarget, BASE_ITEM_HEAVY_REPEATING_BLASTER)
&& !ST_HasEquippedWeaponType(oTarget, BASE_ITEM_REPEATING_BLASTER))
{
ST_RemoveOldEffects(oTarget, iSpellId);
return;
}

if (fTimer > 0.0) {
DelayCommand(1.0, ST_EnforceWeaponRequirements(oTarget, iSpellId, fTimer - 1.0));
}
}
}


int ST_HasEquippedWeaponType(object oTarget, int iType) {
object oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oTarget);
return (GetIsObjectValid(oItem) && (GetBaseItemType(oItem) == iType));
}


void ST_RemoveOldEffects(object oTarget, int iSpellId) {
if (GetHasSpellEffect(iSpellId, oTarget)) {
effect eEff = GetFirstEffect(oTarget);

while (GetIsEffectValid(eEff)) {
if( GetEffectSpellId(eEff) == iSpellId) {
RemoveEffect(oTarget, eEff);
}
eEff = GetNextEffect(oTarget);
}
}
}



Edit: Great, now I can't even get the feat's descriptions match what I put in in the dialog.tlk although the numbers match. Am gonna check a few mods to see if modded version of said file is supposed to be in override or otherwise altered... sigh...

Check that you have modified the correct dialog.tlk file this time. :p If you have, make sure you've saved it in the correct place. The dialog.tlk file must always be in the main game folder where the swkotor2.exe executable is. TLK files won't do anything if put in the override folder. If it still won't work, verify that you have specified the correct StrRef values.
 darthrevanrlz
06-17-2006, 5:20 PM
#9
Damnit.

All right, so the armband (item description's fine, did it in .uti file) works, I was able to add the buff effect on the PC-icon on bottom-left screen and I was able to insert/create ICONS for the feats without (much) trouble

Now, what of that spell line in spells.2da? I noticed an "empty" icon appears at LEVEL-UP on the power selection screen. Can't really select it or do anything but put a purely aestestical icon. Is it supposed to be there? Am I supposed to do something with it (besides adding icon and description - more on that a few lines below)? If so, can I just make it invisible/remove it altogether?

Still can't get good StrRef for spell/feat description, though. The numbers in feat.2da and spells.2a match those of the added entries in the dialogue.tlk... All I get is instead the "descriptions" from various stringrefs between 0 and 8 in the dialogue.tlk

And YES, it's in the right place. Hell, when I open it in the swkotor.exe folder, I *can clearly see* the entries I punched in at the very end... 136329-136335

The hell? Says it's the wrong values while I can't see for the life of me why they're not the real deal... Grrr...

I mean, damnit, this is just the icing on the cake, right?
---------------------

More or less unrelated questions:

What do you mean other items? You mean like stims and medpacs for human (6) PCs? I know you can use those droid grids for droids (duh, lol), so, what, do you mean something else than what I just mentioned?

Also, in the .uti file for the armband I used... I understand the 10/282 part for property list/value... But what of the CostTable/Value?

Figured that the 3 in the table was for the spells function, but what of the other?

Did some uti checking and found out 1 seems to be for stims/medpacks, 6 for offensive effect (had to check droid items), a droid/speed mod had 13... Searching the nwnnscript didn't pan out... Which .2da or script to look in?

Oh, and do those two lines even DO anything? Put them at 0/0 for a goof and it didn't seem to change a damn thing...
(Note that I only put a +1 attack feature on the armband...)
 stoffe
06-17-2006, 6:16 PM
#10
Now, what of that spell line in spells.2da? I noticed an "empty" icon appears at LEVEL-UP on the power selection screen. Can't really select it or do anything but put a purely aestestical icon.


I assume you refer to the "spell" you added to spells.2da that is fired when the armband item is activated. Make sure the usertype column for that line is set to 4. That should prevent the "power" from showing up at the list of available force powers.



Still can't get good StrRef for spell/feat description, though. The numbers in feat.2da and spells.2a match those of the added entries in the dialogue.tlk... All I get is instead the "descriptions" from various stringrefs between 0 and 8 in the dialogue.tlk


Odd. Works without any problems to add new name and description strings for me. What utility are you using to view and modify your dialog.tlk file? How does your new feat.2da line look? If you assign those StrRefs to something else (for example as name or description of your armband, just for testing) do they show properly, or does it still display the wrong text?



Also, in the .uti file for the armband I used... I understand the 10/282 part for property list/value... But what of the CostTable/Value?


Those fields are not used for all types of properties. A series of 2DA files define how the item properties function. In itempropdef.2da you have all item properties listed. In this 2DA file, you have a series of columns corresponding to those fields:
subtyperesref - This is the name of the 2DA file that subtype values correspond to. For line 10 (the "Activate Item" property) the subtype is set to "SPELLS", meaning the subtype is the line number in the spells.2da file.


costtableresref - This is the line number in the iprp_costtable.2da file that is used for this property to define its usage cost, effect magnitude or type (depending on the type of property). The iprp_costtable.2da file in turn contains the name of another 2DA file that holds the "valid range" of values. Thus, when you set a CostTable value you don't actually specify the value you want itself, but you specify the line number in that listed 2DA file of the predefined value you wish to use.

In the case of the "Activate Item" property, the costtable line used is 3, which points to the iprp_chargecost.2da file. The cost table value you set is thus how many charges will be used per activation, or how many times per day the item may be activated, from the predefined valid values llisted in that 2DA file.


param1resref - This is only used by a handful of properties needing more than one parameter value defining how it should operate. The value here refers to a line number in the iprp_paramtable.2da file which refers to the name of another 2DA file containing the valid parameter values. (This is for example used by the "Damage vs. Alignment" property, where the subtype sets the alignment (Dark/Light) affected, the costtable sets the amount of damage dealt, and the parameter sets the damage type of the bonus damage.


Properties that has either of these columns set to **** in itempropdef.2da means that this particular field is not used by the property.



Figured that the 3 in the table was for the spells function, but what of the other?
Did some uti checking and found out 1 seems to be for stims/medpacks, 6 for offensive effect (had to check droid items), a droid/speed mod had 13... Searching the nwnnscript didn't pan out... Which .2da or script to look in?


I don't understand what you mean by this. Which file, column or field are you talking about?
 darthrevanrlz
06-17-2006, 6:53 PM
#11
1 - Was able to get rid of the icon about 30 secs before I saw your post :D

2 - I'm using KotorTLK_23 to edit the tlk file... The added entries show just fine in KotorTLK and I did test the StringRef on an item. Doesn't work.

Am guessing the problem isn't with the feat2.a.... Looks just like any other line only with the new stats and the stringrefs that should be working...
A quickie: do the LABEL & CONSTANT cases have any impact on what we're doing here? I just replicated the model of all other feats... *shrugs*

3 - Muchas gracias for telling me in which .2da to look. Should (and already does) make things a lot clearer. The nwnnscript is good and all, but there's a thing or two missing... ;)

4 - And about that glorious 3/13 part of my post, your post makes it much more clearer. The 3 was from iprp_costable.2da indeed and the 13 was for the unlimited charges in the iprp_chargecost.2da...

Sorry if I seem to be asking much, but the tutorial hosted mostly dealt with regular items like weapons. Besides energy shields, in-games items don't provide much for reference.

Anyway, will dive into those .2da file for the next hour of so before tonight's big BBQ & poker game (no money involved, dear feds!!!) :D

Here's hoping someone has a theory about the .tlk crap or an idea about some way around it...

I suppose I could just build the armband without the dummy feats and just be done with it, but the concept behind those is just REALLY REALLY sweet... Would make a richer gaming experience than just building the freakin thing at the workbench :
 stoffe
06-17-2006, 7:36 PM
#12
2 - I'm using KotorTLK_23 to edit the tlk file... The added entries show just fine in KotorTLK and I did test the StringRef on an item. Doesn't work.


Hmm, I may be remembering incorrectly, but I vaguely recall someone else having problems adding new entries with KotorTLK which somehow made the dialog.tlk file look OK in KotorTLK but the game wouldn't recognize the additions.

If all else fails, try deleting your modified, potentially corrupted dialog.tlk file and restore the backup of the original file (which you did create before modifying the file I hope) and then modify it with TalkEd instead of KotorTLK and see if it does any difference at all. I used TalkEd to add entries for testing and that worked fine at least.


A quickie: do the LABEL & CONSTANT cases have any impact on what we're doing here? I just replicated the model of all other feats... *shrugs*


The columns in feat.2da? Those are not used by the actual game at all as far as I know, they are only there to make the file more human readable, and to allow the Toolset to categorize the content. You can put whatever you want there, though personally I prefer following the style of the labels on the standard rows (with the ST_ prefix I stick on all of my custom additions to make them easier to keep track of).
 darthrevanrlz
06-18-2006, 11:50 AM
#13
1 - LOL - in a tragic way of sort.

Works like a frackin' charm with TalkEd. Oh well, at least there was something viscerally satisfying in the knowledge that it wasn't me for once... :D

2 - All right, one last thing... This is one hell of a long shot, but here goes...

Is there a way to use an item (spell/feat armband) to make sure classes CAN'T use an item rather than making sure *only said class CAN use* item.

Think of it as a reverse class limitation...

For example, it would be like trying to make sure that Atton can only use the Kubaz gloves (a_glove2_20 - class limitation Scoundrel) if he DOESN'T become a Jedi.

Since the armband would have a PC-limitation, I wouldn't have to worry about prestige classes, and could worse case scenario put a restriction on only one class (the one said PC evolves into...) rather than three...

Anyway, i this "reverse class limitation" thingie even possible?

2 - Tried to look for references on how they scripted the "wookies can't wear armors/helms" feature, but that didn't pan out. There's no way to change that, is there? Probalby hardcoded deep in the game...(??)

(Oh, and that's just for the sake of testing, mind you, I don't want Hanharr wearing masks... although a wookie wearing handbands wouldn't be much of a stretch...)

Mmmm, come to think of it, it WOULD be cool to create a wookie mask or something for asthetical purposes alone :D

3 - You still haven't answered my "what other items but armbands" question a few posts backs...

4 - Stoffe, check your PMs please. Had a question on your loot plugin :D

Edit: Mmm... OR, if possible, couldn't I just say that those Force Sensitive feats CAN'T use said items... All I'd have to do is give it to Visas in feat.2da and well, no much triple-class (Sntl, Cnslr, Grdn) headache...

But then again, that is IF the reverse limitation works... And so far, I can't recall seeing a single item indicating it would :(
 stoffe
06-18-2006, 1:01 PM
#14
Is there a way to use an item (spell/feat armband) to make sure classes CAN'T use an item rather than making sure *only said class CAN use* item.


I don't think it's possible to do any reverse checking for item usability. There are only properties for requiring something, not the other way around. If it was a spell/force power you could make the check in its impact script so it'd do nothing if the requirements weren't met, but I don't think it's possible to script requirements for items. Unless you do the very ugly workaround of having a script running that continually checks the class of the character and unequips any "disallowed" items. But I would hardly recommend that approach.

If you don't want a Jedi character to use the item in question you could make the item unattractive to a Jedi character in a way that won't affect non-jedi. You could for example add a Blaster Bolt Deflection Decrease effect imposing a massive penalty on the wearer. Since non-force users can't deflect blaster bolts anyway they wouldn't be hurt by it, but it should discourage force users from using the item. :)


2 - Tried to look for references on how they scripted the "wookies can't wear armors/helms" feature, but that didn't pan out. There's no way to change that, is there? Probalby hardcoded deep in the game...


If I remember correctly this is determined by the denysubrace column in the baseitems.2da file, for each base item type. Armor and clothing base items would be set here to disallow the Wookiee subrace from using them.



4 - Stoffe, check your PMs please. Had a question on your loot plugin :D


My inbox seems to be quite devoid of any new messages, so there isn't much to check. :)
 darthrevanrlz
06-18-2006, 4:03 PM
#15
Damn.

So much for items meant ONLY for "potential Jedis" not training in the ways of the Force...

Were it not for the Juyo form, a quick way to resolve this would've been to just mess with the weaponsdischarge file. Hand-to-hand combat isn't an issue since you can't dual-wield...

The only (big) problem lies with dual-wielding with melee weapons/lightsabers...

Sigh. I can already players using a +1 attack armband on apprentices and then it'll be 6hits-flurry and 5hits PA/CS madness... :(

Guess I'll go with your (really nice) idea of putting a big BBD (25 sounds good - unless there's a cap?) handicap idea rather than appeal to player's goodwill...

But then again, the point is to diversify gameplay and NPC character development. Not much points for "forcespeed/flurry/rapidshot apprentices" fans to install such a mod.

2 - A last question before I leave you alone for most what's left of today.. (:D)

Could you active the force deflection/redirection power on an NPC with an item/armband?

I know there's no such animation, but, man, I can't help but crack up at the thought of Mandalore (I still believe Obsidian gave him such crappy gear which you CAN"T TAKE OFF) just swatting away blaster bolts with a lazy back-handing motion... And then he'd give that Arnold line from Terminator 3: "DON'T DO THAT." :D

Well, purists can think of Vader in ESB... Whatever. ;)


P.S. I KNOW I asked already, but what other items but armbands could be used for humanoids characters? BTW, thx, you have the patience of a saint. :)
 stoffe
06-18-2006, 5:58 PM
#16
Could you active the force deflection/redirection power on an NPC with an item/armband?

I know there's no such animation, but, man, I can't help but crack up at the thought of Mandalore (I still believe Obsidian gave him such crappy gear which you CAN"T TAKE OFF) just swatting away blaster bolts with a lazy back-handing motion... And then he'd give that Arnold line from Terminator 3: "DON'T DO THAT." :D


Don't think you can do it in the form of an armband. Force Deflection/Redirection are passive force powers that are always on, and not something that can be activated. There are AFAIK no scriptable effects that grant the ability to deflect blaster bolts.

You can, however, grant the Force Deflection/Redirection powers to Mandalore and they will work even though he's no force user. The game apparently only checks for the presence of those powers with no further class checks. Normally characters with no force using class are unable to use force powers, but since Deflection/Redirection are passive and not actively used they still function.

Since Mandalore uses the standard male animation supermodel like most other male humanoid beings in the game the "swat" animations are available, and he will swat blaster bolts in battle given the opportunity. From a story perspective it may be hard to justify though since, even if you wear a gauntlet made of blaster-repellant material you'd need Jedi reflexes and premonition to manage to actively block incoming projectiles. Not even battle-hardened old Mandalorians can dodge bullets. :)

While I suppose you could make an armband that grants those powers when activated, they would be granted permanently since there are only script functions for granting a new power to a character, not to remove existing powers from a character. And there are only item properties for granting Feats (and some feats won't work when added this way), not force powers, when an item is equipped.

what other items but armbands could be used for humanoids characters?


I won't claim this list is complete, but from what I can remember off the top of my head these base items can be used to activate scripts (some against a targeted hostile and some on the NPC itself):

Plot-usable items (64)
Armbands (46)
Stims (53, 54)
Medpacks (55, 94)
Droid shields (75)
Droid weapons (76)
Grenades (25, 26, 27, 28, 29, 30, 31, 32, 33, 34)
Rockets (92)

Depending on the base item type the item appear during different sections in the user interface where they can be triggered.
 darthrevanrlz
06-18-2006, 8:26 PM
#17
Wasn't exactly serious about the force deflection thingie, really. Thought the T3 reference was somewhat of a giveaway :D

Was thinking more of a battlecry thingie for the armband... Besides, I was thinking of just buffing up his armor a bit. I'll admit having Mandy deflect blaster bolts wouldn't make any sense.

Just figured that one would be good for a goof, really. :D

Still, how would that be scripted anyway?

I take it utc. modifications wouldn't do it?

Found this in nwnnscript:

// DJS-OEI 1/13/2004
// 787: Grants the target a spell without regard for prerequisites.
void GrantSpell( int nSpell, object oCreature );

Haven't really seen that line in any included source files from various mods I found so far...

What exactly has to be replaced and by what?

I take it "int nSpell is replaced by the number from spells.2da...

But how exactly do I put who's it for? Doing something to the "object oCreature" part?

Finally, in what exact script does it go? A new customized one?

Could you just type in an example with modified data?
 Lit Ridl
06-19-2006, 3:07 AM
#18
Darthrevanrlz, look up in this thread. In it's starting you will see my reply with describing of it (How do you looking through your own thread??? I don't understand.).
 darthrevanrlz
06-19-2006, 11:28 AM
#19
Darthrevanrlz, look up in this thread. In it's starting you will see my reply with describing of it (How do you looking through your own thread??? I don't understand.).

huh.

My bad.

Just been so much going on in this thread (we moved on to dummy feat trees and custom force powers, FYI) that I just moved on from the few first posts and completely forgot about it...
 darthrevanrlz
06-19-2006, 7:56 PM
#20
LOL.

1 - Just noticed something while testing a "feat-giving" armband meant for a soldier...

Is it me or are "Increase Combat/Melee Damage" for the Marauder/WPnmstr BROKEN when it comes to hand-to-hand attacks?

I mean, I never used hand-to-hand combat after getting a Prestige class, so I never noticed. Was testing an armband giving those feats to a non-jedi and... VOILA, no h-t-h bonus :D

I mean, if I'd try to replicate the feat on an armband, shouldn't that line be enough to cover the damage? Battle Med. works fine with it...

eLink1 = EffectDamageIncrease(2, DAMAGE_TYPE_UNIVERSAL/BLUDGEONNING);

(the "2" is just a random number, really... - And I suppose eLink could be switched by eBuff, but I'm more interested in the *damage type*part :))

So... Did they just never notice and screw up the feat?

2 - In Stoffe's post using the repeating blaster as an example... I can't help but noticed it is an ITEM.

What of h-t-h combat ALONE? Let's say, for the damage to work, the PC MUST not wield a weapon... Working something out with bludgeonning type obviously won't do it (although close - who uses staves anyway :D)...

Would "BASE_ITEM_INVALID" do the trick?

I just can't help but have a baaad feeling about this one, though...

P.S. I most likely will go with universal damage in the end anyway, but I'm just trying to check other (sadly enough more complicated) solutions... :D
 stoffe
06-19-2006, 9:33 PM
#21
Is it me or are "Increase Combat/Melee Damage" for the Marauder/WPnmstr BROKEN when it comes to hand-to-hand attacks?


I think those are only supposed to work with weapons. Would a Jedi Weapon Master be better at fighing without weapons than others? :)


I mean, I never used hand-to-hand combat after getting a Prestige class, so I never noticed. Was testing an armband giving those feats to a non-jedi and... VOILA, no h-t-h bonus :D


If you use the "Bonus Feat" property on equipped items, keep in mind that not all Feats will work properly when added this way. Some won't do anything unless they are permanently added to the character.



What of h-t-h combat ALONE? Let's say, for the damage to work, the PC MUST not wield a weapon... Working something out with bludgeonning type obviously won't do it (although close - who uses staves anyway :D)...
Would "BASE_ITEM_INVALID" do the trick?


If you just want to check if the character is fighting barehanded, just use a conditional like...

if (!GetIsObjectValid( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oNPC) ))

...which would return true if the character has nothing equipped in their active weapon slot.
 darthrevanrlz
06-19-2006, 10:18 PM
#22
I think those are only supposed to work with weapons. Would a Jedi Weapon Master be better at fighing without weapons than others? :)

I fully agree with ya. The in-game description doesn't. :D



If you use the "Bonus Feat" property on equipped items, keep in mind that not all Feats will work properly when added this way. Some won't do anything unless they are permanently added to the character.

Nah, I included it in the game with feat.2da. Wanted to try something with pre & post prestige Jedis. Then I let Atton (thx to the quick Peragus mod!) gain it through leveling and the effects were identical.

Oh well, I'll go back to half-heartedly rooting for the Oilers. Which seem to be a pretty lost cause by...

LOL. They just scored 10:18 PM E.T.!!!

I'm outta here. :D
 darthrevanrlz
06-22-2006, 2:52 PM
#23
Ok, a few hours till I get home, but there's always the remote chance that someone answers to that...

1 - I'm curious... Could an armband deal with more than one "dummy feats" tree? Or would the durations & effects just conflict? Just so you know, let's think of a buff tree and a "force scream-similar" tree...

2 - If I were to remove all lines concerning durations from the script, would the feat be given forever? And that would only work for an already hardcoded feat, right?

Edit: oh, and Stoffe... About your remark from two posts up (the one regarding feats not all working properly if added via items):

the dmg for other weapons worked fine. Hand-to-hand dmg just wasn't scripted/hardcoded even though in-game feat description says it should
 stoffe
06-26-2006, 3:06 PM
#24
Could an armband deal with more than one "dummy feats" tree? Or would the durations & effects just conflict?


As far as I can see that should work, you just add conditional checks for those feats to the armband impact script as well. Though if one character can know more than one series of feats its probably better to create an armband for each "feat family", since you'd have to activate both at the same time otherwise.


If I were to remove all lines concerning durations from the script, would the feat be given forever? And that would only work for an already hardcoded feat, right?


I'm not sure I understand what you mean by this. Feats are always permanently added to a character, once granted you can't remove them in-game.

If you mean you want a "feat" that you only have to activate once through the armband, and it'd then last forever (or until you manually deactivate it), you could change the effect durations from DURATION_TYPE_TEMPORARY to DURATION_TYPE_PERMANENT and remove the optional duration parameter. This wouldn't last for the rest of the game though, since some cutscenes clear effects on characters, and I think removing someone from the party does the same (don't remember for sure).
 darthrevanrlz
06-27-2006, 5:49 AM
#25
Sorry for not being clearer, I guess...

I was talking about dummy feats via armbands so I just assumed you'd assume I didn't change subject. :D

Anyway, I was just wondering what could (well, *would*) mess up the permanent duration, really.

Back-up solution was to put an insanely long duration... :D

But with that new info, it seems the two will basically have the same result anyway...

Oh well... *shrugs*
 darthrevanrlz
07-14-2006, 3:13 AM
#26
If you just want to check if the character is fighting barehanded, just use a conditional like...

if (!GetIsObjectValid( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oNPC) ))

...which would return true if the character has nothing equipped in their active weapon slot.


Mmm. Somehow I managed to *not* make it work, lol.

Tried with my own script (which worked for weapons), then gave up and tried copying/pasting/editing yours...

This is what I ended up with...

Oh, and I removed all that had to do with "ST_HasEquippedWeaponType" since it basically is of no use here...

void ST_RemoveOldEffects(object oTarget, int iSpellId);
void ST_EnforceWeaponRequirements(object oTarget, int iSpellId, float fTimer);



void main() {
object oTarget = GetSpellTargetObject();
effect eBonus;
float fDur;



// DR - This should be the hand-to-hand check...
if (!GetIsObjectValid( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oTarget)))

{
return;
}


// ST: Has Combat Omniscience feat
if (GetFeatAcquired(246, oTarget)) {
eBonus = EffectAttackIncrease(6);
fDur = 30.0;
}
// ST: Has Combat Intuition feat
else if (GetFeatAcquired(245, oTarget)) {
eBonus = EffectAttackIncrease(4);
fDur = 20.0;
}

if (GetIsEffectValid(eBonus)) {
// ST: If the ability is already active, remove existing effects
// before re-applying new ones.
ST_RemoveOldEffects(oTarget, GetSpellId());

// ST: Apply the effect
effect eVis = EffectVisualEffect(9013);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonus, oTarget, fDur);

// ST: Make sure the character doesn't switch to a disallowed weapon.
// If they do, cancel the effects of the ability.
ST_EnforceWeaponRequirements(oTarget, GetSpellId(), fDur);
}
}


void ST_EnforceWeaponRequirements(object oTarget, int iSpellId, float fTimer) {
if (GetIsObjectValid(oTarget) && GetHasSpellEffect(iSpellId, oTarget)) {
if (!GetIsObjectValid( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oTarget)))


{
ST_RemoveOldEffects(oTarget, iSpellId);
return;
}

if (fTimer > 0.0) {
DelayCommand(1.0, ST_EnforceWeaponRequirements(oTarget, iSpellId, fTimer - 1.0));
}
}
}


void ST_RemoveOldEffects(object oTarget, int iSpellId) {
if (GetHasSpellEffect(iSpellId, oTarget)) {
effect eEff = GetFirstEffect(oTarget);

while (GetIsEffectValid(eEff)) {
if( GetEffectSpellId(eEff) == iSpellId) {
RemoveEffect(oTarget, eEff);
}
eEff = GetNextEffect(oTarget);
}
}
}



Compiles just fine, but it's just not working... Won't give a bonus to *anything* :(

Made sure PC had the right feat, so it's gotta be a problem with the script.

What went wrong?

Cheers,

DRRLZ
 stoffe
07-14-2006, 7:45 AM
#27
Mmm. Somehow I managed to *not* make it work, lol.

// DR - This should be the hand-to-hand check...
if (!GetIsObjectValid( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oTarget))) {
return;
}



The effects should only be applied when fighting bare-handed, correct? If so the above quoted check does exactly the opposite. If no weapon is equipped, the script execution is aborted. Similarily in the EnforceWeaponRequirements() function, the check there removes the buffs if no weapon is equipped. Remove the negation of the conditional and it'll probably work better. :)
 darthrevanrlz
07-14-2006, 3:04 PM
#28
Works fine. Thanx a bunch.
Page: 1 of 1