104 Avatars for InstantPalace
- Overview
While only 13 avatars are available through the avatars interface in the InstantPalace client, there are a total of 104 avatars available. The avatars directory contains 104 gifs named cf0.gif through cf103.gif. The 13 default avatars, the ones accessible in the InstantPalace avatars menu, are the pics cf26.gif through cf38.gif. The remaining 91 gifs are pictures of smiley faces using various colors and expressions. These gifs can be replaced by gifs using the same names, but with different content, thus providing additional avatars.
At present, the only way to access the additional avatars is a scripted "in-world" solution. Through iptscrae, these avatars can be accessed individually, which would be an InstantPalace Prop Spot, or they can be accessed consecutively with an InstantPalace Avatar Dispenser.
- InstantPalace Prop Spots
Each avatar represents a specific SETFACE and SETCOLOR setting. An example of an InstantPalace Prop Spot would be:
ON SELECT { 2 SETCOLOR 12 SETFACE }To expand on this a bit... the SETCOLOR values would all be even numbers -- 0,2,4,6,8,10,12,14 (8 total) and the SETFACE values would be 0 through 12 (13 total) for a total of 8 X 13 or 104 total combinations (avatars). The 13 default avatars all use the SETCOLOR value of 4, so a spot using this script:
ON SELECT { 4 SETCOLOR 0 SETFACE }would dress the InstantPalace user in the first of the 13 avatars already in the program. Varying the number before SETFACE (0 through 12) will vary the avatars within that SETCOLOR group. In order to get an overall view of these 104 gifs, the browse function of Paint Shop Pro was used to lay them all out, and the following data was collected:
0 SETCOLOR = Red = cf0.gif to cf12.gif 2 SETCOLOR = Tan = cf13.gif to cf25.gif 4 SETCOLOR = Yellow = cf26.gif to cf38.gif ** 6 SETCOLOR = Green = cf39.gif to cf51.gif 8 SETCOLOR = Light Blue = cf52.gif to cf64.gif 10 SETCOLOR = Dark Blue = cf65.gif to cf77.gif 12 SETCOLOR = Purple = cf78.gif to cf90.gif 14 SETCOLOR = Pink = cf91.gif to cf103.gif ** Defaults in Avatar PanelAgain, each group of gifs corresponds to a SETCOLOR range, and each specific gif corresponds to a SETFACE value. New gifs can be created (44 X 44 pixels maximum size) and can then replace the existing gifs while retaining the same gif names. Then, instead of seeing "colored smiley faces", InstantPalace users will see the new gifs.
- InstantPalace Avatar Dispensers
For accessing up to 104 props consecutively and intuitively, the following scripts can be used. These scripts make possible the creation a true InstantPalace Avatar Dispenser with 3 buttons... NEXT, BACK, and RESET. The NEXT button cycles forward through the avatars, the BACK button cycles backward, and RESET button will reset. The ON ENTER script allows one to set the total number of avatars that are being cycled. For example, if a total of 52 avatars are being used, (cf0.gif through cf51.gif) then the number 104 in the ON ENTER script below should be changed to 52.
ON ENTER { maxavatar GLOBAL curavatar GLOBAL convert GLOBAL 104 maxavatar = maxavatar RANDOM curavatar = { curavatar 13 / color = curavatar 13 color * - face = 2 color * color = color SETCOLOR face SETFACE } convert DEF convert EXEC } ;next button ON SELECT { "pop" SOUND maxavatar GLOBAL curavatar GLOBAL curavatar ++ { 0 curavatar = } maxavatar curavatar == IF convert GLOBAL convert EXEC } ;back button ON SELECT { "pop" SOUND maxavatar GLOBAL curavatar GLOBAL curavatar -- { maxavatar 1 - curavatar = } -1 curavatar == IF convert GLOBAL convert EXEC } ;reset button ON SELECT { curavatar GLOBAL 0 curavatar = 0 SETCOLOR 0 SETFACE }- Variations and Enhancements
The are some useful variations that can be made to the ON ENTER section. The above will dress you in a random avatar on room entry. To disable this and keep the avatar you are wearing on room entry, use this ON ENTER section:
ON ENTER { maxavatar GLOBAL curavatar GLOBAL convert GLOBAL 104 maxavatar = { curavatar 13 / color = curavatar 13 color * - face = 2 color * color = color SETCOLOR face SETFACE } convert DEF }The ON ENTER section below adds offset variables so you can select an avatar range. The following example assumes you want to cycle through just the 13 avatars available on the avatar panel. These 13 represent the third setcolor group (cf26.gif through cf38.gif) thus the coloroffset value of 2... 0 is first group, 1 is second group, 2 is third group, etc. Set the total number of avatars to be used in the dispenser by adjusting the maxavatar value. If the maxavatar value is 104 and faceoffset and coloroffset values are both 0, then this script will operate the same as the script above without offset variables.
ON ENTER { maxavatar GLOBAL curavatar GLOBAL convert GLOBAL 13 maxavatar = maxavatar RANDOM curavatar = { 0 faceoffset = 2 coloroffset = coloroffset 13 * faceoffset + curavatar + avataroffset = avataroffset 13 / color = avataroffset 13 color * - face = 2 color * color = color SETCOLOR face SETFACE } convert DEF convert EXEC }The reset button should also be changed to reflect the new starting point. This button uses a literal setcolor and setface designation, so setting the setcolor value to 4 would reset to the first pic in the cf26.gif to cf38.gif range.
;reset button ON SELECT { curavatar GLOBAL 0 curavatar = 4 SETCOLOR 0 SETFACE }InstantPalace users can be dressed in a specific avatar that is designated by the name they are using. This can be done ON SIGNON (at the gate), ON ENTER (in any specific room) or ON SELECT (a spot many could click on but each would receive one avatar linked to their username.)
The script below represents the concept, although it is a relatively cumbersome way of doing it and would only be sensible for very few users. Each SETCOLOR/SETFACE value (avatar) is being assigned only if the username matches what is in the script.
ON SIGNON { { 0 SETCOLOR 0 SETFACE } USERNAME "John" == IF { 0 SETCOLOR 1 SETFACE } USERNAME "Sue" == IF { 0 SETCOLOR 2 SETFACE } USERNAME "Mary" == IF }A much more scalable solution appears below. This script will automatically dress people with specific names in a specific avatar. Just below the ON SIGNON handler is the array that holds the names and SETCOLOR/SETFACE values. This is where you would insert names and numeric values. The numeric values equate to the gif numbers (0 = cf0.gif, 1 = cf1.gif, etc.) Changing ON SIGNON to ON SELECT would create a spot that dresses by name when selected.
ON ENTER { curavatar GLOBAL convert GLOBAL { curavatar 13 / color = curavatar 13 color * - face = 2 color * color = color SETCOLOR face SETFACE } convert DEF } ON SIGNON { [ [ "John" 0 ] [ "Sue" 1 ] [ "Mary" 102 ] [ "Larry" 103 ] ] namedAvatars = 0 i = { namedAvatars i GET avatar = avatar 0 GET name = avatar 1 GET curavatar = { convert GLOBAL convert EXEC EXIT } USERNAME LOWERCASE name LOWERCASE == IF i++ } { i namedAvatars LENGTH < } WHILE }- Combination Avatar Dispenser
A Combination Avatar Dispenser is one that will cycle backwards and forwards through avatars using Next and Back buttons, and will deliver InstantPalace avatars to InstantPalace users, and C-client avatars to C-client users. This is the code used in the Combination Avatar Dispenser found in the popout menu in the InstantPalace entry room at Eagle's Nest:
;next button ON ENTER { Instpal GLOBAL MOUSEPOS + 0 == Instpal = index GLOBAL -1 index = maxavatar GLOBAL curavatar GLOBAL convert GLOBAL 18 maxavatar = { 0 faceoffset = 2 coloroffset = coloroffset 13 * faceoffset + curavatar + avataroffset = avataroffset 13 / color = avataroffset 13 color * - face = 2 color * color = color SETCOLOR face SETFACE } convert DEF } ON SELECT { Instpal GLOBAL { "pop" SOUND maxavatar GLOBAL curavatar GLOBAL curavatar ++ { 0 curavatar = } maxavatar curavatar == IF convert GLOBAL convert EXEC } { direction GLOBAL 1 direction = 10 325 SETALARM } Instpal IFELSE } ON ALARM { index GLOBAL direction GLOBAL [ [ 953938129 953938144 953938181 953938170 953941197 ] [ 953939042 953939008 953938990 953939019 953939299 953939028 ] [ 953934683 953934739 953934824 953934788 953934804 ] [ 953939329 953939343 953939370 953939381 953939357 953939408 ] [ 953941163 953941174 953941181 953941190 953941197 ] ] avatar = avatar LENGTH numavs = { { index ++ } { 0 index = } index 1 + numavs < IFELSE } direction 1 == IF { { numavs 1 - index = } { index -- } index 1 < IFELSE } direction 2 == IF avatar index GET SETPROPS index 1 + ITOA avnum = "Av " avnum + "/" + numavs ITOA + LOGMSG } ;back button ON SELECT { Instpal GLOBAL { "pop" SOUND maxavatar GLOBAL curavatar GLOBAL curavatar -- { maxavatar 1 - curavatar = } -1 curavatar == IF convert GLOBAL convert EXEC } { direction GLOBAL 2 direction = 10 325 SETALARM } Instpal IFELSE }- Configuring pserver.prefs
For the InstantPalace avatars in your palace/avatars directory to be used, this line must appear on a separate line in the pserver.prefs file, which is located in the palace/psdata directory:
USEOTHERAVATARSERVERIf this line isn't in the pserver.prefs file, it can be added with a text editor. For this change to take effect, the pserver.prefs file should be edited while your server is not running.
- Additional Notes
Note 1:
InstantPalace perceives 8 different SETCOLOR values, and the C-Client perceives 16. The groupings appear below. For ease of use and implementation, using even numbers for SETCOLOR values for InstantPalace is the suggested method.
Actual SETCOLOR values -- IP perceived color #0 Red -- Red #1 Orange -- Red #2 Orange/Yellow -- Orange #3 Yellow -- Yellow #4 Yellow/Green -- Yellow #5 Light Green -- Green #6 Green -- Green #7 Green/Cyan -- Green #8 Cyan -- Light Blue #9 Light Blue -- Light Blue #10 Med Blue -- Dark Blue #11 Dk Blue/Purple -- Dark Blue #12 Purple -- Purple #13 Magenta -- Purple #14 Magenta/Pink -- Pink #15 Pink -- PinkNote 2:
The Avatars panel on the InstantPalace client varies SETFACE values only. Once you are scripted into a different SETCOLOR range, the Avatars panel will select other SETFACE values from within that range, regardless of the picture you see when clicking on it. For example, if you click on a spot that dresses you in cf0.gif (0 SETCOLOR 0 SETFACE), then accessing the Avatars panel will not dress you in default avatars as one might expect. It switches to other gifs (cf0.gif through cf12.gif) in the 0 SETCOLOR range. The pictures on the avatar panel will not change... they will remain the pictures from the default cf26.gif through cf38.gif. To regain the ability to wear the default avatars without accessing a script, leave the server and return. This will reset the SETCOLOR range, and return InstantPalace to accessing the default avatars that appear on the avatar panel.
Note 3:
The information on this page applies to InstantPalace 2.0. Older versions of InstantPalace hadn't implemented the SETCOLOR command, and weren't capable of using 104 avatars.
- Additional Resources
- InstantPalace Resources Index
- Scripting for InstantPalace
- Customizing InstantPalace
- InstantPalace Installation
- Using Larger Avatars with InstantPalace
- Using Sounds with InstantPalace
- InstantPalace with 4.4 Windows Server
- Mac InstantPalace and Browser Issues
- InstantPalace Troubleshooting
- Iptscrae Quick Reference Table
- InstantPalace Demos
- InstantPalace Parameters
- InstantPalace Discussion Group
© 2002