Setting up a single family home in the Block Editor
From Blue Mars Developer Guidebook
Back to Tutorials
Note: This Article is under construction and should be used for information purposes only not as a functioning tutorial.
Single family homes allow the block developer to create anything from a mansion to a hovel (or whatever you're mind comes up with that will fit inside your block) that will always be visible in the world.
(Note: Furniture will still only be visible when you enter the residence).
What You Need
To set up a single family home you need to start with a block you've obtained from your city developer.
Open it in the Block Editor.
Setting up your structure
Residence geometry is placed as Geom Entities. As you place your geometry you need to decide how the Residence system will use it, for example will the new piece be a floor, wall or ceiling? We refer to this as attachment type because it allows you to determine how you want furniture to attach to this geometry. You choose an attachment type by setting the surface type of it's proxy material. This allows you to create more versatile geometry, with multiple physical materials each representing a different attachment type. (Note if you don't use a proxy only 1 physical material may be used for this and it usually defaults to using the highest material id. So if you have a box with 2 physicalized materials, the first is set to floor and the second is set to wall, the engine will use wall. This is a known issue as of 8/23/2010)
Residence geometry benefits from all of the same features of a normal Geom Entity so it can contain collision proxies, occlusion proxies and multiple meshes (contained in one .cgf).
- mat_ar_floor makes this a floor object
- mat_ar_wall makes this a wall object
- mat_ar_ceiling makes this a ceiling object
- mat_ar_forbidden will prevent the avatar from walking on this surface
- mat_ar_blank will block furniture from being placed in collision with this surface
Setting up an Interior SpawnPoint
Now that your home is built, you need to have a position where the player will start their interior experience from. Place an ARInteriorSpawnPoint (Entity>Others/AR/ARInteriorSpawnPoint) inside the front door (or wherever inside the house you think they should start). Now the only thing you need to do with this entity is to name it something relevant and unique. I usually start with the block name and then add something to make it unique, so like "Block1_BeachHouseInteriorSpawn".
Setting up an ARResidence
Drag out an ARResidence (Entity>Others/AR/ARResidence) to somewhere in the middle of your house. It is important that you name this residence something unique(i.e. "Block1_BeachHouse"). You will need to change some settings in its properties.
- ARInteriorSpawnName - the name of your ARInteriorSpawnPoint ("Block1_BeachHouseInteriorSpawn" in this case).
- DbUniqueId - Leave this alone because it will be set up by the database.
- LibName - For single family homes we want to leave this blank
- radius - Notice how there is a yellow sphere around the ARResidence (if you don't see it try hitting Shift+Space). This will change the size of that sphere. This should encompass your entire house. This property is being deprecated but for now go ahead and just set it up.
- Type - This determines whether this residence is a single family home or apartment.
- 0 - Apartment
- 1 - Single Family (NOTE: For this release this must be set to 1 or you will not be able to enter the residence)
Setting up an exterior SpawnPoint
Now we need to place an ARInteriorSpawnPoint (Entity>Others/AR/ARInteriorSpawnPoint) outside the front door or wherever you'd like to place the player when they exit the house. Again the only thing you need to do is name this something relevant and unique so like "Block1_BeachHouseExteriorSpawn".
Setting up an ARInteriorTester
Now we need a way to get into the residence. This will soon have a more complete system tied in with the places browser for now we can set up a door. The entity to use for this is the ARInteriorTester(Entity>Others/AR/ARInteriorTester). By default the ARInteriorTester does not have a model you'll need to set up the entity using the following settings.
- Address - The name of the ARResidence ("Block1_BeachHouse")
- Model - A physicalized .cgf (I usually use a model of a door but it could be anything with a physics proxy)
- RoomID - This would be used if you were going to use this as a tutorial room (i.e. a model home, this feature is in development and not suggested for use yet.) Just leave this as 0.
- Spawnpoint - This is the name of your exterior SpawnPoint (i.e."Block1_BeachHouseExteriorSpawn")
- Tutorial - Again this is not fully functional yet so just leave it 0
Setting up an ARInteriorExit
Ok once we get inside we'll need a way out right? The entity to use for this is the ARInteriorExit(Entity>Others/AR/ARInteriorExit). By default the ARInteriorExit does not have a model you'll need to set up the entity using the following settings.
- Entrance - This is the name of the ARInteriorTester. This is useful because it allows you to have multiple entrances and exits for your residence, so you don't exit the back door and appear at the front door.
- Model = A physicalized .cgf (I usually use a model of a door but it could be anything with a physics proxy).
Upload your block
Now once you upload your block you'll be able to access your new Residence from your Developer MyPage. Select use it by myself.