[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Beta testing
. . -> [Subject]  Sharing notes between worlds using XML "include"
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Sharing notes between worlds using XML "include"

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Wed 14 Aug 2002 04:45 PM (UTC)
Message
How can I share my notes file from one world to all the others using include files? For example, I need to make it so that the notes are in a single file, and all the worlds read from it. Can that be extended to include triggers/timers/variables/etc?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 15 Aug 2002 10:27 PM (UTC)
Message
Yes, the intention is that this will work.

I am trying to do a small demo to show how, and am running into problems, either with remembering how it works, or maybe a bug in the code.

As soon as I work it out, I'll let you know. ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Fri 16 Aug 2002 05:52 AM (UTC)

Amended on Fri 16 Aug 2002 05:54 AM (UTC) by Nick Gammon

Message
Seems to be a bug in the include code. Fixed in 3.26. The method, which should work in 3.26 is:

Make an include file like this:




<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<muclient>
  <world>
    <notes>
      <![CDATA[

My test notes
Line 2
Line 3
...
Line 99 ... and so on ...

      ]]>
    </notes>
  </world>
</muclient>




Then in your main world file (using a text editor) add an "include" line, directly after the <muclient> line, like this:





<muclient>
<include name = "notes_include_file.xml" />


You may need to put in the full path name if it doesn't find it. The idea here is that the include file will be processed first, and set up the notes for that world (and every world that uses it).

However you must only edit the notes by editing the include file in a text editor - as soon as you change it inside a particular world, MUSHclient will assume that that world is to have different notes, and will save them in the world file, thus overriding the included version.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #3 on Sat 17 Aug 2002 11:42 AM (UTC)
Message
Ahh, very nice... And I assume that this will also work with other parts of the world file, such as triggers/aliases/etc mixed up in one include file?
i.e. Can I have my notes, 3 triggers, 4 aliases and 2 variables in the include file? And also, where will the variable's value be stored, in the include file or in the world file?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sun 18 Aug 2002 06:36 AM (UTC)
Message
Yes, notes, triggers, aliases etc. can go in the include file.

Right now the code to manage clashes between the include file and the main file has not been written for colours, macros, keypad and printing sections.

The variables are stored where they are found, however if you change a variable (or anything) then MUSHclient assumes you are overriding the include file, and then saves it in the world file.

In other words, if a particular setting (eg. hyperlink_colour="blue") is in the include file, and you save the world file, then that setting is *not* written to the world file, unless the value has changed. So, for instance, if you changed hyperlink_colour to "green" then that is written to the world file as a "local override". Then if the include file was subsequently changed (eg. to "yellow") then any world files with the local change would not be affected, however ones that had previously used the included value will get the new value.

The idea here is that you can set up "standard" settings in the include file(s) but override them if you want in the main world file.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


5,433 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]