Aller au contenu

Photo

Turn off That Damn Light!


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Alupinu

Alupinu
  • Members
  • 528 messages
Ok… what’s the deal on light points and turning them off or on? I could not find a script in the toolset that worked so I made one using the Script Generator and it didn’t work either. So does anybody have a simple ga_script for turning on/off light points?

#2
Guest_Chaos Wielder_*

Guest_Chaos Wielder_*
  • Guests
The SetLightActive function is a bit bugged. If I recall correctly, you need to create the light through the CreateObject command--preferably saving it as a variable or with a unique tag--otherwise the SetLightActive function won't alter the light if the player saves and loads. Either that or changes modules.



I'm not sure on the specifics, mind you, but the light needs to be routed through a script if you want it to be turned on and off.

#3
Shallina

Shallina
  • Members
  • 1 011 messages
Light loose their tag when you load from a save game.



A way to have it working all the time is to set light as local object.

#4
Alupinu

Alupinu
  • Members
  • 528 messages
Ok people I did as you suggested. Gave the light local bp and then used the functions create and destroy object to turn off and on the light. Seems to work fine, so thanks everyone for your suggestions and time.

#5
Dann-J

Dann-J
  • Members
  • 3 161 messages
Thanks for raising this issue. I'm creating a mod where you can light candles, camp fires and braziers, and never thought to test it by saving and reloading.



Thankfully the GetNearestObject function can search for the nearest 'object_type_light' to a specified target. In my case the objects that run the scripts are all right under the lights, so I can use OBJECT_SELF as the 'nearest' origin, although if you wanted to start lights remotely you could always create a waypoint or an ipoint at the same location as the light object and use that as the origin (at least those object types retain their tags).

#6
seraphimsage

seraphimsage
  • Members
  • 104 messages
I know this thread is a bit old, but kudos to Shallina for posting the solution to the light problem that has persisted since the beta version of my Nihil Module. My sincere thanks.