Difference between revisions of "Apartments (Programming)"
imported>Spunky m (ApartmentGuide moved to Apartments (Programming)) |
imported>Spunky |
||
| Line 1: | Line 1: | ||
== How to make a player apartment building == | |||
1. Dig the structure, making sure the lobby is accessable. Note the object numbers of the hallways and what floor they're on, you'll need it later. | 1. Dig the structure, making sure the lobby is accessable. Note the object numbers of the hallways and what floor they're on, you'll need it later. '''DO NOT DIG ANY APARTMENTS'''. Just the halls. The apartment creation, including doors and locks, will be handled by the lobby generic. | ||
2. Block entry into the lobby for the time being. This is best done by setting the exit into the place to be .passable = 0. That keeps people from buying apartments in the building until it's ready. | |||
3. Go back to the lobby and @chparent it to #477, the lobby generic. This has lots of code and properties on it. | 3. Go back to the lobby and @chparent it to #477, the lobby generic. This has lots of code and properties on it. | ||
| Line 10: | Line 9: | ||
4. Set the following properties on the lobby: | 4. Set the following properties on the lobby: | ||
* .cost_buy (INT): This is the cost to purchase an apartment. Keep in mind the cost of the default lock and door (see below) when you set this. Don't set it so low that buying apartments and selling the locks becomes a profitable enterprise. | * .cost_buy (INT): This is the cost to purchase an apartment. Keep in mind the cost of the default lock | ||
and door (see below) when you set this. Don't set it so low that buying apartments and selling | |||
* .hallways (LIST): This is the list of the hallway room objrefs that you've already dug. This should be a list of lists, with each member list being the objrefs for each floor's worth of rooms. | the locks becomes a profitable enterprise. | ||
* .rooms (LIST): This should be another list of lists, but this time each member list should be a null list. There should be one member null list for each floor of the apartment. This list will start filling with apartment room objrefs as they are bought. | * .hallways (LIST): This is the list of the hallway room objrefs that you've already dug. This should | ||
be a list of lists, with each member list being the objrefs for each floor's worth of rooms. | |||
* .next_room_num (LIST): A list of integers, each being the first apartment numbers for each floor. These numbers will increment as each apartment is built. | EXAMPLE: The first floor of Ass Bandit Towers' hallways are #123 and #456. If you go up | ||
to the second floor, the hallway object numbers are #789 and #1011. you would set the .hallways | |||
* .exits_per_hall (INT): The number of apartments per hallway room. This does not include the predug cardinal exits into each hallway, just the number of actual exits to apartments. | prop on the lobby to {{#123,#456},{#789,#1011}}. | ||
* .rooms (LIST): This should be another list of lists, but this time each member list should be a null list. | |||
There should be one member null list for each floor of the apartment. This list will start filling with | |||
apartment room objrefs as they are bought. EXAMPLE: The Ass Bandit Towers will have two floors, | |||
so when the lobby is configured, .rooms must be set to {{},{}}. The number of floors inferred here must | |||
match the number of floors inferred in .hallways. | |||
* .next_room_num (LIST): A list of integers, each being the first apartment numbers for each floor. These numbers will | |||
increment as each apartment is built. EXAMPLE: Ass Bandit Towers' apartment numbers end with "00", | |||
so this property is set to {100,200}. Note this is a list of integers, not strings. The number of floors inferred here must | |||
match the number of floors inferred in .hallways. | |||
* .exits_per_hall (INT): The number of apartments per hallway room. This does not include the predug cardinal exits into | |||
each hallway, just the number of actual exits to apartments. | |||
* .apartment_parent (OBJ): The parent object for each apartment. | * .apartment_parent (OBJ): The parent object for each apartment. | ||
* .door_parent (OBJ): The parent object for each doorway to an apartment. | * .door_parent (OBJ): The parent object for each doorway to an apartment. | ||
* .default_lock (OBJ): The parent object for the lock to each apartment door. As above, make sure the value of an apartment isn't lower than the lock to the door, as this will make a money exploit. One lock per door will be generated from this parent, and will be automatically configured to open for the player. I'd recommend using a biometric lock, as keyed locks haven't been tested in the role of apartment default lock, to my knowledge. | * .default_lock (OBJ): The parent object for the lock to each apartment door. As above, make sure the value of an apartment | ||
isn't lower than the lock to the door, as this will make a money exploit. One lock per door will be generated from this | |||
parent, and will be automatically configured to open for the player. I'd recommend using a biometric lock, as keyed | |||
locks haven't been tested in the role of apartment default lock, to my knowledge. | |||
These are the only properties that need to be set at inception: the rest are used by the maintenance verbs, and probably shouldn't be touched, or are messages that can be accessed through the normal methods. | These are the only properties that need to be set at inception: the rest are used by the maintenance verbs, and probably shouldn't be touched, or are messages that can be accessed through the normal methods. | ||
If you need to see working examples, the BradBury lobby is #966, and the SweatyPalms lobby is #455. | If you need to see working examples, the BradBury lobby is #966, and the SweatyPalms lobby is #455. | ||
Revision as of 09:26, 5 January 2009
How to make a player apartment building
1. Dig the structure, making sure the lobby is accessable. Note the object numbers of the hallways and what floor they're on, you'll need it later. DO NOT DIG ANY APARTMENTS. Just the halls. The apartment creation, including doors and locks, will be handled by the lobby generic.
2. Block entry into the lobby for the time being. This is best done by setting the exit into the place to be .passable = 0. That keeps people from buying apartments in the building until it's ready.
3. Go back to the lobby and @chparent it to #477, the lobby generic. This has lots of code and properties on it.
4. Set the following properties on the lobby:
* .cost_buy (INT): This is the cost to purchase an apartment. Keep in mind the cost of the default lock
and door (see below) when you set this. Don't set it so low that buying apartments and selling
the locks becomes a profitable enterprise.
* .hallways (LIST): This is the list of the hallway room objrefs that you've already dug. This should
be a list of lists, with each member list being the objrefs for each floor's worth of rooms.
EXAMPLE: The first floor of Ass Bandit Towers' hallways are #123 and #456. If you go up
to the second floor, the hallway object numbers are #789 and #1011. you would set the .hallways
prop on the lobby to {{#123,#456},{#789,#1011}}.
* .rooms (LIST): This should be another list of lists, but this time each member list should be a null list.
There should be one member null list for each floor of the apartment. This list will start filling with
apartment room objrefs as they are bought. EXAMPLE: The Ass Bandit Towers will have two floors,
so when the lobby is configured, .rooms must be set to {{},{}}. The number of floors inferred here must
match the number of floors inferred in .hallways.
* .next_room_num (LIST): A list of integers, each being the first apartment numbers for each floor. These numbers will
increment as each apartment is built. EXAMPLE: Ass Bandit Towers' apartment numbers end with "00",
so this property is set to {100,200}. Note this is a list of integers, not strings. The number of floors inferred here must
match the number of floors inferred in .hallways.
* .exits_per_hall (INT): The number of apartments per hallway room. This does not include the predug cardinal exits into
each hallway, just the number of actual exits to apartments.
* .apartment_parent (OBJ): The parent object for each apartment.
* .door_parent (OBJ): The parent object for each doorway to an apartment.
* .default_lock (OBJ): The parent object for the lock to each apartment door. As above, make sure the value of an apartment
isn't lower than the lock to the door, as this will make a money exploit. One lock per door will be generated from this
parent, and will be automatically configured to open for the player. I'd recommend using a biometric lock, as keyed
locks haven't been tested in the role of apartment default lock, to my knowledge.
These are the only properties that need to be set at inception: the rest are used by the maintenance verbs, and probably shouldn't be touched, or are messages that can be accessed through the normal methods.
If you need to see working examples, the BradBury lobby is #966, and the SweatyPalms lobby is #455.