Jump to content

Static Objects and Activators


MadTod

Recommended Posts

Quick question:

 

How do I make a static object appear and disappear using an activator?

 

Any help would be very much appreciated, thanks.

Link to comment
Share on other sites

By attaching a script the static reference in the render window, and having an activator call disable/enable on it.

 

Put this script on the static reference:

Scriptname StaticEnableStateScript extends Objectrefence
 
Activator property myActivator auto
 
AUTO STATE DisablePhase
Event OnActivate(Objectrefence akActionRef)
 
      if akActionRef == myActivator
          self.Disable()
          gotoState("EnablePhase")
      endif
EndEvent
ENDSTATE
 
STATE EnablePhase
Event OnActivate(Objectrefence akActionRef)
 
      if akActionRef == myActivator
          self.Enable()
          gotoState("DisablePhase")
      endif
EndEvent
ENDSTATE
Edited by Terra Nova
Link to comment
Share on other sites

The Script keeps failing, I copied it to the letter.

 

It says "cannot compare a objectreference to a activator" on lines 8,15 and 17,15 which in my case are:

 

if akActionRef == THESilverPlatter01Activator

 

What do I do?

Link to comment
Share on other sites

There's already a script in the CK that can toggle objects on and off. I've used it with lights, candles, water, and sounds before. it's called defaultactivatetogglelinkedref. You add that script to your activator and then in the Linked Ref tab, you choose the object you're turning and off.

Link to comment
Share on other sites

That works thanks, though I can't seem to link more than one object, I'm planning on linking lots objects.

 

Solved it, I linked the activator to an XMarker and then made that the Parent of the objects I want to toggle.

Edited by TanisDuncan
Link to comment
Share on other sites

  • Recently Browsing   0 members

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