Jump to content

Killing/disabling NPC in script.


antstubell

Recommended Posts

I have an Event which when [layer approaches a crying woman ghost to investigate why she is crying, 2 Death Hounds are summoned. This works perfectly but I want the ghost to dissappear when the Hounds appear. I thought simply disabling the Actor through a property would do it but seems not. here's the script.

 

Scriptname SummonTRIGscript extends ObjectReference

 

ActorBase property DHProp auto

ActorBase property NPC auto

Light property summoned auto

 

Auto State Waiting

 

Event OnTriggerEnter(ObjectReference Whodid)

 

if Whodid == Game.GetPlayer()

self.PlaceAtMe(summoned,1)

self.PlaceAtMe(DHProp,2)

Disable(NPC)

GoToState("Dormant")

endif

 

EndEvent

 

EndState

 

State Dormant

;does nothing

EndState

 

Help please?

Link to comment
Share on other sites

Disable() will not work on an ActorBase, only on a reference. Why is it necessary to make the NPC an ActorBase and not an Actor reference?

It isn't. The script was set up for summoning an Actor(s) that is not in the render window so I simply reproduced the line ActorBase for NPC, I am still learning. Because NPC is in the render window I can make an Actor Property and "Choose Target in Render WIndow". Thanks for your help, another lesson learned. Oh yeah...it works now.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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