hotspot generation not working

View: New views
3 Messages — Rating Filter:   Alert me  

hotspot generation not working

by Aidan Gauland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

  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.

  I'm sending a patch for the node in question (which can be applied to
112/node.lua in the repository for the game I mentioned eariler), because I
don't want to commit broken code.  If someone here who's good with Lua could
look at it for me and give some advice, that would be much appreciated.

Thanks,
Aidan


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

112node.patch.gz (1K) Download Attachment

Re: hotspot generation not working

by NigeC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Christain did this for me its an alarm keypad:
http://www.nabble.com/attachment/17456356/0/Keypad.pipmak

Re: hotspot generation not working

by Christian Walther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users