I need a switched object that stays on please

Post » Mon Nov 19, 2012 10:53 am

I need something like a self keeping relay. I'm working on my second lighting mod for the Hearthfire player homes, and I've tied my lights to the starting mesh of the foundation because that's the order I'd build the lights if it were a real building site. But after the player chooses the rest of the parts of the house, the foundation gets cleared and a whole house model takes its place.
Then the lights disappear with the foundation.

I thought I'd get sneaky so I tied the lights to the finished model so the lights would wait until the home was built. All went well until I finished the rest of the home. After the mail hall gets connected the small finished model disappears too and gets replaced by another model. GRRRR Then the lights disappear again.

What I'm looking to do is have an object I can attach the lights to, that would be triggered by an object, then stay triggered for its lifetime, so from house pegs on, no matter what happens, the lights will still stay visible.

Any help would be great.

Edit: I'm looking at the xMarkerActivator, but I don't see a way to trigger it. Maybe by using a script?
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Post » Mon Nov 19, 2012 3:46 pm

I think your solution is going to lie in using Linked References (tying your light objects back to a single activator reference) and then enabling that reference (activator) with a script.

XMarkers are usually just invisible meshes that cannot be ordinarily interacted with, so you'll need a script that triggers it upon some event.
User avatar
FirDaus LOVe farhana
 
Posts: 3369
Joined: Thu Sep 13, 2007 3:42 am

Post » Mon Nov 19, 2012 6:07 pm

I've tried getting even a hello world out of a script and nothing seems to work. The script below I put into the Scripts part of the XMarkerActivator. I know it's activating because I have a pole being triggered from it.
I figured I'd add a if triggered then lock part.

Scriptname SwitchOutdoorLights extends ObjectReference
{Turn on the outdoor lights surrounding the house.}

vvvvvvvvvvv this works but the others do not
Event OnInit()
Debug.Notification("Hello2, World!")
EndEvent


Event OnActivate(ObjectReference akActionRef)
Debug.Notification("Hello, World!")
EndEvent


Event OnTriggerEnter(ObjectReference akActionRef)
Debug.Notification("Hello, World!")
EndEvent
User avatar
Kayla Oatney
 
Posts: 3472
Joined: Sat Jan 20, 2007 9:02 pm

Post » Mon Nov 19, 2012 6:18 pm

If I had to use this for my job I'd go crazy, but I like it.
User avatar
Emerald Dreams
 
Posts: 3376
Joined: Sun Jan 07, 2007 2:52 pm

Post » Mon Nov 19, 2012 4:09 pm

I have a pole being triggered from it.


What pole are you talking about? Triggered how?

Anyway, you probably wouldn't have an OnActivate event and an OnTriggerEnter event on the same object, because that's two very different activation methods. What exactly /is/ the thing that this script is attached to, and by what mechanism is the player activating it?
User avatar
u gone see
 
Posts: 3388
Joined: Tue Oct 02, 2007 2:53 pm

Post » Mon Nov 19, 2012 3:47 pm

[/color]

What pole are you talking about? Triggered how?

Anyway, you probably wouldn't have an OnActivate event and an OnTriggerEnter event on the same object, because that's two very different activation methods. What exactly /is/ the thing that this script is attached to, and by what mechanism is the player activating it?

I have a light pole, a lantern, and a bulb, that have an Enable Parent Tab set to the mesh. When the mesh is activated, or set to visible, then the pole object gets enabled, and the light appears.
The real name is SlightPost01. But the mesh gets toggled to invisible as the home is built, and the light pole becomes invisible. My idea was to add in another XMarker. I think it was an XMarkerActivator. My thought was this gets activated then it locks and stays on.

Thanks for the help.
User avatar
Mario Alcantar
 
Posts: 3416
Joined: Sat Aug 18, 2007 8:26 am

Post » Mon Nov 19, 2012 9:33 pm

When the mesh is activated, or set to visible, then the pole object gets enabled, and the light appears.

To keep our terminology clear... meshes are not activated, or "set to visible". Object References can be activated, and enabled/disabled (which means that they're visible / invisible, but enabled/disabled mean more than just that).
I need to know:
The name of the reference of your Light Pole, and its Type (static, activator, etc)
The name of the reference of your Lantern, and its Type
The name of the reference of your "bulb", and its Type
Which one of these 3 objects your script is attached to
How exactly are things supposed to be activated, enabled, and disabled, under what circumstances. be specific. Go step by step.
User avatar
Tom Flanagan
 
Posts: 3522
Joined: Sat Jul 21, 2007 1:51 am

Post » Tue Nov 20, 2012 12:27 am

This may take a bit to get back to you Chesko. I'm taking down my computer system to move to another state. If I haven't responded that's why.
Thanks for the help.
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm


Return to V - Skyrim