 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu Dec 18, 2008 7:09 pm
Some #MXP issues |
So, one of the people in my MUD made a Portrait script for zMUD. Of course, some of us use CMUD so I offered to help him make it work for CMUD, though I know very little of the #MXP stuff. Anyways, we got the entire script on and without errors, but the portraits never show up. Instead it creates a little window that's the minimum size possible and is blank, you can see when you expand it. For some reason it is not grabbing the images from the url location that it's supposed to.
We tried figuring out what was up and so he sent me this...
| Code: |
#mxp <image fname="icon_quote.gif" url="http://forums.zuggsoft.com/forums/templates/Classic/images/lang_english/">
|
It started downloading the icon and a download box showed up, but then CMUD froze and I had to end the task because it stopped responding.
Anyways, here's the alias we're trying to get to work:
| Code: |
<alias name="DownloadPictures" id="214">
<value><![CDATA[#VARIABLE CharacterPicsDelta ""
#VARIABLE CharacterPicsNewPicCount 0
#FORALL @CharacterPicsNames
{
#mxp <FRAME Name="Portrait" action="open" Left="800" Top="75" Width="275" Height="325">
#SHOW %ansi( green, bright) Loading portrait for %i:Portrait:
#execwin Portrait {#MXP ~<image fname=%concat( %i, ".jpg") url=%trim( @CharacterPicsURL)>}
#ADD CharacterPicsNewPicCount 1
}
#mxp <FRAME Name="Frame" action="close">
#IF (@CharacterPicsWantOwnPic & @CharacterPicsCharacterName != "" & %ismember( @CharacterPicsCharacterName, @CharacterPicsNames))
{#IMAGE %concat( @CharacterPicsCharacterName, ".jpg")}
#IF (@CharacterPicsNewPicCount == 0)
{
#SHOW %ansi( green, bright)No new portraits found.
}
{
#SHOW %ansi( green, bright)Added @CharacterPicsNewPicCount new portraits.
}
#SHOW %ansi( green, bright)Portrait update completed.]]></value>
</alias>
Variable:
<var name="CharacterPicsURL" id="229">http://i377.photobucket.com/albums/oo219/dsl_character_pics/</var>
|
Would love to figure out why we cannot get it to work. |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Dec 18, 2008 7:17 pm |
Not sure why CMUD froze, but your problem is the quotes in your text. In CMUD, quotes delimit strings and are removed from the parser - they're not passed on. Try
#mxp <image fname='icon_quote.gif' url='http://forums.zuggsoft.com/forums/templates/Classic/images/lang_english/'>
Secondly, this tag isn't closed. I don't know whether MXP requires that, and whether it just wants a / at the end of the tag or a separate </image> tag, but it's something to look into. |
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu Dec 18, 2008 7:36 pm |
| Code: |
<alias name="DownloadPictures" id="214">
<value><![CDATA[#VARIABLE CharacterPicsDelta ""
#VARIABLE CharacterPicsNewPicCount 0
#FORALL @CharacterPicsNames
{
#mxp <FRAME Name='Portrait' action='open' Left='800' Top='75' Width='275' Height='325' />
#SHOW %ansi( green, bright) Loading portrait for %i:Portrait:
#execwin Portrait {#MXP ~<image fname=%concat( %i, ".jpg") url=%trim( @CharacterPicsURL)>}
#ADD CharacterPicsNewPicCount 1
}
#mxp <FRAME Name='Portrait' action='close' />
#IF (@CharacterPicsWantOwnPic & @CharacterPicsCharacterName != "" & %ismember( @CharacterPicsCharacterName, @CharacterPicsNames))
{#IMAGE %concat( @CharacterPicsCharacterName, ".jpg")}
#IF (@CharacterPicsNewPicCount == 0)
{
#SHOW %ansi( green, bright)No new portraits found.
}
{
#SHOW %ansi( green, bright)Added @CharacterPicsNewPicCount new portraits.
}
#SHOW %ansi( green, bright)Portrait update completed.]]></value>
</alias>
|
Oddly enough now the button creates the window, but the window is named / and it still isn't showing any of the pictures that are supposed to run through it. I can't figure out why the name was changed from Portrait to / though  |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Dec 18, 2008 10:39 pm |
Do not put the /> closing tag for MXP. The /> is used to close tags in XHTML, not in MXP. MXP works more like plain HTML and marks each tag as to whether it needs a closing tag or not. The FRAME and IMAGE tags do not need any closing tag and the parser probably breaks if you include one (which is probably why your window gets named "/")
The MXP engine in CMUD is almost the same as in zMUD, so the same commands should work. I just did:
| Code: |
| #mxp <image fname="icon_quote.gif" url="http://forums.zuggsoft.com/forums/templates/Classic/images/lang_english/"> |
on the command line of a blank session and it worked fine for me here. So I'm not sure why your's hung. The quotes are still fine.
If we are being picky about syntax, technically the command should be:
| Code: |
| #mxp {<image fname="icon_quote.gif" url="http://forums.zuggsoft.com/forums/templates/Classic/images/lang_english/">} |
The {} will ensure that the full tag is passed as a single argument to the #MXP command. Otherwise "<image" is passes at the first argument, then "fname="icon_quote.gif"" is passed as the second, etc.
Also, you don't need any ~ before the < character in your #EXECWIN command. zMUD needed that sometimes, but CMUD doesn't need it, especially if you put {} braces around the #MXP argument. |
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|