The basic thing that is going wrong in your script is that GPDL does not run at run-time, it runs at author time. Therefore, the variable "currentSpriteNum" doesn't have a value.
I put a breakpoint after the first line of code in your GPDL and found that currentSpriteNum had a value of zero. Then stepping through the code, it is trying to get the locH and locV of sprite 0. Since sprite 0 is not a real sprite, the locH and locV should not be trusted. Like you, I found (after converting _player.currentSpriteNum to the currentSpriteNum so I could do this in DMX), that there must be a difference in dot syntax versus verbose syntax which gives you the error.
However, this is all unimportant. The real problem with your code is that GPDL runs at author-time rather than a run-time. And at author-time, there are no Director sprites. The simple solution is code that refers to sprites and sprite locations should be moved into the on beginSprite handler. on beginSprite runs right after Director "instantiates" each sprite.
Further, "currentSpriteNum" is not needed here. I suggest declaring and using "spriteNum" instead. It is automatically given the correct value at runtime. From the Lingo Dictionary:
This property was more useful during transitions from older movies to Director6, when behaviors were introduced. It allowed some behavior-like functionality without having to completely rewrite Lingo code. It is not necessary when authoring with behaviors and is therefore less useful in the past.
Bottom line:
property spriteNum property pSprite property pStartH, pStartV
on getPropertyDescriptionList -- no "me" needed here
-- do whatever you want to create a property list to be returned to define the dialog box
end
on beginSprite me pSprite = sprite(spriteNum) pStartH = pSprite.locH pStartV = pSprite.locV end
Irv
At 3:01 PM +0300 6/13/04, Peter Bochan wrote:
Hello,
I guess I'm going to have GPDL nightmares soon. Again an error.
A short background. When you search the internet for Director/Lingo tutorials you'll probably run into www.furrypants.com/loope. In the GPDL article you'll discover that this handler can be used not only for popping up the parameters window but also to include some code in it. I tried it out and ended up with an error message. Here is the code:
property pSprite property pStartH, pStartV
on getPropertyDescriptionList(me) pSprite = _player.currentSpriteNum pStartH = sprite(pSprite).locH pStartV = sprite(pSprite).locV end
<snip> --
Multimedia Wrangler.
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
