If I make the changes you describe in function PositionObj(), I get code that looks like this:
else if (PxObj[objectpass].GetProperty("PxPos")==-1){
PxObj[objectpass].X=PxObjOriginX[objectpass]+FloatToInt(IntToFloat(viewx)/26.0);
PxObj[objectpass].Y=PxObjOriginY[objectpass]+FloatToInt(IntToFloat(viewy)/26.0);
if (PxObj[objectpass].GetProperty("PxView")!=0){
fractionx = (IntToFloat(viewx)/26.0)-IntToFloat(FloatToInt(IntToFloat(viewx)/26.0, eRoundDown));
fractiony = (IntToFloat(viewy)/26.0)-IntToFloat(FloatToInt(IntToFloat(viewy)/26.0, eRoundDown));
Here I've replaced 4.0 six times.
When changing these values, it's advisable to make sure the object's initial positions are adjusted accordingly by making this change in function SetOrigins:
else if (object[objectpass].GetProperty("PxPos")==1){
//Set horizontal origin for object:
PxObjStartX[NumberObj]= object[objectpass].X;
PxObjOriginX[NumberObj] = object[objectpass].X + FloatToInt((IntToFloat(object[objectpass].X)/IntToFloat(Room.Width))*(IntToFloat(Room.Width-System.ViewportWidth)/26.0));
//Set vertical origin for object:
PxObjStartY[NumberObj]=object[objectpass].Y;
PxObjOriginY[NumberObj]= object[objectpass].Y + FloatToInt((IntToFloat(object[objectpass].Y)/IntToFloat(Room.Height))*(IntToFloat(Room.Height-System.ViewportHeight)/26.0));
}
Here I've replaced 4.0 twice.
This gives me the effect of an object in the background scrolling very slowly. The smoothing effect works, but is not as pleasing to the eye because of the lack of sub-pixel movement.
I wanted to have distant mountains scrolling very, very slowly as the character walks.
I'm having a little trouble understanding what effect you're tring to achieve, here. A distant object like mountains ought to move
more relative to the screen, not less. Changing 4.0 to 26.0 makes my parallax objects appear nearer.
I guess what would be handy, is if you could implement a new PxPos number for distant scrolling objects (like mountains) that scroll left to right, rather than right to left. Either that, or allow the user to somehow specify which direction a distant object should scroll.
If the player walks left, a distant object ought to travel left relative to the screen too. If it travelled in the opposite direction it would appear to be in the foreground. To get that effect you can use positive PxPos values, or have I misunderstood?
If checking over the script doesn't solve the problem, perhaps you could explain the effect you're looking for.
What's the best way of ensuring that both the scrolling background and any parallax objects are already set into their correct positions, relative to the player's x/y pos, prior to the screen fading in? So that the player doesn't have to watch them scrolling into position every time a new room loads?
If for some reason you can't specify the coordinates in the ChangeRoom function in the outgoing room, you could use something like this in the roomLoad function
if (player.x!=20 && player.x!=327) player.ChangeRoom (1, 20, 327);
I'll try to make the module support this better in the future, but I can't work it out just now. For the time being, that workaround is your best bet.
I hope that helps!