Main      Site Guide    
Message Forum
Re: Smash
Posted By: gremlinn, on host 66.75.44.2
Date: Friday, August 3, 2007, at 05:09:29
In Reply To: Smash posted by Tim on Thursday, August 2, 2007, at 16:42:05:

> Could someone with AGL experience help me out here?
>
> I'm using Rex to make a game. I want to display images. However, unlike the Command Documentation's example, if I try to use the i command as the result of an option, Rex won't do it:
>
> Command "i" in the wrong context. This command is not allowed in code parsed in (or in a function called from) an option code block.
> Line: "i map.png"
> Parsing was stopped at that point.
>
> "i" works if it's not in an option block, and I can always make a state variable, like view_map, and have it set each time the button is pressed, but that seems rather ugly compared to
>
> * map Look at the map.
> i map.png
>
> Why won't this work? It seems like it should.

The last release of Rex was two years ago, and since then the "i" command has changed (among numerous other changes/additions to Smash). It used to be that "i" was only allowed outside option blocks and "I" was the corresponding command within option blocks, but now it's "i" in both places with the optional "priority" value (i [number] [image]).

I think as a temporary fix you could change it to "I" when it's within an option block, or you could wait until I have a new version of Rex ready. I have a few minor loose ends to tie up that should take only a matter of a few hours, once I get around to it. (Mostly non-critical stuff like updating the documentation.)

The bigger issue is that I was recently unable to get the utility "py2exe" to work (to create the Windows .exe version from the raw Python code, as I did for each release so far). If you have the right things installed and are running Rex as Python code directly, I could just send you my working .pyw file.

Replies To This Message

Post a Reply

RinkChat Username:
Password:
Email: (optional)
Subject:
Message:
Link URL: (optional)
Link Title: (optional)

Make sure you read our message forum policy before posting.