XML / Macro Tutorial

Don Von Alpha Dom
by Don Von Alpha Dom · 4 posts
16 years ago in Other
Posted 16 years ago · Author
XML - (Extensible Markup Language) is a flexible way to create common information formats and share both the format and the data on the World Wide Web, intranets, and elsewhere.

Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store, and transport information.

The following example is a note to Tove from Jani, stored as XML:

Code
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>


The note above is quite self descriptive. It has sender and receiver information, it also has a heading and a message body.

But still, this XML document does not DO anything. It is just pure information wrapped in tags. Someone must write a piece of software to send, receive or display it.



Macro - a computer science term for a set of instructions that is represented in an abbreviated format

There are several types of macros supported in this file. The first of
these are macros for F-keys. F-key macros have the format
<KeyNNN>command</KeyNNN> where NNN is a number representing a key
combination. For F-keys, these numbers start at 112 for F1 and go up
to 135 for Shift-F12.


The second kind of macro triggers a product to be worn. This allows you
to easily add a trigger to any of the various animations and other
products in the IMVU catalog. An example of a product wearing macro is:

Code
<Macro>
  <Key>rocker</Key>
  <Value>*use 11185</Value>
</Macro>


Where # is replaced with any number. The above macro uses the trigger
"rocker" to call product 11185 which is the Rocker animation for the Guy.

The third type of macro is avatar specific. For example, if you wanted
to have a different product called for the word "rocker" based on what
avatar you were wearing, you could set up your macros as follows:

Code
<Avatar80>
<Macro>
  <Key>rocker</Key>
  <Value>*use 2068</Value>
</Macro>
</Avatar80>


Code
<Avatar191>
<Macro>
  <Key>rocker</Key>
  <Value>*use 11185</Value>
</Macro>
</Avatar191>


;The top macro is for the Girl only while the bottom macro is for
;the Guy only. The product numbers for the two IMVU inc. created
;avatars are:
;
;Girl: product80
;Guy: product191

The above note was made when we had seperate sections for the Girl
and Guy avatars. Now, both avatars' commands have been merged into
the general area.


The fourth type of macro involves the use of illegal XML keys. For
example, if you wanted to make a key command for evil smile that was
" >) ", you would create a macro that looked like this:

Code
<Macro>
  <Key>&gt;)</Key>
  <Value>*use 11671</Value>
</Macro>


If you want to use any of the five "illegal" XML keys, you must use the
following translation:

Code
Illegal Key         XML translation          Description

"<"                  &lt;                     Less than
">"                  &gt;                     Greater than
"&"                  &amp;                    Ampersand
"' "                  &apos;                   Apostrophe
"""                   &quot;                   Quotation mark


Not using the above translations will result in a crash in the XML.

As a shortcut, if you want to define a word-based macro that only
uses letters and numbers, you can do so like this:

Code
<Word_rocker>*use 11185</Word_rocker>



The fifth type of macro you may create calls multiple products. You
may actually call multiple products in any macro but it deserves its
own section. With this type of macro, you could put together outfits
or play multiple animations simultaneously or....the sky is the limit.
For example, if you wanted the word "trek" to put on the Guy avatar
with the green IMTV T-shirt and the thumper headphones, your macro
would look like this:

Code
<Word_trek>*use 191 185 11628</Word_trek>



The sixth type of macro can call sound files linked to websites. An
example of this type of macro is:

Code
<Word_brb>*sound http://www.barbneal.com/wav/uncat/ilbeback.wav</Word_brb>



And finally, you may also create text macros. For example, if for some
reason I wanted to have the phrase, "You shot who with the what now?"
mapped to the trigger word " shot ", I would create a macro that looked
like this:

Code
<Word_shot>You shot who with the what now?</Word_shot>


NOTE: The name of a given Macro must be different from any other Macro
in this file. For example, you can not have more than one <Macro1> or
<MacroFuBar>. Nor can you have more than one <Word_trek> or
<Word_fubar>.

NOTE: Never add any text, commands or otherwise, after the "</Template>"
at the bottom of this page. Doing so will result in a crash in the XML
or at least dirty looks from strangers.

This default macros file is named macros.config.xml, and lives in the
IMVU folder. Because IMVU updates this file with every release, if you
make changes you should be sure to back them up. If you'd like to
override the IMVU standard macros, you can save them in a file named
mymacros.xml in the IMVU folder. Macros defined in mymacros.xml will
override macros of the same name defined in macros.config.xml
Posted 14 years ago
huh!isn't this xml a way to export stuff to imvu previewer
Posted 14 years ago
hmm good to know, thanks don

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT