[Mod] Rent apartment with chests etc. [apartment]

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

[Mod] Rent apartment with chests etc. [apartment]

by Sokomine » Post

[Edit 01.07.2018]Re-added some images.[/Edit]

New: Now entire apartment complexes can be spawned with a simple build chest.

Do you know this problem? New players join a server and start building ugly cobble boxes around spawn. Others ask everyone they can find if they can "stay"/"move into" a house. You'd love to give them a small place for their locked chests (space close to spawn is useful on survival servers) and a protected place to melt their ores - but you can't really because locked objects have to be placed by their owner. Which would require very split-up and small-sized protection around spawn and usually both players have to be present.

This mod has been inspired by cheapies new-player-apartments on VanessaEs Vanilla server, but also by the need arising on many other servers, especially the Xanandu server with its more likely item loss at death.

This is a sample apartment house that can hold up to 16 players. One row of apartments is underground. The mod itself does not come with any buildings - this is really just an example how you can make it look like:
Image

And here is a sample apartment from the house above. It has 9 locked chests, 3 furnaces, a travelnet box and locked signs between the chests where players may write down what they put into the chests. The apartment is protected against thiefs (content of furnaces) by a steel door.
Image

Apartments are controlled through apartment control panels. Their texture is a mixture of the top of a chest and a steel door, and they look a bit like buttons.
Image

When right-clicking a newly placed apartment control panel, it asks you to enter some values:
Image
The "Name or number" field has to be a uniq name for each apartment. It may be something like street name/building name plus number plus letter or any other scheme you like. The "category" field is important because each player can only rent one apartment of each category at a time. This way, you may for example permit to rent an apartment and a shop.

The left/right/back/front/up/down values instruct the panel as to how far its influence - that is, the change of ownership of nodes - shall reach. All values are relative to the position of the panel. The suggested values are adjusted for the type of apartment shown in the pictures.

Once you've clicked on "Store and offer", the infotexts (mouseover descriptions) of all those nodes that have owners and which are now part of the apartment are changed automaticly. They indicate which apartment i.e. the chest or door belongs to. The panel can now be used to actually rent the apartment:
Image

After a player who wants to rent it clicked on the rent-button, the panel will show who rented the apartment. The infotexts of the locked objects again change accordingly.
Image
If a player no longer wants to live in his apartment, he can click on the "move out" button. The apartment will then be free for rent again. In case the player forgot any items in the locked chests, he can rent the apartment again in order to take those items out.

Players who have been banned or which admins want to move out for other reasons can be thrown out of apartments by clicking on the "move out" button - provided you do have the apartment_unrent privilege.

Since there can be many apartments, and finding back to one's own might be tricky for new players, there's an

Code: Select all

/aphome
command that takes the player right in front of the apartment control panel of his rented apartment.

Download: https://github.com/Sokomine/apartment/a ... master.zip
Browse code: https://github.com/Sokomine/apartment
Version: 1.2
Licence: GPLv3
License for textures: same as minetest_game (does not add any new)
Depends on: -nothing-

Supported nodes that change ownership to the player who rented the apartment (not all tested yet):
* default: locked chest, steel door
* locked_sign
* technic: locked iron, copper and gold chests
* inbox
* locks: shared locked chest, furnace, sign, door
* More chests: Dropbox, secred chest, shared chest
* Item frames: frames and pedestrals
* travelnet: travelnet (elevator might be problematic)
* locked travelnet: travelnet (elevator might be problematic)
* money: shop and barter shop
* currency and economy: shop and safe
* BitChange: Bank, moneychanger, warehouse and shop; not toolrepair
* Vendor: vendor and depositor

There is no craft receipe for the apartment control panel. Use /giveme apartment:apartment

The panel may also be used to rent out individual shops or locked signs.

All players who want to rent something have to do is right-click the panel once and click on the rent-buttion :-)

New: Admins can now spawn entire apartment blocks in one go. Just use

Code: Select all

/giveme apartment:build_chest
place that chest where you want to spawn the apartment, fill out the form and enjoy.
Image

This is the sample apartment with horizontal copies set to 4 and vertical copies set to 3:
Image
Experiment with diffrent materials for the houses.

If you no longer want the apartment house, dig the build chest. The nodes in the apartments will be replaced by leaves which will soon decay.

You may spawn up to 20x20 apartments at once, although that's a bit much. Try to stick to a reasonable number so that your server will not look boring.

It is also possible to add own schematics if you want to use a diffrent type of apartment on your server. You can either create a schematic with worldedit or you can build the apartment, attach an apartment control panel - and initiate saving of that apartment as a schematic by adding "save_as_" in front of the apartment's name - i.e. name it "save_as_myapartment". Provided you do have the apartment_unrent priv, you'll find a file schems/myapartment_0_90.mts (instead of 90, it may be 0, 180 or 270), and you'll be able to use myapartment_0_90 as the file name in the apartment spawn chest. Make sure that your apartment either contains the right OR left wall, and either contains the floor OR the ceiling. Else you'll have walls or floors 2 blocks thick.

The huge advantage of this way of placing apartments in the world is that they will be set up automaticly and are ready to rent immediately. The only thing you'll have to do is the missing floor or ceiling plus one wall. You may of course also add further decoration.

Once you are satisfied with your building, remove the build chest with worldedit in order to avoid accidental digs.
Attachments
screenshot_1127221577.png
screenshot_1127221577.png (148.61 KiB) Viewed 2887 times
screenshot_1049495609.png
screenshot_1049495609.png (270.11 KiB) Viewed 2887 times
screenshot_1131295729.png
screenshot_1131295729.png (385.48 KiB) Viewed 2887 times
Last edited by Sokomine on Sun Jul 01, 2018 15:01, edited 5 times in total.
A list of my mods can be found here.

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

by CraigyDavi » Post

This is brilliant! Thanks for this :)

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

Amazing ...

User avatar
Novacain
Member
Posts: 285
Joined: Sat Aug 31, 2013 01:03
Location: Skaaro

by Novacain » Post

hmm... it's an excelent idea, but I do see a potential problem. griefers. people could come in and then grief the area. also, as you are "renting," there should be some money exchange involved. it would allow for people to actually make apartment buildings for a reason.

which, how does it interact with the areas protection mod? I'm thinking as far as having the inside area be rentable, but walls and cielings are owned by the builder.
EXTERMINATE!!!
My Tronrealm modpack
My tronblocks mod

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

Novacain wrote: do see a potential problem. griefers. people could come in and then grief the area.
It does not protect the area. It's the job of whatever protection system you use (i.e. areas) to protect the entire building complex. The advantage here is that you don't have to give players who rent your apartments any building rights. If the area where unprotected, players could just place their locked chests without need for this mod (and soon nothing would be left of the building due to griefers).
Novacain wrote: also, as you are "renting," there should be some money exchange involved.
Perhaps for shops. Those new player apartments are intended as places to store the first digged materials when collecting for a real house. New players arn't rich. The panels can also be used for hotels or larger, more detailed apartment complexes as functional decorative items, but that's not their main purpose.
Attachments
formspec_apartment_3.jpg
formspec_apartment_3.jpg (35.35 KiB) Viewed 2887 times
formspec_apartment_2.jpg
formspec_apartment_2.jpg (32.86 KiB) Viewed 2887 times
formspec_apartment_1.jpg
formspec_apartment_1.jpg (52.02 KiB) Viewed 2887 times
Last edited by Sokomine on Sun Jul 01, 2018 14:57, edited 1 time in total.
A list of my mods can be found here.

User avatar
Novacain
Member
Posts: 285
Joined: Sat Aug 31, 2013 01:03
Location: Skaaro

by Novacain » Post

Sokomine wrote:t does not protect the area. It's the job of whatever protection system you use (i.e. areas) to protect the entire building complex. The advantage here is that you don't have to give players who rent your apartments any building rights. If the area where unprotected, players could just place their locked chests without need for this mod (and soon nothing would be left of the building due to griefers).
oh, so it just tranfers ownership of locked items inside an area, but doesn't allow removal?

if that's the case it would also be nice if there were a temporary area ownership for minimally furnished apartments.
Sokomine wrote:Perhaps for shops. Those new player apartments are intended as places to store the first digged materials when collecting for a real house. New players arn't rich. The panels can also be used for hotels or larger, more detailed apartment complexes as functional decorative items, but that's not their main purpose.
which is why you make it cheap. if you overprice, someone else can come in and take all your customers. think about it, with the money mod, players start with 2,000 money. you could easily make it so that the apartment costs 100 per week (which can be enforced by the owner moving out everyone each week, forcing pay to access their stuff), which isn't too much to have a place to stay while you build your own digs, but can be quite profitable on the side of the builder if it is a server like on of the VanessaE servers that gets a lot of traffic.

as for minegeld, you can get that by harvesting leaves.
Last edited by Novacain on Tue Feb 18, 2014 18:16, edited 1 time in total.
EXTERMINATE!!!
My Tronrealm modpack
My tronblocks mod

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

This seems to be very useful! You create very good mods, Soko!

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

Novacain wrote: oh, so it just tranfers ownership of locked items inside an area, but doesn't allow removal?
It doesn't handle removal/digging. I consider adding a very minimalistic, areas-like protection system for spawned buildings so that the entire building can easily be protected. Allowing players to dig and place inside their apartments would have side-effects - renting nomads (don't know if the term exists in english...) could move into an apartment, dig the furniture, and move on to the next.
Novacain wrote: with the money mod, players start with 2,000 money. you could easily make it so that the apartment costs 100 per week
Unfortionately, there are numerous monetary systems. And I don't like charging anything on time elapsed - I don't think that fits well into the game. The purpose of this here is to give players time so that they can gather enough material - not to start a new economy :-)
A list of my mods can be found here.

User avatar
Novacain
Member
Posts: 285
Joined: Sat Aug 31, 2013 01:03
Location: Skaaro

by Novacain » Post

Sokomine wrote: It doesn't handle removal/digging. I consider adding a very minimalistic, areas-like protection system for spawned buildings so that the entire building can easily be protected. Allowing players to dig and place inside their apartments would have side-effects - renting nomads (don't know if the term exists in english...) could move into an apartment, dig the furniture, and move on to the next.
ah, those were my thoughts too. I originally thought it transferred area ownership as well. my suggestion was basically that a lot of the same code coule be used to allow someone to rent out unfurnished apartments.
Sokomine wrote: Unfortionately, there are numerous monetary systems. And I don't like charging anything on time elapsed - I don't think that fits well into the game. The purpose of this here is to give players time so that they can gather enough material - not to start a new economy :-)
well, the time would be due to the builder "kicking" people out, so they have to pay up. it wouldn't be incorperated into the mod. I just see a whole lot of potential for this mod.
EXTERMINATE!!!
My Tronrealm modpack
My tronblocks mod

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

The mod is now mostly finished. It contains a build chest that allows to place several apartments in one go automaticly - properly set up and ready to rent. You can also easily save your own apartment type and built apartment houses out of that.
A list of my mods can be found here.

freejack
Member
Posts: 72
Joined: Wed Jan 08, 2014 06:37

by freejack » Post

Soko I built an apartment and the entire exterior wall to the right was completely missing. Other than that I have no complaints. Very good idea.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

It is intentional that the right wall is missing (at least when you use the spawn/build chest and the apartments that come with the mod). Imagine what would happen if you create a big apartment complex with several apartments next to each other - and they'd all have a right and a left wall, a floor and a ceiling. Walls consisting of two nodes (right wall from apartment 1, left wall from apartment 2, ceiling from apartment 1, floor from that one above apartment 1..and so on) just don't look good. Try to enter values greater than 1 for horizontal and vertical copies in order to see what I have in mind.

If you want larger apartments that are seperate from each other (i.e. small houses with a lawn around), just save them in the way you want :-)
A list of my mods can be found here.

RebelD
Member
Posts: 30
Joined: Mon Jul 07, 2014 21:34
In-game: Dielan

Re: [Mod] Rent apartment with chests etc. [apartment]

by RebelD » Post

I love the mod. It has great usage. Specially if one wants to focus on rp aspect.
I was also wonderring, if you try to rent it a basic text appears aswell: it's totally free. Is there a way one can adjust it themselfs? Just wondering :)

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Rent apartment with chests etc. [apartment]

by Sokomine » Post

RebelD wrote: I love the mod. It has great usage. Specially if one wants to focus on rp aspect.
Thank you!
RebeID wrote: I was also wonderring, if you try to rent it a basic text appears aswell: it's totally free. Is there a way one can adjust it themselfs? Just wondering :)
You can change the text by searching for "s free!" in the init.lua file and replace it with something else as long as the new text is not too long. If it is too long, the formspec may look ugly and become difficult to read with larger font size.

If your question is weather you can charge players a rent for an apartment - I considered that as well, but I'm afraid it won't work. Players mostly in need will be new players. Those don't have large amounts of money; and even if they do, they'll spend it on less useful things. Plus a rent is problematic as anything time-based may not work well with the diffrent speed and frequency at which players play.

Do you plan to start an RPG server? Advanced mobs might also be intresting for that.

Ah, and I've re-added the original pictures to the initial posting. They're not exactly up-to-date anymore as VanessaE provided far nicer textures for free and occupied appartments :-)
A list of my mods can be found here.

RebelD
Member
Posts: 30
Joined: Mon Jul 07, 2014 21:34
In-game: Dielan

Re: [Mod] Rent apartment with chests etc. [apartment]

by RebelD » Post

You can change the text by searching for "s free!" in the init.lua file and replace it with something else as long as the new text is not too long. If it is too long, the formspec may look ugly and become difficult to read with larger font size.

If your question is weather you can charge players a rent for an apartment - I considered that as well, but I'm afraid it won't work. Players mostly in need will be new players. Those don't have large amounts of money; and even if they do, they'll spend it on less useful things. Plus a rent is problematic as anything time-based may not work well with the diffrent speed and frequency at which players play.

Do you plan to start an RPG server? Advanced mobs might also be intresting for that.

Ah, and I've re-added the original pictures to the initial posting. They're not exactly up-to-date anymore as VanessaE provided far nicer textures for free and occupied appartments :-)[/quote]

Well I've made hogwarts map abit once which I wanted to open for RPG but the giant project got halted at a secondary school tho I might share the map (and all mods the game contains as they are involved, if I find all the people that were involved in making those mods atleast hihi). But next to that map I'm, indeed, now trying to make some stuff like the Mindcrack players/youtubers from Minecraft to do some RP. Depending on my non-rp friend thinks about it tho (hehe) but its definatly handy for that!

About the payment it might be handy with bitcoin mod and a trader mod. With a vendor buying some stone, cobblestone, coal etc for certain amounts of bitcoins. Depending on the building that person wants to rent the price is decided. New players can rent a part for like 20-50 a week which wouldn't be hard to gather.

Atleast thats what I think :P.

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

Re: [Mod] Rent apartment with chests etc. [apartment]

by aldobr » Post

Can you add suport for my mint mod ?

You can program rentals using the API.

scheduler:createbanktransfer(<lodger>, <owner>, <rentvalue>, <firstpaymenttimeinminutes>, <numberofinstallments>, <intervalinminutesbetweeninstallments>)

where

<lodger> = the lessee
<owner> = the owner of the apartment
<rentvalue> = is the value of the rent in minetoon pence
<firstpaymenttimeinminutes> = the time when the first installment will be deduced
<numberofinstallments> = the number of installments of the contract
<intervalinminutesbetweeninstallments> = the time span between one installment and other, ie, the periodicity of the contract.

RebelD
Member
Posts: 30
Joined: Mon Jul 07, 2014 21:34
In-game: Dielan

Re: [Mod] Rent apartment with chests etc. [apartment]

by RebelD » Post

Maybe its also a good idea to make an auto numbering and listing available? Or is that already available somehow?
I have like a 340 appartments on 1 block. To make a city and for rp purposes just to be sure it would be nice to list them all as available but it seems like I need to put in the number of the home 1 by 1 XD

CreeperLord700
New member
Posts: 7
Joined: Sun Dec 14, 2014 00:52

Re: [Mod] Rent apartment with chests etc. [apartment]

by CreeperLord700 » Post

soko, can you add a feauture so you can share the area with trusted players? like up to 5 limit maybe? ts causing problems at VE mostly vanilla minetest_game for me and CreeperFemale. pls do

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Rent apartment with chests etc. [apartment]

by Sokomine » Post

RebelD wrote: Maybe its also a good idea to make an auto numbering and listing available? Or is that already available somehow?
I have like a 340 appartments on 1 block. To make a city and for rp purposes just to be sure it would be nice to list them all as available but it seems like I need to put in the number of the home 1 by 1 XD
There ought to be an auto-numbering system, but I don't remember offhand up to which number it went. Might be that it's too small.

Re: [Mod] Rent apartment with chests etc. [apartment]
CreeperLord700 wrote: soko, can you add a feauture so you can share the area with trusted players? like up to 5 limit maybe? ts causing problems at VE mostly vanilla minetest_game for me and CreeperFemale. pls do
That's not possible because the chests in the apartment are most likely normal chests - those can't be shared. However, if the apartment where to use chests which support a share function, it ought to work equally well. Depending on the type of shared chest, some data may not be reset correctly when leaving an apartment.
In your particular case, please talk to a moderator who's currently online and ask if your chests can be replaced by a shared variant. Might require some unrenting and re-renting of the apartment.
Or just build your own house together :-) The apartments are built as a storage close to spawn to help new players, not as a permanent residence. I'm sure you can build something nicer than a mass-produced appartment!
A list of my mods can be found here.

dannyplaysminetest
Member
Posts: 37
Joined: Sun Jun 28, 2015 19:20
In-game: Danny

Re: [Mod] Rent apartment with chests etc. [apartment]

by dannyplaysminetest » Post

This Mod Caused a serious problem for me in combination with the Homedecor Modpack from (VanessaE) evertime when i get close or up high in the sky to a Spawned Appartment i get loads of serverthread Error messages that its trying to store data staticly or objects inside a certain block but that block already contains 49 items deleting all of them. It causes serious lag and game to crash over and over again, i delleted my map started a new world, left the HomeDecor Modpack out of my collection of mods in my new world and problem solved, here is the proof no more Error messages :

Image

Notice no Mailboxes and there are no signs inside the building..
Problem solved for me! ^_^

i did some testing, if i would install the Homedecor modpack again and spawn a new appartment the problem wil return..

johnadmise
New member
Posts: 1
Joined: Tue Aug 28, 2018 05:08

Re: [Mod] Rent apartment with chests etc. [apartment]

by johnadmise » Post

This is a very helpful for people for getting rental property, Thank you for sharing this article.

Franklin100
New member
Posts: 1
Joined: Sun Apr 12, 2020 23:47
GitHub: Franklin100
IRC: Franklin100
In-game: Franklin100

Re: [Mod] Rent apartment with chests etc. [apartment] (5.2)

by Franklin100 » Post

I have a question, is there the same mod but from minetest 5.2?

j45
Member
Posts: 12
Joined: Fri Jul 28, 2017 19:32
GitHub: Minetest-j45
IRC: j1233
In-game: j1233 j45
Location: Cambridge, England, UK
Contact:

Re: [Mod] Rent apartment with chests etc. [apartment]

by j45 » Post

hi guys, firstly, the control panel is different for me and secondly, it wont let me rent it help plz

joneselisa275
New member
Posts: 2
Joined: Mon Jul 13, 2020 10:37

Re: [Mod] Rent apartment with chests etc. [apartment]

by joneselisa275 » Post

At least half of the popular fallacies about economics come from assuming that economic activity is a zero-sum game, in which what is gained by someone is lost by someone else. But transactions would not continue unless both sides gained, whether in international trade, employment, or renting an apartment.

joneselisa275
New member
Posts: 2
Joined: Mon Jul 13, 2020 10:37

Re: [Mod] Rent apartment with chests etc. [apartment]

by joneselisa275 » Post

I can pay my rent now. I guess I could always do that, but now I can get an apartment with heat.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 9 guests