ID:1880591
 
(See the best response by Lummox JR.)
Code:
changeBuild(var/newBuild)
var/list/builds = buildList[currentBuild]
for(var/obj/ChangeBuild/Build in view(100))


Problem description:

Someone help refresh my memory. I'm trying to intialize a proc that looks for the "ChangeBuild" objs in view, which basically at race creation screen ( via-map) But when I start it up, and click the obj on map, it does nothing , I've chcked layers and all.

IT seems to only work if I do client.screen , but I want to find an easier way since I've already done the work of making the obj/vars.

Can anyone tell me what im doing wrong?

Whats the proper term for a for() proc for something in your view?
It looks like you've defined a verb, is this even under /mob (but I can't tell because you didn't add that bit). In either case, I don't remember if view's first parameter is set properly in the case of verbs and you may have to add view(usr, 100) if it's a verb.
It's a proc under this: http://prntscr.com/7kmojc
Is that its own class? I haven't worked with the language for about 6 months now, so someone will have to correct me if I'm wrong but I believe the view() proc makes the src its center.

Try this:

changeBuild(var/newBuild)
world << "[src.loc]"
var/list/builds = buildList[currentBuild]
for(var/obj/ChangeBuild/Build in view(100))


See if the location of the object is within view of the stuffs.
You are doing it wrong. Character creation should be done in the client's screen. If you have to find an object that's in the client's screen, you aren't storing data that you should be.

Use variables.
Additionally, view(100) isn't going to work because view() is range-limited.
Ah... so client screen work eh? I noticed a slight change from what I was use to back in the day of programming,

screen_loc = "0:0,0:0" <-- Lol, It's hard positioning with that for some reason, is there an easier way? It takes me forever to get em right.
I actually agree that working with those screen loc strings are a massive pain in the ass, it'd be better to think of the screen as a canvas with just absolute pixel x and y coordinates.
Best response
Maybe I can add easier-to-manage coords at some point. It'd actually be nice also to be able to get fractional coords when a map is scaled, for more accuracy.
:) Much obliged byondmin.
In response to Lummox JR
Lummox JR wrote:
Maybe I can add easier-to-manage coords at some point. It'd actually be nice also to be able to get fractional coords when a map is scaled, for more accuracy.

Yes to this please.