|
Pre-including plugins in world files distributed with standalone MUSHclient
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Fiendish
USA (848 posts) bio
Global Moderator |
| Date |
Sun 14 Nov 2010 06:16 AM (UTC) [ quote
] |
| Message |
I just want to be clear.
Is using <include name=".\worlds\plugins\blahblahblah.xml" plugin="y" /> the established mechanism for having path relative plugins?
|
http://aardwolfclientpackage.googlecode.com/ | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #1 on Sun 14 Nov 2010 06:29 AM (UTC) [ quote
] Amended on Sun 14 Nov 2010 08:42 PM (UTC) by Nick Gammon
|
| Message |
- $PLUGINSDEFAULTDIR - the default plugins directory
- $PROGRAMDIR - the MUSHclient program directory
- $WORLDDIR - the directory the current world is in
- $PLUGINDIR - the directory the current plugin is in
So in your case, probably:
<include name="$PLUGINDIR\blahblahblah.xml" plugin="y" />
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Fiendish
USA (848 posts) bio
Global Moderator |
| Date |
Reply #2 on Sun 14 Nov 2010 07:25 AM (UTC) [ quote
] Amended on Sun 14 Nov 2010 08:36 AM (UTC) by Fiendish
|
| Message |
I ended up using
<include name="$PROGRAMDIR\worlds\plugins\blahblahblah.xml" plugin="y"/>
Because PLUGINDIR didn't work. |
http://aardwolfclientpackage.googlecode.com/ | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #3 on Sun 14 Nov 2010 07:39 PM (UTC) [ quote
] |
| Message |
It worked for me:
File: includes_test.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="includes_test"
author="Nick Gammon"
id="6d119b1a8390d08e5b76b33e"
language="Lua"
purpose="Testing includes"
date_written="2010-11-15"
requires="4.33"
version="1"
>
</plugin>
<include name="$PLUGINDIR\myincludes.xml" />
<script>
print "in test.xml"
</script>
</muclient>
File: myincludes.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<script>
print "in myincludes.xml"
</script>
</muclient>
Output:
in myincludes.xml
in test.xml
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Twisol
USA (2,229 posts) bio
|
| Date |
Reply #4 on Sun 14 Nov 2010 08:49 PM (UTC) [ quote
] |
| Message |
Nick Gammon said: It worked for me:
It worked for me too: it's the entire basis upon which my plugin structure is built. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
| Posted by |
Fiendish
USA (848 posts) bio
Global Moderator |
| Date |
Reply #5 on Sun 14 Nov 2010 09:06 PM (UTC) [ quote
] Amended on Sun 14 Nov 2010 09:07 PM (UTC) by Fiendish
|
| Message |
| The subject says "in world files", not "in plugins". There seems to be no concept of the current plugin directory for a world file. :) |
http://aardwolfclientpackage.googlecode.com/ | top |
|
| Posted by |
Twisol
USA (2,229 posts) bio
|
| Date |
Reply #6 on Sun 14 Nov 2010 09:08 PM (UTC) [ quote
] |
| Message |
Fiendish said: The subject says "in world files", not "in plugins". There seems to be no concept of the current plugin directory for a world file. :)
Touche! In that case, there would be no $PLUGINDIR set, because it's not a plugin. What about $PLUGINSDEFAULTDIR? |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #7 on Sun 14 Nov 2010 09:20 PM (UTC) [ quote
] |
| Message |
Fiendish said:
The subject says "in world files", not "in plugins". There seems to be no concept of the current plugin directory for a world file. :)
The terser the question, the less helpful the answer is likely to be.
I normally skim subjects, particularly as the subject lines are normally very vague.
Now that you have clarified, I guess, that you are setting up a pre-made setup of world files and plugins, your original idea is probably as good as any:
<include name=".\worlds\plugins\blahblahblah.xml" plugin="y" />
The idea of the other substitution was for cases where the end-user might have customized away the locations of things. But in your case, you know where you have put the plugins.
I would have thought that $PLUGINSDEFAULTDIR might have been neater, that should evaluate to the same thing. But who knows? Then you need to make sure that the preferences database has set things up correctly. And if they plonk the installed files somewhere you don't expect, well I can't vouch for which system would work better. Probably need to test a few scenarios. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Fiendish
USA (848 posts) bio
Global Moderator |
| Date |
Reply #8 on Sun 14 Nov 2010 09:39 PM (UTC) [ quote
] |
| Message |
Nick Gammon said: The terser the question, the less helpful the answer is likely to be.
Except that your initial answer helped me. :) |
http://aardwolfclientpackage.googlecode.com/ | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
1,646 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )