ID:1103302
 
proc/CheckJump(obj/pieces/jumper, obj/pieces/jumped)
for(var/obj/pieces/p in get_step(jumper, get_dir(jumper,jumped)))
world << "test 1"
return 1


Problem description: How do I make it check for all the spaces in that get_step turf that are missing the object pieces? That could help my game.
var/turf/t=get_step(whatever)//make a variable to reference the turf
if(t.contents)//check the turfs contents
world<<"This turf has something in it!"//if something is found, alert the world something is in that turf
else//if the turf is empty
world<<"This turf is empty!"//alert the world the turf is empty


BTW; this is cheating on our bet. I was gonna post and let you know I have $40 on you not finishing, but I didn't want to derail further on that topic and it appears you've already forfeited on your 'coder' doing the work for you.
That coding doesn't help and neither does your comment.
In response to TheDarkChakra
Pretty sure the code is exactly what you asked for. Unless you have something other than the asked object inside the turf. In which case you can use a for() loop.

var/numberofpieces=0//assign a variable a number
for(var/obj/pieces/p in get_step(whatever))//check for objects inside the turf
numberofpieces++//increase for every piece found inside the turf
if(numberofpieces)//if there are pieces found
world<<"There are pieces in that turf!"//alert the world there are pieces
else//if none are found
world<<"There are not any pieces in that turf!"//alert the world there are no pieces found


The comment was a side note, not meant to be related to the code.
No I need something that checks every EMPTY space. Is that not possible with the for operator?
In response to TheDarkChakra
Then why are you asking for something and using get_step? Misdirection much?

for(var/turf/t in world)//check every turf
if(t.contents)//if the turf at this point in the loop has contents
continue//do nothing
else//otherwise
[action]//do whatever you need to

I don't see how you haven't picked up on this yet.
I don't think you're getting me
You mean ALL turfs in a SINGLE direction?

var/turf/t=get_step(whatever)
while(t)
[actions]
t=get_step(whatever)


I don't feel like commenting that.
No.
In response to TheDarkChakra
Then explain your issue better, because I've done exactly what you've stated each time.
I want to check if there is no piece in the turf
In response to TheDarkChakra
That's exactly what my first three post did.
No.
In response to TheDarkChakra
Kay, I'm doing trying to help someone that clearly has no idea what they're doing or what they're asking for, and even if they do, they clearly lack the language skills in any language to convey what they mean.
proc/CheckJump(obj/pieces/jumper, obj/pieces/jumped)
var/no_piece = TRUE
for(var/obj/pieces/p in get_step(jumper, get_dir(jumper,jumped)))
no_piece = FALSE
break
// stuff

If this is not what you want, please explain the issue better.
In response to Jemai1
Does the exact same thing as my second post, except you included break. So I don't think so.

I'm gonna go ahead and assume he means something like

for(var/obj/piece in get_step(whatever) with var)
Which would only display objs with the specified variable in a for() loop. Which obviously isn't supported, mostly because of the workarounds and pointlessness of it with the VERY easy and VERY simple workarounds. Not to mention the fact that the implementation of it would do the exact same thing as the work-around.
In response to NNAAAAHH
NNAAAAHH wrote:
for(var/obj/piece in get_step(whatever) with var)

Which would only display objs with the specified variable in a for() loop. Which obviously isn't supported, mostly because of the workarounds and pointlessness of it with the VERY easy and VERY simple workarounds. Not to mention the fact that the implementation of it would do the exact same thing as the work-around.

What?
In response to Jemai1
Sorry, I'm rather tired, so I'm going to go ahead and assume that I explained this poorly.

The ONLY thing I can think of him asking, outside of what I already presented him with, would be a way to loop through ONLY the turfs that have no object in them.

for(var/typepath/t in container with variable)//which doesn't exists, but in theory would only loop through the typepaths in the list that contained the variable presented.
//where as the work-around of
for(var/typepath/t in container)
if(variable)
[action]
//is MUCH easier, much simpler, and already exists.
Well, one thing is for sure. We have no idea what the OP is talking about. It would help if the following questions are answered:
1. What are these pieces?
2. What is jumper?
3. What is jumped?
4. What is CheckJump supposed to do? Why do you have this proc?
5. Define "missing".
6. By "all pieces", do you mean "all existing pieces inside the turf", "all defined pieces", "all defined pieces that are not in the turf", or what?
7. Where do you want to "check" for these pieces? Is it a single turf or a block of turf?
8. What exactly is the problem at hand?