Page 1 of 1

x and y

PostPosted: Wed Jul 04, 2007 5:25 pm
by Kodo
Question for Makslane really, unless anyone else happens to know the answer (Fuzzy? Anyone?) :)

Is the value returned when referencing an actors x and y unsigned? I ask because I've got this problem that appears to be based on the players position on the grid.

I'm trying to create a new actor at the players x and y position, which works fine in parts of the grid where the x and y are positive, but when they are negative they don’t seem to appear. If the x and y values were unsigned that might explain it, the new actors are being created but not at the right coordinates, when they should appear at say -200, -200 they actually appear at 200, 200.

What might be the best solution to this, without me moving the entire map so that it is located in only positive areas of the grid (which will render 3/4 of the available grid useless :().

PS. I guess the problem also applies to other default position/grid related actor variables.

PostPosted: Wed Jul 04, 2007 5:37 pm
by Sgt. Sparky
I have never had this problem when displaying the actors X and Y coordinance.
but are you using relative to the actor or relative to the game center?
(true = game center, false = actors x and y)
EDIT:
you could also use on the create actor event of your other actor(that you are creating.),
Code: Select all
x = youractor.x;
y = youractor.y;

:D

PostPosted: Wed Jul 04, 2007 5:44 pm
by makslane
x and y are signed variables (double).
Can you post a little sample with the problem?

PostPosted: Wed Jul 04, 2007 6:39 pm
by Kodo
It seems that this is only a problem on a GP2X exported game, it's working fine in the editor and in a windows exported game :( (I havent tried on PPC though).

x and y are signed variables (double).


I thought that it'd be unlikely that they were unsigned, just thought I'd check as that is the kind of effect I'm seeing.

I'll knock up a very simple ged that repeats the problem on GP2X, and test it on PPC but I think now it must be a problem either with the GP2X exporter or the hardware?

Thanks

PostPosted: Wed Jul 04, 2007 7:06 pm
by Kodo
Okay, I've now tested it on PC and Pocket PC and both work fine, it's just on the GP2X that this is a problem.

Here's a ged file example (dead simple) and three exe files (one for each platform).

http://www.cosymobile.com/ge/x_y.zip

Thanks

PostPosted: Wed Jul 04, 2007 7:34 pm
by makslane
I will see waht's happen.