jucoking Posted January 25, 2019 Share Posted January 25, 2019 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() EndEventI'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 More sharing options...
jucoking Posted January 26, 2019 Author Share Posted January 26, 2019 I guess I should add that the error I'm getting when I try to compile is: "Activate is not a function or does not exist" I know the answer is probably very easy and only requires a quick response. I would appreciate any input. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted January 26, 2019 Share Posted January 26, 2019 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. Link to comment Share on other sites More sharing options...
jucoking Posted January 26, 2019 Author Share Posted January 26, 2019 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 More sharing options...
Evangela Posted January 26, 2019 Share Posted January 26, 2019 (edited) 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 January 26, 2019 by Rasikko Link to comment Share on other sites More sharing options...
Ghaunadaur Posted January 26, 2019 Share Posted January 26, 2019 PlayAnimation This would close the gate when activating the container (script is on the container ref) Scriptname CV2_DracOrbTrap_BossActivator extends ObjectReference ObjectReference Property ImpPortGateFortExtRef Auto Event OnActivate(ObjectReference akActionRef) ImpPortGateFortExtRef.PlayAnimation("close") EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts