ID:178674
![]() Apr 18 2002, 12:53 pm
|
|
How would you do that?
|
![]() Apr 18 2002, 12:53 pm
|
|
pop is a var?
|
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 |
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 |
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. :-) |
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. |