Jump to content

[Papyrus] Casting Spell on Target NPC programmablly not working issue


coldloc

Recommended Posts

Posted

we know there are ways to do a spell casting on target actor ( player or npc )  apart from the manual way. 

 

via console :

https://www.creationkit.com/index.php?title=Cast

or via papyrus script 

https://www.creationkit.com/index.php?title=Cast_-_Spell

 

 

The Question of this thread is related with a specific mod ( Skyrim Flying Mod ] source attached,  in which there are Two major spells 

one named 

          Spell AAflyingspell = Game.GetFormFromFile( 0x000d68, "P1FlyingRing.esp") as Spell

the other named 

         Spell AAFlyingSpellCompanion = Game.GetFormFromFile( 0x007ea4, "P1FlyingRing.esp") as Spell

( these returned form values are all valid , not None Exception)

 

Question here is ,  

It's able to see the Player turn into flying effect once the 

AAflyingspell.Cast( Player )

gets fired.

 

yet the similar ways won't work for the AAFlyingSpellCompanion

                AAFlyingSpellCompanion.Cast( NPC_ActorRef , Player ) ; not working 
                Player.DoCombatSpellApply( AAFlyingSpellCompanion , NPC_ActorRef ) ; not working
                AAflyingspell.Cast( NPC_ActorRef ) ; not working 

here is a link of the spell AAFlyingSpellCompanion in 0'14'' of the youtube_link video. ( Manually Aimed in the Video which is relatively painful for User Experience  ) 

The Goal is very simple,  Programmablly Trigger the  NPC_ActorRef  to Fly Follow Player as Companion ( which is the main effect of the spell AAFlyingSpellCompanion )  

 

Wondering if anyone here can share some lights on the issue here based on the scripts attached ?  ( the same with the original nexus page source )

 

 

thanks. 

 

 

 

================================================================================================

Part II 

the Console Approach 

image.png.4613b3d44656889169cd3293a7b8babd.png

From xEdit, the live loaded Spell ID is  69007EA4 

 

 

To emulate a spell cast in the Console command syntax can be 

Player.Cast 9007Ea4 [NPC_ActorRef] Voice

It's will only work when player in casting mod , and the crosshairRef is pointing at the NPC Actor. 

so Question becomes  how to convert the above console command into the papryus script the right way

without manually targeting the crosshairRef at the NPC Actor  ? 

 

 

Reference screenshot:

image.png.2f9b742101865f645964ad744c8ad47b.png

Aimed: Effect is attached to a Projectile which is then fired at the crosshairs. If it makes contact with a valid target, the effect is applied.

image.png.1430d3f4a19a09c900cb1806836a9fdb.png

 

 

 

 

 

 

 

Debug_SourceFile.7z

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...