View Single Post in: Discussion: Lot Size, Orientation, Rotation, etc.

Site Helper
Original Poster
#27 Old 26th Sep 2007 at 6:54 PM
Default How to Move a Portal
[Update:]
Inge Jones has created a tool which allows you to see, move and rotate the portals on a lot. This is much easier than changing the portals in SimPE. Get the tool here: http://www.modthesims2.com/member/s...ad.php?t=251392
[End Update]

Quote: Originally posted by aelflaed
Where do I "open the lot file in SimPE?" Maybe I'm starting from the wrong place altogether.

First, you need to determine filename of your lot. Here's the method that I use:

In SimPE, open the neighborhood and select the Lot Description for your lot. In the plugin view on the left-hand side, you will see the Instance underneath the Version. For example, in Pleasantview the Broke family house, 55 Woodland Drive, has an Instance of 0x00000024.

To convert the Instance from hex to decimal, just bring up the Windows Calculator and choose Scientific from the View Menu. Now, click on the Hex radio button and type in the Instance. You don't need to type in the leading 0x or the leading zeros. For the Broke family house, I type in 24. Now, click the Decimal radio button and the number will be converted. The Broke house is stored in lot 36.

In SimPE, select Open from the File menu and navigate to the Lots subdirectory of your neighborhood. Open the file Lot###.package, where ### is the decimal instance number that you calculated above. You can verify that you have the right lot by selecting jpg/tga/png Image in the Resource Tree and browsing through the pictures. (I thought that the house name was there somewhere, but I can't seem to find it right now).

Quote:
Also, if I want to move the road on the 1x1 lot, will that work? Effectively I'm just swapping which side of the rectangle is the road, and which the building space. Or do I need to start with a 1x2 lot? But then I would have to crop it anyway. Aaargh again!

Yes, just use the existing lot. There is no need to expand it. A 1x1 lot is really a 1x2 lot, with one of the tiles taken up with the road. You want to move the road to the other tile and the house will be built where the road used to be.

Quote:
Sorry to be so dense. (Maybe someone else should do this - might be quicker, and less painful all round.)

"Teach a person to fish"... and maybe I'll get a chance to play the game again!

Quote:
I have successfully moved the road on MaryLou's 1x1, and the light angle is now correct. However, presumably the portals are all wrong, so the carpool will probably arrive in the middle of the house.

Almost there...

Quote:
When I find out how to do the portals, it will be marvellous.

Here's the quick version:

How to Move a Portal:

1) First, backup what you've done, in case this doesn't work.

2) Open the lot file in SimPE (see above).

3) Although the Portals are usually stored in XOBJ Instances 3-8, it is wise to check this before making any changes.

3.A) In the Resource Tree, select the Object (OBJT) which has the larger number of entries.

3.B) Sort the Resource List by Instance by clicking on the word "Instance" in the Resource List title:
Name Type Group Instance (high) Instance <- Click here!
3.C) The OBJT Instances should now be sorted numerically from 1. If they seem to be in reverse order, just click on "Instance" again to sort them in the other direction.

3.D) Look through the OBJT entries to find the 6 Portal Instances. See the following two posts for additional information:

http://www.modthesims2.com/showthread.php?p=1778248

http://www.modthesims2.com/showthread.php?p=1780690

4) Select Object XML (XOBJ) in the Resource Tree and sort the Resource List by Instance.

5) You will want to change the Portal coordinates in the Instances that were found in step 3.D. Select one of the XOBJ Instances that you want to change. Choose Hex at the bottom of the screen to go into the hex editor.

6) You need to change the two 4-byte floating point numbers (AKA "Single"s) at bytes 80 and 84. Since SimPE displays the byte numbers in hex, you need to look at the Single value stored at 0x50 and the Single stored at 0x54. (You can confirm this using the Windows Calculator to convert from Decimal 80 to Hex 0x50).

Click the mouse on the byte at 0x50 and drag to select the four bytes from 0x50 and 0x53. Now, look under the array. You will see the bytes that you selected displayed in various formats:

Byte: Int:
Short: Long:
Single: Double:
Binary:

You want to change the "Single" value. Just type the number that you want and then press the Enter key; the value in the array will change to reflect what you typed. Don't be worried if the four hex bytes look odd to you... floating point numbers are not stored in an obvious format.

You will need to change two Singles per Instance at 0x50-0x53 (X) and 0x54-0x57 (Y). See the following post for additional information:

http://www.modthesims2.com/showthread.php?p=1780690

7) Now, the only problem left is deciding where to move the Portal. Your lot is 1x2, so one corner of your lot is at coordinates 0,0 and the other is at either 10,20 or 20,10 (depending upon the U11 value).

This means that the values of the portals should be between 0 and 20. Since I haven't gotten that far in my investigation, you could just try experimenting. I'd look at the current values in these two Singles, to see whether you can determine what they should be changed to. See below for an example.

8) After changing both Singles for this XOBJ Instance, then commit and repeat for the rest of the Portals. Finally, save and exit and test the lot in your game.

----------------------------------------------------------------------

As an example, let me show you what the portals for the Broke house look like. The Broke house is a 3x3 lot, facing left (U11=0), with a road at the left and another road at the top (U10=3).

From the string values in OBJT Instances 3-8, we find the type of portal:

Instance 3 = Pedestrian
Instance 4 = Pedestrian
Instance 5 = Car Start
Instance 6 = Car Stop
Instance 7 = Service Start
Instance 8 = Service Stop

From the floating-point values in XOBJ Instances 3-8, we can determine that the current portals have the following coordinates:

3 Pedestrian X=1.5 Y=9.5
4 Pedestrian X=28.5 Y=9.5
5 Car Start X=1.5 Y=5.5
6 Car Stop X=20.5 Y=5.5
7 Service Start X=28.5 Y=4.5
8 Service Stop X=12.5 Y=4.5

Here's what I can deduce from these numbers:

- The bottom left corner of the lot is at X=0 Y=0.
- The top left corner of the lot is at X=30 Y=0.
- The top right corner of the lot is at X=30 Y=30.
- The bottom right corner of the X=0 Y=30.
- The game likes the portals to be at least 1.5 in from the edge of the lot. Because your lot is so small (only 10 wide), I might try 1.0 or even .5 in from the edge, instead (just to see what happens).
- The sidewalk closest to the house is at Y=9.5
- The side of the road closest to the house is at Y=5.5
- The side of the road farthest from the house is at Y=4.5
- The Car Stop and Service Stop portals are not at the edges of the lot. Instead, they seem to be closer to the mailbox. So, this probably indicates where we want them to stop while at the house. Fooling around with these values may allow us to have more cars on the road.

How do I know this?

The transportation objects, like carpools, buses, and taxis (Portal - Car) start at X=1.5 and stop at X=20.5. We know that these objects come onto the lot from the right side of the house and leave from the left side (when viewed from the front). Because of the U11 rotation, this puts the car start at the bottom left of the lot and the car stop closer to the top left.

The service objects, like maids, gardeners and handypeople (Portal - Car - Service) start at X=28.5 and stop at X=12.5. We know that these objects come onto the lot from the left side of the house and leave from the right side (when viewed from the front). Because of the U11 rotation, this puts the service start at the top left of the lot and the car stop closer to the bottom left.

Pedestrians come onto the lot at the front of the house, from both directions. Thus, there are two Pedestrian portals at X=1.5 and X=28.5.

Cars always travel on the side of the road closest to the house, thus Y=5.5, just slightly to the house-side of the first 10 tiles, which contain the road.

Service cars always travel on the side of the road furthest from the house, thus Y=4.5, which is within the first 10 tiles and thus on the road, but slightly to the side which is away from the house.

Pedestrians always travel on the sidewalk closest to the house. Thus, Y=9.5, which is just within the first 10 tiles (which contain the road and two sidewalks).

I hope that it's obvious from this how I derived the coordinate system. Now that we understand the coordinate system, it should be easy to decide where to move the portals, based on the new location of the road.

----------------------------------------------------------------------

Aha I found an interesting picture in one of Andi's posts:

http://www.modthesims2.com/showthread.php?p=1376989

Here's my version (I just find it easier to think about things this way around):

They should be identical... it's just a question of which picture works for you.
Screenshots