I hope this doesn't sound like a stupid question.
I want to set up a puzzle which involves switching lights on or off in order to trigger doors opening and other changes. I've been searching the net looking for tutorials for how I might do this, either using Python or Blender's game engine but I'm at a loss. I tried playing with the "visibility" setting in an actuator, but I couldn't get this to work.
I'm assuming that I would start by making the switch into a clickable area according to the tutorial on this site, and then using a bit of python code to link the clickable area with a command to switch the light on or to toggle the light on and off, and at the same time altering a boolean parameter (true/false) to tell the door that it is now unlocked. Given that such puzzles are pretty much standard in Myst/URU games, I'm assuming someone has already created an age with this kind of puzzle and may have a bit of python code that I could use as a template.
Any help greatly appreciated.
Thanks
Inez
Switching lights on in game
-
- Posts: 1057
- Joined: Fri Sep 28, 2007 8:01 pm
- MOULa KI#: 23247
- Location: US (Eastern Time)
- Contact:
Re: Switching lights on in game
Nope, you'll have to be a pioneer and see what you can do. The ability to put this kind of puzzle together in uru was only recently added, and people are still out fiddling with methods of doing it following the recent plugin release.
Re: Switching lights on in game
Aahh! That explains why I haven't been able to find any tutorials which talk about it. I was beginning to think I was missing something really obvious. Thanks.
Re: Switching lights on in game
Hi,
I'm not sure to understand correctly what you want to make, but in my age, I have lights which are visible only when certain objects are in a certain place.
I use two procedures to enable/disable the light knowing the name of the lamp:
But I would be surprised that that answers your question.
See you soon.
I'm not sure to understand correctly what you want to make, but in my age, I have lights which are visible only when certain objects are in a certain place.
I use two procedures to enable/disable the light knowing the name of the lamp:
Code: Select all
def IEnableObject(self, nom):
print self.__class__.__name__, '.IEnableObject() pour ', nom
o = PtFindSceneobject(nom, self.AgeName)
if o == None:
print 'Impossible de trouver ', nom, ' !'
else:
o.draw.enable()
o.physics.suppress(false)
def IDisableObject(self, nom):
print self.__class__.__name__, '.IDisableObject() pour ', nom
o = PtFindSceneobject(nom, self.AgeName)
if o == None:
print 'Impossible de trouver ', nom, ' !'
else:
o.draw.disable()
o.physics.suppress(true)
But I would be surprised that that answers your question.
See you soon.
The French's Mystpedia age Project - http://www.mystpedia.net
To find me in the Cavern: Gbadji KI #6911493 or Alatan KI#7869109
To find me in the Cavern: Gbadji KI #6911493 or Alatan KI#7869109
Re: Switching lights on in game
I believe Nadnerb means lights can now be controlled with animations instead of Python. The Python way has been known for some time but it should be considered a workaround.
"It is in self-limitation that a master first shows himself." - Goethe
Re: Switching lights on in game
You likely have two options.
1- Animate the lamp to turn on or off gradually. Write AlcScript to export two plATCAnims for the lamp. Use a responder to send a plAnimCmdMsg when something is clicked.
2- Somehow disable your lamp by default. Use a responder with a plEnableMsg to enable the lamp later.
1- Animate the lamp to turn on or off gradually. Write AlcScript to export two plATCAnims for the lamp. Use a responder to send a plAnimCmdMsg when something is clicked.
2- Somehow disable your lamp by default. Use a responder with a plEnableMsg to enable the lamp later.
Re: Switching lights on in game
Thanks guys, I'll do my best to digest what you've suggested (although I have to confess to being more than a bit confused).