Activate Item / Cast spell animation

I thought this was answered before, but I can’t find the workaround: how can we prevent the animation for casting a spell or using an item (with the “Cast a spell: activate” unique power) from being run?
I could probably override the existing ones with empty gr2 files, but that would affect every action using these animations.
I even copied/pasted the ACTIVATE_ITEM line in spells.2da, gave it a different name to be sure I’d select the right one obviously, and set the duration to 1 (ms), but still the castout animation is played. The problem is it delays everything in the script I wrote, and I can’t stop it with a ClearAllActions() statement either.

Edit: having researched some more, I found confirmation that “instantaneous” spells still need at least 3 seconds. So “FEAT”, “SPELL” and “ACTIVATE ITEM” won’t work there.

If you make the script called by a PC Tool, there is no default animation associated with using a PC Tool (or Dm Tool). I don’t know if this is what you were looking for, but that is the only way I know of off the top of my head.

Thanks for the tip, I’ll check it out later tonight.

Quite true, there is no animation if the PC uses a PC Tool feat.

However, it seems that if you want the PC to use an item, the animation still plays. I tested this by adding the PC Tool spell to iprp_spells.2da before adding Cast Spell : PC Tool to the item properties.

Is this hard-coded?

Any other way to use an item on an object without the casting animation?

(I’m aware of Den of Assassin’s animation mod, but that’s not ideal because it affects multiple spells).

@4760

This brings back some memories for me and I am not sure I fully resolved it, but … I also found this line in my spells.2da with entry: Althea_Activate_Instant_Cast that suggests I may have … but …

All entries are then either **** or 0 except Usertype = 3 and the script fired is this: alb_S3_ActItem01

void main()
{
    object oMod = GetModule();
	object oItem = GetSpellCastItem();
    object oTarget = GetSpellTargetObject();
    location lLocal = GetSpellTargetLocation();
	
	object oPC = GetItemPossessor(oItem);	
	
    // THIS ACTIVATES THE ITEM, WHICH FIRES THE ASSOCIATED SCRIPT FOR ACTIVATION
	SignalEvent(oMod, EventActivateItem(oItem, lLocal, oTarget));
	
	// SO THIS IS NOT REQUIRED.
	//AssignCommand(oPC, ExecuteScript("alb_scr_cryreson", oPC));	
}

The item that uses this property has item hook script. i.e. The item tag is/fires the script required.

So, whether I did resolve it and if this is similar to what you need, I don’t know, but it may be worth a try. I will also try to find the object this was meant for and see what happens when I use it.

UPDATE: OK, I tested one of my own items and it appears to be “instant” enough to me. I am just checking to see if I had to edit some other 2das to get this in the lists. Checked:There is also an entry in my iprp_spells.2da. In testing, the first usage appears relatively instant, but further usage can have the animation kick in. So, there may be a way to improve this if you intend to use the item more than once within quick succession. If a few seconds passes between usage, then it appears fairly “instant”. However, if it is a single use item (or one that will have a few seconds pass between usage) then it seems pretty reliable. 0.5-1.0 sec approx.

EDIT: It is as if the item usage is “instant”, but has a six second cooldown after usage. So, trying to instantly use it again before the six second cooldown and you will see the timer for the previous usage.

iprp_spells.2da

spells.2da

In toolset …

image

2 Likes

Thanks @Lance_Botelle, I’ll give it a try this week-end (RL permitting of course!)

1 Like

Can you post the line in full?

Not working for me yet, but not sure I did it right.

@Proleric

Here you go …

1718 Althea_Activate_Instant_Cast 16777403 ia_use **** S **** **** 0x01 alb_S3_ActItem01 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 0 **** **** **** **** **** **** **** **** **** **** 0 **** **** **** **** **** **** **** 3 **** 0 0 0 **** **** **** **** **** 0 **** 0 0 0

NB: Don’t forget …

  1. The iprp_spells.2da reference (1718) has to match the spells.2da ref (1718) - or line you use.
  2. The lines use custom tlk refs.
  3. The tag of the item with the property is the script it fires - with hooking enabled. (*)

(*) Or you could just direct each usage to their own ExecuteScrpt file (like I comment out above).

And recognise that the first usage is “instant” and subsequent usages are also “instant” as long as six seconds passes between each usage. i.e. I am unable to prevent the engine forcing a round between each application. It means to use an item (even if “instant”), cannot be used again “instantly” for another six seconds - although it adds it to the queue to apply “instantly” again.

My bad - didn’t notice this thread is NWN2.

@4760

Did you have the time to check if this worked OK for you yet?

Not yet, but I’ll have some time tomorrow.

1 Like

Unfortunately, it didn’t work fast enough. It did quicken the action, but there still is this short animation (which we can see in the video you posted too), and that is what I wanted to avoid.
No worries though, I found a way (instead of using an item, I added a context menu).

1 Like

@4760

Sorry, I could not find any way to make it even more “instant” in the end. If I do, I’ll let you know.