![]() |
It's Not a Mess, It's My Art, ManCleaning Up Your RoomNow with BotBot Support!(see the "Proptrix Group") More News! The "hang" script described here is now a built-in part of prop repository rooms at Communities.com's Main Palace ("Mansion") |
One well-known problem when sharing avatar images is that when you
wear props, they have a pixel offset each prop is offset
to the side or up and down so that together the props tile-out a large
picture. But when you drop them, the offset vanishes. They
all pile one upon the next.
Can we write a script to solve this
problem? Duh-uh.
![]() |
![]() |
![]() |
Original
3x3 Prop. What we want. |
All Tiles
Dropped on One Spot. Not what we want. |
Tiles Loosely-Placed
by Hand Not what we want. |
The Bad News: There's no single solution. The Good News: there are a
few good solutions that will catch 90% of the cases.
Here's an
OUTCHAT
command that's well-tuned for laying-out arrays of props, called
"hang." It can be used in both cyborgs and prop-room
scripts.
{ "$1" GREPSUB ATOI nx = "$2" GREPSUB ATOI ny = { { NBRUSERPROPS nx ny * - ITOA " props left" & LOCALMSG } nx ny * NBRUSERPROPS == NOT IF MOUSEPOS 22 + 3 ny - 22 * - y = 22 + 3 nx - 22 * - x = 0 j = { 0 i = { x i 44 * - y j 44 * - DROPPROP i ++ } { i nx < } WHILE j ++ } { j ny < } WHILE } { "You only have " NBRUSERPROPS ITOA & " props, not " & nx ny * ITOA & LOCALMSG } nx ny * NBRUSERPROPS <= IFELSE "" CHATSTR = } CHATSTR "^hang ([1-9]) ([1-9])" GREPSTR IF |
You use "hang" by giving it a width and a
height ![]() hang 3 3I.e., "hang these props up, 3 across and 3 high." ![]() hang 9 1 ![]() Horizontal Strip, hang 9 1 or hang 1 9Or even in clumps with multiple "hang" commands: hang 5 1 hang 2 2The last method is also be appropriate for large props with animated components ![]()
![]() Nine-Frame Animation Laid Out as a Strip | ![]() hang 1 9 |
Of course, we have made an important simplifying assumption here
that the props have been put on in the order that we would normally
read them
left to right, top to bottom. This is the normal order
that they appear in the prop picker window, and the order than
the client's own bulk-pasting normally uses, so it hardly seems like a
great leap. The figure on the right illustrates what "hang"
will do with props loaded in some different order.
![]() |
![]() |
Normal Ordering | Scattered Ordering |