ID:175222
 
How could I make something where you press a verb and a house apears around and under you, Like the turfs for the house automaticly go around you, but if one of the area's one of the turf's goes on is dense then you cant place the house there?????
Will somebody please help
In response to Koolguy900095
Koolguy900095 wrote:
Will somebody please help

No no one will help... Why you ask? You made an illegal bump and you just asked for the code to be handed to you without ever trying anything yourself. Fix those and help may come your way.

Resonating Light
In response to Resonating_Light
Ok, so he bumped a little early, but he had a good question, and did not do it in a rude way. He asked how he could do it, not if someone would make it for him. Please pay attention to someones wording.
In response to Resonating_Light
What the heck are you talkin about how is this bumb illegal? It was on the seocond page, if its been 24 hours of if its on the second page you can bump! And who are you to tell me I havent tried this before!?
In response to Koolguy900095
Technically it was an "illegal" bump - it was 21.5 hours, rather than 24 hours. But being that picky is just silly.

Just ignore him!
In response to Crispy
Yeah I know, but wasnt it legal because it was on the second page?
In response to Koolguy900095
It's generally accepted that it has to be 24 hours AND on the second page, I believe.
In response to Crispy
Somebody please help...
In response to Koolguy900095
OK. I'm not gonna hand you all the turfy bits, but I'll give you the checking the turfs bit.
for(var/turf/a as turf in block(insert measurements for house here))
if(a.density)
src << "The house will not fit!"
break

I think that works... I don't use block.
In response to Hazman
Well actualy its not working...This is the coding im using:
        for(var/turf/a as turf in block(3,4))
if(a.density == 1)
src << "The house will not fit!"
return
for(var/obj/a as obj in block(3,4))
if(a.density == 1)
src << "The house will not fit!"
return
In response to Koolguy900095
Look up the arguments for block().
In response to Garthor
Ok well this is what I have, doesnt seem to be working either:
        for(var/turf/a as turf in block(locate(usr.x+1,usr.y+3,usr.z),locate(usr.x-1,usr.y+3,usr.z)))
if(a.density == 1)
src << "The house will not fit!"
return
for(var/obj/a as obj in block(locate(usr.x+1,usr.y+3,usr.z),locate(usr.x-1,usr.y+3,usr.z)))
if(a.density == 1)
src << "The house will not fit!"
return


Anyone know whats wrong with it and how I could fix it? Thanks!
In response to Koolguy900095
Koolguy900095 wrote:
Anyone know whats wrong with it

You tell me. =P What about it isn't working?

(Make sure that usr is the best thing to use here; depending on where that code is, src might be better.)
In response to Crispy
I changed it to src and it still doesnt work. Whats its not doing is if there is something with a density of 1 it will build on top of it, im trying to make it so you cant build over dense objects and it says "The house will not fit". If block() isnt what im supposed to use to do this what do I use?
In response to Koolguy900095
block() returns a list of TURFS, not objs. Even so, a much more effective method would be to use the Enter() proc, assuming that src will always be dense, of course. Also, no need for the "as turf" part.

for(var/turf/t in block(...))
if(!src.Enter(t))
return
In response to Crispy
Illegal bump? Are there rules about saying "Please Help Me!" before a certain time is up?
In response to Dragon of Ice
Dragon of Ice wrote:
Illegal bump? Are there rules about saying "Please Help Me!" before a certain time is up?

Yes, the moderators will delete bumps that don't appear to be legitimate -- that is, without sufficient time having passed or other reasons that the message might get overlooked.

Various people might have various interpretations of what is reasonable; mostly it's a case-by-case basis, and mostly it's to discourage people who bump within minutes of posting, or do multiple bumps in a row.
In response to Garthor
Thanks, but it only worked once and now ti wont work...Here's what I have:
        for(var/turf/a in block(locate(src.x+1,src.y+3,src.z),locate(src.x-1,src.y+3,src.z)))
if(a.density == 1)
src << "The house will not fit!"
return
for(var/obj/a in block(locate(src.x+1,src.y+3,src.z),locate(src.x-1,src.y+3,src.z)))
if(a.density == 1)
src << "The house will not fit!"
return


Any idea whats wrong? Sorry Im having so many problems :(. Thanks for all your help!

Edit: I just figured out it only checks for things that are dense in the area around the block. So if the dense thing is in the inside it wont detect it. Any idea how to make it so it checks both the inside and the area around?
In response to Garthor
Gah I found another Little error. Im trying to make it so that the Doors Lisencer eqauals the owner's Lisenced, but its not working...Here's my coding:
mob/var/list/Lisenced = list()
obj
house
var/lastx
var/lasty
var/lastz
Door
var/list/Lisencer = list()
var/owner
density = 1
icon = 'Turfs.dmi'
icon_state = "Door"
verb
Lisence()
var/lisencing = input("Enter the name of the person you would like to lisence.","Lisence")
usr.Lisenced += lisencing
Open()
set src in oview(1)
set category = "Door"
Lisencer = owner.Lisenced
if(owner == usr || Lisencer.Find(usr))
src.icon_state = "Door_Open"
density = 0
Close()
set src in oview(1)
set category = "Door"
Lisencer = owner.Lisenced
if(owner == usr || Lisencer.Find(usr))
if(src.icon_state == "Door_Open")
src.icon_state = "Door"
density = 1
New()
usr.verbs += /obj/house/Door/verb/Lisence
owner = usr

And the error is:
Main.dm:92:error:owner.Lisenced:undefined var
Main.dm:99:error:owner.Lisenced:undefined var

But that var is defined! Im so confused. Do you know whats wrong? If so pelase tell me and mayeb tell me how I can fix it. Thanks! (Oh and this isnt a bump cause my post was already at the top.)
Page: 1 2