So far, Ive been able to replicate the actions of a prim being rescaled with edit menu's "Stretch Both Sides" option turned off.
------------------
The resizeSide() function:
CODE
integer sidePosX = 1;
integer sideNegX = 2;
integer sidePosY = 3;
integer sideNegY = 4;
integer sidePosZ = 5;
integer sideNegZ = 6;
resizeSide(integer side, float newScale)
{
vector curPos = llGetPos();
rotation curRot = llGetRot();
vector curSize = llGetScale();
vector newSize;
vector offset;
if(side == sidePosX)
{
newSize = <newScale,curSize.y,curSize.z>;
offset = <newSize.x - curSize.x,0,0> / 2;
}
else if(side == sideNegX)
{
newSize = <newScale,curSize.y,curSize.z>;
offset = <-(newSize.x - curSize.x),0,0> / 2;
}
else if(side == sidePosY)
{
newSize = <curSize.x,newScale,curSize.z>;
offset = <0,newSize.y - curSize.y,0> / 2;
}
else if(side == sideNegY)
{
newSize = <curSize.x,newScale,curSize.z>;
offset = <0,-(newSize.y - curSize.y),0> / 2;
}
else if(side == sidePosZ)
{
newSize = <curSize.x,curSize.y,newScale>;
offset = <0,0,newSize.z - curSize.z> / 2;
}
else if(side == sideNegZ)
{
newSize = <curSize.x,curSize.y,newScale>;
offset = <0,0,-(newSize.z - curSize.z)> / 2;
}
offset *= curRot;
llSetScale(newSize);
integer linkNum = llGetLinkNumber();
if(linkNum == 0)
{
llSleep(linkNum);
llSetPos(llGetLocalPos() + offset);
}
}
And example usage:
CODE
default
{
state_entry()
{
llListen(0,"",llGetOwner(),"");
}
listen(integer c, string n, key id, string m)
{
if(llSubStringIndex(m,llGetObjectName()) == 0) //w00t, the script gets to do something!
{
m = llToLower(m);
list mSplit = llParseString2List(m,[" "],[]);
string command = llList2String(mSplit,1);
if(command == "sidescale")
{
string param1 = llList2String(mSplit,2);
string param2 = llList2String(mSplit,3);
if(param1 == "+x")
{
resizeSide(sidePosX,(float)param2);
}
else if(param1 == "-x")
{
resizeSide(sideNegX,(float)param2);
}
else if(param1 == "+y")
{
resizeSide(sidePosY,(float)param2);
}
else if(param1 == "-y")
{
resizeSide(sideNegY,(float)param2);
}
else if(param1 == "+z")
{
resizeSide(sidePosZ,(float)param2);
}
else if(param1 == "-z")
{
resizeSide(sideNegZ,(float)param2);
}
}
}
}
}
What it does:
Lets say I have an object named A:
CODE
_______
| |
| |
|______|
With dimensions 1x1x1.
I say "A sidescale -z 4"
The resulting object has dimensions 1x1x4, however, the top of the object stays in the same position, like this:
CODE
Before: After:
_______ _______
| | | |
| x | | |
|______| | |
| x |
| |
| |
| |
|______|
The little x is the center of the objects.
Aside: Good god ascii art is HARD

You 'talk' to the sidescale script like so:
(Lets say the script is in an object named "Foo"

Foo sidescale +z 6
That makes Foo's z scale 6, but leaves the base of foo in the same position, and raises the top.
Foo sidescale +x 8
This makes Foo's positive x scale 8, but leaves the side of foo on the negative x axis (x axis is the red arrow you see when in edit mode, negative is the direction opposite the way the arrow is pointing) in the same position.
Foo sidescale +y 9
This makes Foo's positive y scale 9, but leaves the side of foo on the negative x axis in the same position, and resizes the side on the positive y axis.
To undo a scaling operation:
Lets say you have an object with dimensions 1x1x1
and say "Object sidescale +x 5"
This resizes the object to 5x1x1, and changes its position accordingly. To reset the object back to its original size and position, say "Object sidescale +x 1"
------------------
More functions coming soon!

==Chris