Jump to content

[Scripting] StealthBoy Effect help - Fo4 equivalent to FNV functions


Recommended Posts

What is the equivalent of FNV's "begin gamemode" in Fallout 4? And how can I activate a function when an NPC is attacking. I'm working on stealth effect and I'd like to remove the stealthboy effect when the said actor is attacking. In Fallout New Vegas it used to be like that.

if GetAnimAction == 2 && Cloaked == 1
    RemoveSpell StealthBoyInvisibilitySpell
    set Cloaked to 0
    PMS NightkinCloakFXShader 1
    if soundcheck == 0
    refvar.PlaySound3D OBJStealthBoyActivate
    set soundcheck to 1
    endif
endif

Thanks.

 

EDIT: I managed to make it work. There was no reason to create a script but I needed to play with [spells] and manage specific conditions for spell's magic effects. Looks like I really need to forget about doing everything with script and use every tool of the Creation Kit. Thanks Elsidia1 for the help!

Edited by Stowx
Link to comment
Share on other sites

I don't understand question clearly but you try a event on hit?

 

When actor is hit event on hit is activated.

 

Event OnPlayerLoadGame()
RegisterForHitEvent(game.getplayer()) ; there you can put npc reference in ()
EndEvent

 

Event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial)
; need to register it again. Stupid, but necessary.
RegisterForHitEvent(game.getPlayer()) ; the same for NPC

endevent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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