Re: hotspot generation not working
Status: Alpha
Brought to you by:
cwalther
From: Christian W. <cwa...@gm...> - 2008-07-30 11:11:51
|
Aidan Gauland wrote: > I've created a node with a safe door. It has eight buttons, one up and > one down for each digit in the lock. Previously, there was a lot of > code duplication, and now I'm trying the mothod used in Pipmak's main > menu, but I have a problem: I can't figure out how to say, when > declaring a hotspot, to use the value of i, instead of what ever i > happens to be when the hotspot is clicked. You can do the following inside the loop: local myi = i This statement creates a new local variable every time it is executed. That way, every button gets its own myi that keeps the value that i had at the time of the assignment. There's an example of this in internal node -12, the table inspector, for the crosshair buttons (search for comment "--need a copy"). -Christian |