Jump to content

magiceffect not appearing to start


Recommended Posts

here is a funciton called by an MCM hotkey:

Function dz_essential_key()
debug.trace("DF4LT: dz_essential_key called")               ;is the key pressed the essential hotkey?
  debug.trace("DF4LT: key down, second press is "+secondpress)
  If secondpress == False && !Utility.IsInMenuMode()
   dz_essential_toggle()
  ElseIf secondpress == True
   dz_setessential()
  EndIf
EndFunction

here is the funcion dz_essential_toggle() called by that function:

 

 

Function dz_essential_toggle()
debug.trace("DF4LT: essential toggle called")
;Actor NPCRef = Game.GetCurrentCrosshairRef() as Actor        ;the actor under the crosshair
  Actor NPCRef = dz_get_crosshair_actor()
  If !NPCRef
   debug.messagebox("There is no NPC under the crosshair")
   Return
  EndIf
String actorname = NPCRef.GetDisplayName()           ;the actor's name
debug.trace("DF4LT: NPC is "+actorname)
ess_bool = NPCRef.IsEssential()              ;is the actor essential?
Bool prot_bool = NPCRef.GetActorBase().IsProtected()        ;is the actor protected?
String ess_status                 ;message about essentual status
String prot_status                 ;message about protected status
  If ess_bool == True
  ess_status = "essential"
  Else
  ess_status = "non-essential"
  EndIf  If prot_bool == True
  prot_status = "protected"
  Else
  prot_status = "not protected"
  EndIf
  ;String msg = "$status_msg"
  String msg = "press the key again within five seconds  to change the essential status."
  debug.messagebox(actorname+ " is "+ess_status+ "\n and "+prot_status+" \n"+msg)
  secondpress = True                ;while this is true a second press is diverted to dz_setessential() function
  ;debug.notification("secondpress is "+secondpress)
  Utility.WaitMenumode(5.0)
  secondpress = False                ;now that 5 seconds are up, a second press no longer runs the dz_setessential() function
  ;debug.notification("secondpress is "+secondpress)
  ;  Int ActKey = Input.GetMappedKey("Activate")
  ;  Input.TapKey(ActKey)               ;Send 'Enter' to close messagebox
  ConsoleUtil.ExecuteCommand("HideMenu MessageBoxMenu")
EndFunction

 

 

here is the function dz_get_crosshair_actor():

Actor Function dz_get_crosshair_actor()
  debug.trace("DF4LT: casting crosshair actor spell...")
  dz_get_crosshair_actor_spell.Cast(PlayerRef)         
  Utility.Wait(0.2)
  debug.trace("DF4LT: crosshair_actor is "+crosshair_actor)
  Return crosshair_actor
EndFunction

here is the magiceffect script for the spell dz_get_crosshair_actor_spell:

 

 

Scriptname dz_get_crosshair_actor_effect_script Extends ActiveMagicEffect
;;;this script adapted from my Skyrim Auto Outfits mod;;;
dz_F4_little_things_quest_script Property scriptRef Auto        ;this line fills the scriptRef property with the script that has the actor property you wish to fill
;EffectShader Property AbsorbGreenFXS   Auto        ;green aura for later

Event OnEffectStart(Actor Target, Actor Caster)
debug.trace("DF4LT: crosshair actor spell effect started")
debug.trace("DF4LT: crosshair actor spell  target is "+target)
;AbsorbGreenFXS.Play(Target)               ;place green aura around the target
;scriptRef.crosshair_actor = Target             ;this line fills the actor property in the script of your choice, edit the scriptRef property above to suit
EndEventEvent OnEffectFinish(Actor Target, Actor Caster)
debug.trace("DF4LT: crosshair actor spell effect finished")
;AbsorbGreenFXS.Stop(Target)
EndEvent

 


now here is my papyrus.log.0:

[08/23/2022 - 09:40:52PM] DF4LT: dz_essential_key called
[08/23/2022 - 09:40:52PM] DF4LT: key down, second press is False
[08/23/2022 - 09:40:52PM] DF4LT: essential toggle called
[08/23/2022 - 09:40:52PM] DF4LT: casting crosshair actor spell...
[08/23/2022 - 09:40:52PM] DF4LT: crosshair_actor is None

 

it can be seen that the debug trace messages from the key being pressed are there:

[08/23/2022 - 09:40:52PM] DF4LT: dz_essential_key called
[08/23/2022 - 09:40:52PM] DF4LT: key down, second press is False

 

the debug trace messages from the dz_essential_toggle functin being called:

[08/23/2022 - 09:40:52PM] DF4LT: essential toggle called

 

and the debug trace messages from dz_get_crosshair_actor being called are there:

[08/23/2022 - 09:40:52PM] DF4LT: casting crosshair actor spell...
[08/23/2022 - 09:40:52PM] DF4LT: crosshair_actor is None

 

yet there is no sign of the magiceffect itself actually starting e.g. "DF4LT: crosshair actor spell effect started"

The magic effect is attached to the spell, properties are set in the ck and I can see no errors.

This is all based on a setup I used in a Skyrim mod so I'm wondering if there is something very different about magic effects and spells F4?

 

diziet

 

 

Link to comment
Share on other sites

It could be that you're just setting things up differently than me with folders and whatnot but I tend to forget the namespace from time to time when creating a ScriptObject property.

 

I'll write:

TheScriptToAddress Property scrpt Auto

 

But what I'll need is actually:
ProjectFolderName:TheScriptToAddress Property scrpt Auto

 

Could that be it?

Link to comment
Share on other sites

Lets assume you haven't made a silly mistake and didn't face errors in papyrus logs

 

Use https://www.creationkit.com/fallout4/index.php?title=Magic_Effect as a reference for magic effect defining

What is the Delivery value?

Do you have any Target Conditions defined for magic effect?

What are Effect Archetype and Casting Type?

What flags are set?

 

Use https://www.creationkit.com/fallout4/index.php?title=Spell as a reference for Spell defining

What is the Type of spell?

Do you have any Conditions for Magic Effect you added to the Spell?

Edited by DlinnyLag
Link to comment
Share on other sites

  • Recently Browsing   0 members

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