ID:178674
 
How would you do that?
pop is a var?
In response to Winbiko
Winbiko wrote:
pop is a var?

i think he means population
In response to SuperGoku15
Can I see your code so far?
In response to Winbiko
why?
In response to Tazor07
I could help you better.
In response to Winbiko
I just need the code or an example of how you do it, i dont need to fix my code
In response to Tazor07
Tazor07 wrote:
I just need the code or an example of how you do it, i dont need to fix my code

Meaning you have no code? We have no idea how you reference houses or buildings or population, so don't complain if this doesn't fit... it does, however, answer the question:

if(get_dist(building, house) == 9)
pop += 2
In response to Skysaw
Skysaw ya thats why I was hoping for him to give me his code so I could use the right vars. :) oh well.
Tazor07 wrote:
How would you do that?

You need to be a lot more specific in your question.

Are you asking whether a specific building is 9 tiles away, or just any building of a specific type like /obj/bldg/restaurant? When you ask if it's 9 tiles away, do you mean exactly 9 tiles, 9 tiles or less, or 9 tiles or more? Do you want house.pop to increase by 20 for each building of a given type that meets the criteria, or just add 20 once if at least one such building is found?

Lummox JR
In response to Winbiko
Winbiko wrote:
Skysaw ya thats why I was hoping for him to give me his code so I could use the right vars. :) oh well.

Exactly... that's what I was referring to. I'm just waiting for him to come back and ask why the code I gave him doesn't work in his game. :-)
In response to Skysaw
Sand
icon = 'Turf.dmi'
icon_state = "Sand"
Click()
if(usr.build_type)
if(usr.build_type == /turf/Residental)
if(usr.Cash <= 100)
usr << "You do not have enough cash."
if(usr.Cash >= 100)
usr.Cash -= 100
Pop += 20
new usr.build_type(src)
if(usr.build_type == /turf/PowerPlant)
usr.Cash -= 5000
new usr.build_type(src)
for(var/turf/Residental/T in oview(9))
if(src.loc==T)
Pop += 20

obj
items
PowerPlant
icon_state = "PowerPlant"
New(client/C)
screen_loc = "2,3"
C.screen+=src
var/newtype = /turf/PowerPlant //or whatever type you want
Click()
usr.build_type = newtype

The obj/items/powerplant is a hub menu. The turf/sand is where you can place it. i want it so it increases the pop by 20 for every house found in a 9 tile area of the power plant.