# how to get a value at runtime

## Recommended Posts

I am making a game in c sharp XNA. i want to get a value at the runtime that is the player's position in the form of vector. how will i do that. plus i have an xyz plane value .how will i convert it to an integer value.

##### Share on other sites
smitty1276    560
If you want the position of the player, you need to keep up with that in your code... there is no intrinsic "player position" in XNA.

I'm not sure what you are talking, regarding the integer/plane question.

##### Share on other sites

the syntax in C sharp.

##### Share on other sites
and the second question is

that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.

##### Share on other sites
Hodgman    51220
Quote:
 Original post by meherzadand the second question is that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.
What does comparing a plane with an integer mean?? When is an integer greater than a plane? Is an apple less than an orange?

##### Share on other sites
Nypyren    12061
bool Compare(Plane p, int i){  throw new Exception("WTF is this shit?");}

That should do what you want.

##### Share on other sites
erissian    727
Quote:
 Original post by meherzadI am making a game in c sharp XNA. i want to get a value at the runtime that is the player's position in the form of vector. how will i do that.

This isn't something you read, this is something you set.

Quote:
 i have an xyz plane value .how will i convert it to an integer value.

I'm more curious about what problem you believe this is a solution to - maybe we can find a method that makes sense.

##### Share on other sites
Zahlman    1682
Quote:
 Original post by meherzadand the second question is that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.

Planes cannot be "ordered", because they can (and in fact, almost always do) intersect (meaning that you can't meaningfully say one is "less than" the other). Why do you want to do this comparison? What do you think it will help you do?

##### Share on other sites
My guess is that he wants to calculate the closest/perpendicular distance to the plane from the player's position. (So he can make test like if(dist < 0) { /*position is under ground */ }.

And I guess he means scalar and not integer..