Jump to content

[LE] Quick Questions, Quick Answers


Recommended Posts

Any suggestions on how to go about deleting an actor that was created at run time via placeatme? I know storing the actor to a variable and then calling disable/delete on that variable will do the trick, but the problem is I need to shut the quest down. Making another quest with an actor property and storing him there will make him persistent. Really wish variables can be accessed by outside scripts.

 

Here's my function:

 

 

Actor Function CreateAliasCopy(ReferenceAlias akAliasToCopy)
    Actor kOrigAlias = akAliasToCopy.GetReference() as Actor
    if kOrigAlias != none
        Actor CopyActor = kOrigAlias.PlaceAtMe(kOrigAlias.GetActorBase()) as Actor
        SetCurrentStageID(10) ; shuts this quest down
        return CopyActor
    else
        SetCurrentStageID(10)
        return none
    endif
EndFunction
Link to comment
Share on other sites

 

Any suggestions on how to go about deleting an actor that was created at run time via placeatme? I know storing the actor to a variable and then calling disable/delete on that variable will do the trick, but the problem is I need to shut the quest down. Making another quest with an actor property and storing him there will make him persistent. Really wish variables can be accessed by outside scripts.

 

Here's my function:

Actor Function CreateAliasCopy(ReferenceAlias akAliasToCopy)
    Actor kOrigAlias = akAliasToCopy.GetReference() as Actor
    if kOrigAlias != none
        Actor CopyActor = kOrigAlias.PlaceAtMe(kOrigAlias.GetActorBase()) as Actor
        SetCurrentStageID(10) ; shuts this quest down
        return CopyActor
    else
        SetCurrentStageID(10)
        return none
    endif
EndFunction

Couldn't you just run your function from another quest that doesn't need to be shut down?

 

In your second quest, set this up:

ReferenceAlias property AliasToCopy auto

myFirstQuestScriptName property refScript auto      ;fill this property with your quest in the CK editor
 
;...
actor myCopyActor = refScript.CreateAliasCopy(AliasToCopy)

; then delete it when you want from here
myCopyActor.Disable()
myCopyActor.Delete()
Edited by wormple12
Link to comment
Share on other sites

 

 

Any suggestions on how to go about deleting an actor that was created at run time via placeatme? I know storing the actor to a variable and then calling disable/delete on that variable will do the trick, but the problem is I need to shut the quest down. Making another quest with an actor property and storing him there will make him persistent. Really wish variables can be accessed by outside scripts.

 

Here's my function:

Actor Function CreateAliasCopy(ReferenceAlias akAliasToCopy)
    Actor kOrigAlias = akAliasToCopy.GetReference() as Actor
    if kOrigAlias != none
        Actor CopyActor = kOrigAlias.PlaceAtMe(kOrigAlias.GetActorBase()) as Actor
        SetCurrentStageID(10) ; shuts this quest down
        return CopyActor
    else
        SetCurrentStageID(10)
        return none
    endif
EndFunction

Couldn't you just run your function from another quest that doesn't need to be shut down?

 

In your second quest, set this up:

ReferenceAlias property AliasToCopy auto

myFirstQuestScriptName property refScript auto      ;fill this property with your quest in the CK editor
 
;...
actor myCopyActor = refScript.CreateAliasCopy(AliasToCopy)

; then delete it when you want from here
myCopyActor.Disable()
myCopyActor.Delete()

Yeah I changed things around to do just that, but thanks anyhow. :)

Link to comment
Share on other sites

I am looking for the right event to use to detect when lighting bolt hits an enemy. I have no idea what it is...

 

Is the script attached to the lightning bolt, or to the enemy? If it's part of the bolt's ActiveMagicEffect script, use OnEffectStart. If it's on the enemy, OnMagicEffectApply or OnHit.

Edited by foamyesque
Link to comment
Share on other sites

Hello, just starting tweaking some aspects here, can someone tell me what makes NPCs cast InvisibilityVampiric when fleeing from combat. Is this behavior and spell controlled by a script? I want, for example my follower to cast specific spells to counter attack when fleeing. Do I need to learn scripting for this? Thanks in advance.

Link to comment
Share on other sites

 

I am looking for the right event to use to detect when lighting bolt hits an enemy. I have no idea what it is...

 

Is the script attached to the lightning bolt, or to the enemy? If it's part of the bolt's ActiveMagicEffect script, use OnEffectStart. If it's on the enemy, OnMagicEffectApply or OnHit.

 

It's attached to the lightning bolt, oneffectstart does not work.

Link to comment
Share on other sites

I'm trying to make a magic effect add an instance of a misc item to the player and prevent the player from removing that item from his inventory.

 

The only way that I could think of was forcing the item into an alias with Quest Object ticked but this doesn't seem to work:

Event OnEffectFinish(Actor akTarget, Actor akCaster)

    myQItemAlias.ForceRefTo(akCaster.AddItem(Figure, 1))

EndEvent

The item is added to the player's inventory but it can still be dropped of some reason. Anything wrong with this script? Or does anyone have another idea?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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