Jump to content

[LE] Scripts to Activate Objects


jucoking

Recommended Posts

So I have been trying to research how to activate objects such as the ImpPortGateFortExt (a door-like gate that, when activated, shoots up poles to block entry/exit).

 

However, the "activate" script does not work. Here is an example of what I'm trying to accomplish:

Scriptname CV2_DracOrbTrap_BossActivator extends ObjectReference  

Activator Property ImpPortGateFortExt Auto

Event SomeEvent    ;in my case, I'm using a container and once the container is accessed, the gate is supposed to close and trap the player

ImpPortGateFortExt.Activate()

EndEvent

I'm having the same problem with the "PlayAnimation" script, which doesn't compile as well. If anyone can point me in the right direction I would appreciate it. I think I need to define a function for both but I can't find any info on it. Thanks in advance.

Link to comment
Share on other sites

It should be ObjectReference Propery which points to the reference of the gate in the world.

 

And yes, PlayAnimation is the right function to use here.

Could you show me an example of the function? I'm having trouble finding examples on how to define it.

Link to comment
Share on other sites

Here is a vanilla example:

scriptName defaultButtonSCRIPT extends ObjectReference
{quick script for a button object.}

bool property useOnce = FALSE auto
{Can be used only once? Default: FALSE}

auto STATE active
     EVENT OnActivate(ObjectReference actronaut)
          ;playAnimationandWait("down")
          PlayAnimation("down")
          gotoState("inactive")
          Activate(self as ObjectReference)
          PlayAnimation("up")
          gotoState("active")
     endEVENT
endSTATE

STATE inactive
     ; do nothing in this state
endSTATE

int Property TriggerType  Auto 

This script is ON the activator, btw. (casting here is not necessary)

Edited by Rasikko
Link to comment
Share on other sites

  • Recently Browsing   0 members

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