[b]What is Properties Mod?[/b]
This mod allows players to buy doors in full sets. So for example, if you have an apartment building or hotel, you can set it up that players, can't buy the entrance door, and nothing else. This forces them to own all the doors (for example the balcony or bathroom door) in the room. You can also set different prices for each room. For example, if you want to have "basic" room cost a $100 and have the top, executive floor cost $2000.
[b]Features[/b]
- Easy to config
- Unlimited doors per room
- Unlimited NPCs (With Whitelist & Blacklist support)
- Dynamic GUI
- Easy to understand & modify the code
[b]Media[/b]
[media]http://www.youtube.com/watch?v=RM_RsNl9kwQ[/media]
[I]ignore the music, I was listening to a playlist and forgot to turn it off and its almost 1am so I didn't want to re-record[/I]
[I]Update v1.2 - Preview Mode[/I]
[media]http://www.youtube.com/watch?v=FZ_jP_m4HVg[/media]
[b]Setup[/b]
Install into the respective DarkRP-Modification addon folders.
Open sh_config.lua
Find the vector that you want for your NPC and place it in the pos field for NPCSpawns.
PropertyDoors and DoorLookUp come in pairs. To set up a property, copy and paste, or replace the dummy entries with this:
[lua]
Properties.PropertyDoors[1] = { ["price"] = 100, ["name"] = "Tides Hotel Room 1"}
Properties.DoorLookUp[1] = {1362, 1363}
[/lua]
Make sure the index is unique, and doesn't conflict. Price & name are self explanatory.
The door look up are the doorIndex numbers that are used by DarkRP. To find the doorIndex, in game, go to the door you want to find the index of, and look at it. Then type this into the console:
[code]
lua_run print(player.GetByID(1):GetEyeTrace().Entity:doorI ndex())
[/code]
The number returned is the index you want to add to the door look up. You can add as many doors as you want to the table.
[b]Extension[/b]
This is mainly for devs that want to customise the mod.
The only 2 functions you'll need to use is:
[lua]
meta:doorIndex()
[/lua]
This is a built in darkRP function, this returns the special door number used in darkrp.
[lua]
DoorIDtoPropertyID(doorID)
[/lua]
This takes in the doorIndex (see above how to get it) and returnes the property ID, you can use this to get information on the Property using the table in the config. For example:
Server side
[lua]
//Lets say that door entity, is an actual entity.
local ent = doorEntity
local doorID = ent:doorIndex() //doorIndex is a Server side function in DarkRP
if DoorIDtoPropertyID(doorID) != nil then
print(Properties.PropertyDoors[DoorIDtoPropertyID(doorID)].Name) //This would return the name of the property dynamically using the door
end
[/lua]
Client Side (For HUDs or something)
You have to use the Entity index in conjunction with the EandDIndex table. The keys are basically entity indexs and the values are the doorIndex. This is because doorIndex is a serverside only function, so we network the door indexs we need to the client.
[lua]
local entID = ent:EntIndex()
local doorID = Properties.EandDIndex[entID]
local propID = DoorIDtoPropertyID(doorID)
print(Properties.PropertyDoors[DoorIDtoPropertyID(doorID)].Name)
[/lua]
[b]Planned features[/b]
[del]- Allow a whitelist of properties certain npcs can sell.[/del] Added in v1.1
- No other planed features. Got an idea? Request it!
Any feedback or suggestions are welcome.
[b]Download[/b]
[URL="https://github.com/Alig96/drp_Properties"]Download it on Github[/URL]
You must be on the latest version of DarkRP, [URL="https://github.com/FPtje/DarkRP/commit/b5ad0c2890d0615e2748e10ed2dc40af2ba25e0c"]since it makes use of a hook that was added today[/URL] and doorIndex function (which IIRC isn't in the older versions). So this means there is [U]no 2.4.3 support[/U].
I made this for a friend, since he was attempting to make it, but he didn't know how. Shout out to DS! He made me make it!
[b]Credits[/b]
Me - Made basically everything
DS - Idea & Config for Rp_evocity_v33x
AirBlack - Client-side GUI
I have made a swep to get door IDs easier. Link soon.
Link to property tool [url]http://www.mediafire.com/download/d99q88gkzb8k1a6/property_tool.zip[/url]
Install: Put the property tool into darkrpmodification/lua/weapons
In game open your "Q" menu and browse to the weapons tab under the "property tool" category to give yourself it.
Look at a door and press left/right click. The ID will be printed into chat and console. Copy it from the console and paste it into sh_properties.lua the proper way.
[lua]Properties.PropertyDoors[1] = { ["price"] = 200, ["name"] = "PropertyNameHere"}
Properties.DoorLookUp[1] = {ID HERE, ID Here}[/lua]
EDIT: Shoutout to Alig for having me under hours of slave labor working on configs for maps ;)
Wow, didn't expect something like this to come out for free.
Does it have any preset maps allready?
Thanks!
I thought about selling it, but I was supposed to be teaching Ds how to make it himself, however I just ended up making it all since it was faster than trying to explain everything behind it, since I wasn't in a good mood. So since it was originally meant to help him, it didn't feel right selling it. Anyway, it only took me a few solid hours to make. There's that, and also when he asked me and showed me what he had done already, he started with the client side code! Lua Pro Tip: Only use the client for display! Do everything else on the server and only send relevant data!
I believe Ds has a config for a downtown map and evo city, so if he's willing to share, then yes.
Allright, nice! You will be helping alot of people with this, also pretty interesting background story.
[QUOTE=Poop2heaven;45071678]Allright, nice! You will be helping alot of people with this, also pretty interesting background story.[/QUOTE]
Is this the sort of thing people are wanting? I may make other DRP addons in the future any requests? Would anyone want a car dealer or something?
[lua]Properties.PropertyDoors[1] = { ["price"] = 100, ["name"] = "Tides Hotel Room 1"}
Properties.DoorLookUp[1] = {1362, 1363}[/lua]
Instead of doing something like this that will confuse a someone new to lua. May I suggest something like this.
[lua]
AddProperty(100, "Tides Hotel Room 1")
AddPropertyDoor("Tides Hotel Room", 1362, 1363)
[/lua]
In the function AddPropertyDoor the first argument found be the key or value to look up to id the specific entry in the table to allow you to append these door ids(arguments 2 & 3).
I only suggest this because you could fuck up the table. Plus you could be typing less characters doing it via a function and providing arguments instead. Otherwise nice to see a free version of this type of addon. I am aware of a couple that people have been selling.
[QUOTE=Aide;45071883]Snip[/QUOTE]
Good Idea, damn I knew I could've made it easier; How about this to reduce it into one?
[lua]
//Name, Price, Door IDs table
AddProperty("Tides Hotel Room 1", 100, {1362, 1363})
[/lua]
Or would it still be confusing?
Thanks for the advice btw!
Hello peoples. I have a config completed for rp_evocity_v33x with 90% of the doors done. A few are not configured as they make sense to be "unownable" such as the bank door etc. I also have one partially done for downtown_v4c_v2 I'll release downtown when I'm finished. Evocity will be posted here soon!
EDIT: Here's the Evocity config. [url]http://www.mediafire.com/download/g650kd0fzmca2vi/sh_config.zip[/url]
Install: Replace the current sh_config.lua file inside darkrpmodification/lua/darkrp_modules/properties with this new one.
If Alig does update the method of adding doors I will update the file to match the latest git version. :)
[QUOTE=Alig96;45071915]Good Idea, damn I knew I could've made it easier; How about this to reduce it into one?
[lua]
//Name, Price, Door IDs table
AddProperty("Tides Hotel Room 1", 100, {1362, 1363})
[/lua]
Or would it still be confusing?
Thanks for the advice btw![/QUOTE]
Looks pretty simple.
Did a little [URL="https://www.mediafire.com/?2n7mesbbb8gbau8"]improvement for tool[/URL].
Update v1.1
- Added an easier method to create properties
- Added support for multiple NPCs with whitelist and blacklist for certain properties (See sh_config.lua for details)
Yay, you can have different property managers for certain rooms!
Good job! :smile:
Could you add a way to allow players to preview the property before buying?
[QUOTE=kpjVideo;45139480]Could you add a way to allow players to preview the property before buying?[/QUOTE]
I could probably implement images of the property on the side of each.
What would be interesting is if you ghosted the player (made them invisible and intangible) and only let them roam inside the property, allowing them to see firsthand the area without interfering. This could be done easily since you already have the property, and just save their actual location before they preview it.
[QUOTE=Nookyava;45140010]What would be interesting is if you ghosted the player (made them invisible and intangible) and only let them roam inside the property, allowing them to see firsthand the area without interfering. This could be done easily since you already have the property, and just save their actual location before they preview it.[/QUOTE]
Yeah, or a preview button that allowed for a specific camera view of the property.
[QUOTE=Nookyava;45140010]What would be interesting is if you ghosted the player (made them invisible and intangible) and only let them roam inside the property, allowing them to see firsthand the area without interfering. This could be done easily since you already have the property, and just save their actual location before they preview it.[/QUOTE]
Interesting idea; Just thinking how to do this dynamically, since how would I reliably ensure a vector to place the player that is within the property without making the owner set a location? Since I can't set their location exactly where a door is... My first idea was to maybe trace from one of the doors to another and set their position to around the middle of the trace, However this also isn't reliable since it requires more than 1 door set up, maybe I'm over looking something simple, but I can't think how to place them inside without fail. Any ideas?
Well, from what I can gather it's set as a zone, correct? So what you could essentially do is, yes, set the teleportation to where one of the doors are. Just take one of the spots, this won't affect anything regardless because the player will be ghosted and unable to get stuck and interact with things.
[QUOTE=Nookyava;45143858]Well, from what I can gather it's set as a zone, correct? So what you could essentially do is, yes, set the teleportation to where one of the doors are. Just take one of the spots, this won't affect anything regardless because the player will be ghosted and unable to get stuck and interact with things.[/QUOTE]
Is there a convenience function in DRP to "ghost" the player? I haven't played it much, if not, would I just set the collision group of the player and hook into PlayerUse? Or anything else? Also, what would you say is a suitable range away from the door to be set to back to normal?
No, there isn't one. But what I would say is (depending if they go to a property manager to purchase, then have the preview function there and teleport them to the spot, otherwise have on the door a preview option), when they leave the zone whatsoever it teleports them out. What I would suggest is using the RenderScreenspaceEffects hook, and set the colors alpha to 0 if they are previewing, then yes, set collision (make sure to reset afterwards)
[QUOTE=Nookyava;45150325]No, there isn't one. But what I would say is (depending if they go to a property manager to purchase, then have the preview function there and teleport them to the spot, otherwise have on the door a preview option), when they leave the zone whatsoever it teleports them out. What I would suggest is using the RenderScreenspaceEffects hook, and set the colors alpha to 0 if they are previewing, then yes, set collision (make sure to reset afterwards)[/QUOTE]
I would totally agree, I've seen this on some PERP servers and it's quite awesome.
So when I was making the preview mode, when I set the players position to the exact position of the door, I became stuck in a place I could see on both sides of the walls, and just played around with an idea of slide show, I don't know how I feel about it, what do you guys think? Scrap it and carry on with the original plan?
[media]http://www.youtube.com/watch?v=_hyJ6cYrrQ0[/media]
[QUOTE=Alig96;45154903]Aasd[/QUOTE]
Good idea and bad realization. Make something smoother. Use the render library. And teleporting player to room just for spectating is very bad idea. I think it's better to make new panel with renderview opening on preview button press. I will try to make it.
[QUOTE=Alig96;45154903]So when I was making the preview mode, when I set the players position to the exact position of the door, I became stuck in a place I could see on both sides of the walls, and just played around with an idea of slide show, I don't know how I feel about it, what do you guys think? Scrap it and carry on with the original plan?
[/QUOTE]
That looks amazing, Might look better if the player(s) screens are locked in place so they don't have to see the wall glitches.
Eh, I disagree, it doesn't give the best feeling for room size in my opinion.
Hi, thanks and congratulations for your work !
But, i don't understand how to find door's id, can someone help me ? :D
To get the door IDs, you can either use the [URL="http://facepunch.com/showthread.php?t=1400737&p=45073846&viewfull=1#post45073846"]tool provided[/URL] by AirBlack/Ds, or as mentioned in the OP:
[QUOTE=Alig96;45065663]
...To find the doorIndex, in game, go to the door you want to find the index of, and look at it. Then type this into the console:
[lua]
lua_run print(player.GetByID(1):GetEyeTrace().Entity:doorIndex())
[/lua]
[/QUOTE]
[QUOTE=Alig96;45209232]To get the door IDs, you can either use the [URL="http://facepunch.com/showthread.php?t=1400737&p=45073846&viewfull=1#post45073846"]tool provided[/URL] by AirBlack/Ds, or as mentioned in the OP:[/QUOTE]
Oh god, i'm so bad today :tinfoil: thanks, that's work!
Just a short question, has there been any updates or progress in the past few days?
Just wondering :P
Sorry, you need to Log In to post a reply to this thread.