Jump to content

Referencing whatever enters trigger?


ashtonlp101

Recommended Posts

So I'm trying to make a script that pushes whatever NPC/creature that enters it but I need a way to reference said actor. So, is there a way to assign whatever enters this trigger to a reference within the script? Essentially what I'm asking is:

 

PushactorAway Ref 5; How would I assign whoever enters the trigger to this ref?

 

I don't think GetSelf would work because then it's be telling the trigger to push itself, so I can't think of anything else.

Link to comment
Share on other sites

"Push" is a reaction. What is your "trigger event"? Sounds like perhaps a "collision box" or "Activator"? Then the "event" (such as "OnActivate") will usually tell you who triggered it ( IsActionRef or GetActionRef inside the OnActivate block). Capture that ref in the event script before calling your "PushActorAway" function.

 

-Dubious-

Link to comment
Share on other sites

Okay so my problem still remains because this is only working on the player but not on any of the NPCs that walk into the trigger:

 

Ref Person
Begin OnTriggerEnter player
GetActionRef
Set Person To GetActionRef
playsound NVDLC04WPNEdeArcFire3D
DamageAV Health 10
PushActorAway Person 5
END
Link to comment
Share on other sites

That is because your "Begin" block says "Player" (which is an optional parameter). Leave off the parameter: "Begin OnTriggerEnter" only; so "the block is run when any ref enters the trigger box." Read the description carefully, and also 'TIP Block Types Multiple vs Single Frame processing' under the "Scripting" section of the wiki "Getting started creating mods using GECK" article.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

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