PDA

View Full Version : Armband Flamethrower successfully created


tk102
03-26-2004, 02:44 AM
There's been a lot of discussion about adding spells to items and making flamethrowers and what not recently. I created an armband flamethrower which works, though I haven't been able to perfect the animation.
Screenshot (http://webpages.charter.net/krumsick/kotor/flame_on.jpg)

The problem that we ran into on this thread (http://www.lucasforums.com/showthread.php?s=&threadid=124657) was the hostile indicator would not give the option using the item or would not invoke the spell correctly. So I decided to model this item from an armband (specifically, Echani Shield) so no targeting is involved: the nearest enemy gets burned.

Here is a summary of how I built the flamethrower:
1) In Kotor Tool, opened up g_i_frarmbnds04 and extracted it to the Override directory, saving it as g_i_frarmbnds22.

2) Open up g_i_frarmbnds22 in GFF Editor, changing Tag and TemplateResRef to g_i_frmarmbnds22. In PropertiesList - SubType changed this field to 132. In LocalizedName, entered 'TK Flamethrower'.

3) In Kotor Tool, opened up spells.2da. Copied row #102 (Echani Shield) to a new row (#132 -- same as referenced in PropertiesList - Subtype above).

4) In Kotor Tool, extracted k_sup_bands.nss from Bifs->Templates->Scripts.

5) Modified k_sup_bands.nss by adding the following elseif statement. (I stole pieces from k_inc_force.nss and got help using NWN Lexicon (http://www.nwnlexicon.com) reference.)

right after this part

else if(nIndex == 115)
{
nShield = SHIELD_DROID_ENVIRO_3;
nIcon = 54;
}

add this
else if(nIndex == 132)
{
int nDamage=60;
int nDC=20;
object oSelf=GetSpellTargetObject();
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 17.0, GetLocation(oSelf), FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE);
while (GetIsObjectValid(oTarget)) {
if (GetIsEnemy(oTarget)) {
break;
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, 17.0, GetLocation(oSelf), FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE);
}
if (GetIsObjectValid(oTarget)) {
effect eBeam = EffectBeam(2053, OBJECT_SELF, BODY_NODE_HAND); //Flame Thrower
effect eVFX = EffectVisualEffect(1039);
effect eBump = EffectVisualEffect(2062);
effect eHorror = EffectHorrified();
effect eDam;
eHorror = SetEffectIcon(eHorror, 57);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, 1.0);
if(GetHitDice(oTarget) < 7 || FortitudeSave(oTarget, 15) == FALSE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHorror, oTarget, 3.0);
}
DelayCommand(0.33, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBump, oTarget, 1.5));
if(ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_FIRE))
{
nDamage /= 2;
}
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
return ;

}


I hated having to modify spells.2da, but I couldn't think of another way to break into k_sup_bands.nss effectively.

Anyway, armbands are pretty convenient for tucking in scripts. I think the old schools modders like Andaragor did this to invoke mods (Emporium mod I think).

Not sure at this point how to make a weapon behave similarly.

Jackel
03-26-2004, 04:39 AM
looks good tk, and proberly the best we can do till we can get some info from bioware on how to make a real flamethrowing weapon


like thats going to happen though

tk102
03-26-2004, 04:53 AM
Unfortunately, the scripts handling force powers and other spells are pretty narrowly defined. So this level of script customization and recompiling is required to perform what should be an otherwise simple task. Bioware is probably happy that they don't have to support modding.

Panglicar
03-26-2004, 06:20 AM
does it have unlimited uses ? :D
will you publish the files pls ? :D

Weiser_Cain
03-26-2004, 06:41 AM
Hmm, I can't tell from the shot, does it have an animation or does the flame just come from nowhere?

T7nowhere
03-26-2004, 06:43 AM
Originally posted by tk102
Bioware is probably happy that they don't have to support modding.

This is what I have been thinking since I started to dig into KotOR
:D

Nice work with the mod. Just a thought have you tried to use the flamethower without any weapons in your characters hands. It's most be likely that only HK-47 has the anim for the flame thower. I am curiouse with what you have changed if any thing in spells.2da besides adding a new spell. You could try to change column range from T to M(may do nothing)

Commas
03-26-2004, 08:21 AM
so, since there was no file posted i tried doing this myself, and i cut and pasted your script just like you said, and evertyime i tried to compile it, it told me there were numerous errors and wouldn't do it, so if someone could please please just post the files needed, thanks

also, what i tried to do was make it so instead of the flamethrower, its the carbonite ray, since i can't seem to make any of my scripts compile, i couldnt test this or the flamethrower, but basically i just cut and pasted stuff from k_sup_droid into the script you posted into where it looked like it fit, so if someone could let me know if this right, cause i've never done scripts, i dont understand them at all, and i dont know if this could possible even work.
this is the script:


else if(nIndex == 132)
{
int nDamage=60;
int nDC=20;
object oSelf=GetSpellTargetObject();
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 17.0, GetLocation(oSelf), FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE);
while (GetIsObjectValid(oTarget)) {
if (GetIsEnemy(oTarget)) {
break;
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, 17.0, GetLocation(oSelf), FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE);
}
if (GetIsObjectValid(oTarget)) {
effect eBeam = EffectBeam(2051, OBJECT_SELF, BODY_NODE_HAND); //Carbonite Ray
effect eIce = EffectVisualEffect(2055); //Ice chunks
effect eSolid = EffectVisualEffect(2054); //Ice Bumpout
effect eStuck;
if(GetRacialType(oTarget) != RACIAL_TYPE_DROID)
{
eStuck = EffectParalyze();
}
else
{
eStuck = EffectDroidStun();
}
eStuck = SetEffectIcon(eStuck, 59);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, 1.0);
if(ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_COLD))
{
nDamage /= 2;
fDuration = fDuration - 6.0;nDamage /= 2;
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSolid, oTarget, fDuration);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eIce, oTarget, fDuration);
eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStuck, oTarget, fDuration);
}
return ;

}


so yeah, dont know if it will work, probably not since i cant even compile it this way, but then again, i couldn't complie your script either. please keep in mind i have no freaking clue how scripts work or how to write them. i really want to be able to add this spell to the lightsaber i built, as its the last step before its finnished

tk102
03-26-2004, 03:02 PM
Panglicar:
As created, the armband only has 5 charges. You can easily make it unlimited by editing g_i_frarmbnds22.uti with Kotor Tool or GFF Editor.

Weiser Cain, T7Nowhere:
The animation is what you'd expect -- 'activation of an armband' -- not the outstretched palm. I tried playing around with the k_sup_bands.nss script, changing the part that says BODY_NODE_HAND to BODY_NODE_CHEST and BODY_NODE_HEAD but that just looked more weird.

Commas, Panglicar:
You can download the files from here: Flamethrower files (http://webpages.charter.net/krumsick/kotor/flame.zip)
I wasn't planning on publishing the files, but rather incite others to follow the instructions laid out in this thread. I hope that others will be able to improve this type of mod.

Darth333
03-26-2004, 07:59 PM
Nice work. But looks dangerous! Now we will need fireproof jedi robes :D

shosey
03-26-2004, 11:48 PM
looks awesome, going to try it out tonight when I get home :)

shosey
03-26-2004, 11:50 PM
oh by the way, why are there rodians in the desert?? I"ve never seen this.

tk102
03-26-2004, 11:54 PM
That's Jagi and his gang -- Canderous's side quest

Commas
03-27-2004, 12:49 AM
i understand you reason tk, i just couldn't get it to work, and i tried it like, three times, with no luck everytime, but now that i have files that work ima try to make the other droid spells work in the same fasion, thanks

Panglicar
03-29-2004, 04:56 AM
thanx tk102 :cool: