PDA

View Full Version : Help with wrist launcher and new grenades


Karstedt
08-18-2006, 07:20 PM
I've created a bunch of grenades and have them working fine and dandy, but can't get the wrist launcher to "launch" them; Mira does the whole launch animation, but the grenades get lobbed like they are thrown.

It looks like the normal grenades all have additional entries in spells.2da (lines 246-256) for when they are used with the launcher (so I made additional entries for my new grenades as well with the proper changes); but I can't figure out what is making the regular grenades use the alternate entry in spells.2da so I can make my new grenades do the same thing.

I looked through the k_inc_gensupport script and found some stuff relating to the wrist launcher, but nothing referenced the alternate (lines 246-256) entries in spells.2da.

What am I missing?

Darkkender
08-19-2006, 12:35 AM
When you created your spells.2da entries for your grenades did you copy a wrist launcher rocket entry or a grenade entry?

Also for the baseitem are you using a reference to a wrist launcher item or are you using a grenade entry from baseitems.2da?

Finally for the effect script did you copy a grenade script or a wrist launcher script? I don't believe this one would matter though.

I believe your culprit likely resides in the baseitems.2da file though as I believe that has the firing animations linked in there.

Karstedt
08-19-2006, 12:01 PM
Example:

1) I created a "Thermal Detonator Mark II".
2) It uses the same (as in not a copy) baseitems.2da entry as the regular Thermal Detonator.
3) It has a copy of the Thermal Detonator line in spells.2da associated with it. The only change to that copy is to change the onimpact script.
4) The new script is essentially cut an paste from the original grenade script, with only the spell identifiers and effects changed.
5) The new .uti is a copy of an existing Thermal Detonator with only the cost, tag, and spell reference changed.

Now, if Mira launches a regular Thermal Detonator, it will travel in a straight line and more or less home-in on it's target. If Mira launches one of my Thermal Detonator Mark II's, she goes through the launching animation, but the grenade is lobbed like it had been thrown.

Aditionally, there are two entries for each grenade in spells.2da (87-95 and again at 246-256). The second set being for the "launched" variety. These line references are reffered to in pairs in the original grenade script to create the same effects regardless of which line is used.

My paranoid little mind has imagined that there is a script somewhere, that when a regular grenade is launched via the wrist launcher, it alters it's spell effect id to the alternate entry (as those extra spells.2da entries have changed the "projtype" colum to "homing" for the launched variety of grenades).

As a final clarification, I'm not referring to the actualy darts/rockets through any of this. If you've never "thrown" a regular grenade with Mira (and who could blame you), she not only uses her wrist launcher animation, but the actual grenade travels like a rocket instead of a lobbed grenade. This is the effect I'm trying to reproduce on my additional grenades (without having people without a wrist launcher throw homing grenades too of course).

deathdisco
08-21-2006, 03:18 AM
Maybe Mira's model is the only one that has that animation. :giveup:

stoffe
08-21-2006, 06:21 AM
Maybe Mira's model is the only one that has that animation. :giveup:

The "launch rocket" animation seems to be part of the standard animation set since you can give a wrist launcher to any humanoid using the standard supermodel and they'll aim with their arm when they use rockets and grenades.

* * *

As far as I can tell the functioning of the wrist launcher is not scripted, but coded into the game engine directly. I suspect they have some checks there like "If the spell id is this and the character has an item of the WristLauncher baseitem type equipped, switch the spell id to this instead".

Meaning they've probably hardcoded the spell IDs used for grenades and rockets into the handling of the wrist launcher. A bit sloppy since it would have been more practical to make a 2DA with a "spell id conversion table", but since TSL wasn't meant to be modded to begin with perhaps they took the easier route. Wouldn't be the first time they hardcoded behavior relating to specific indexes in spells.2da if that's in fact how it works (*cough* Inspire Followers/Crush Opposition *cough*). :)

Karstedt
08-21-2006, 08:12 PM
Meaning they've probably hardcoded the spell IDs used for grenades and rockets into the handling of the wrist launcher.

That's what I'm afraid of. I'm going to keep digging though. If I figure anything out I'll post an update.