x and y

Non-platform specific questions.

x and y

Postby Kodo » Wed Jul 04, 2007 5:25 pm

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.
Inogames: http://www.inogames.com iOS gaming
Firetop Adventure (app store): http://itunes.apple.com/us/app/firetop- ... ?mt=8&ls=1
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Postby Sgt. Sparky » Wed Jul 04, 2007 5:37 pm

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
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby makslane » Wed Jul 04, 2007 5:44 pm

x and y are signed variables (double).
Can you post a little sample with the problem?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Kodo » Wed Jul 04, 2007 6:39 pm

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
Inogames: http://www.inogames.com iOS gaming
Firetop Adventure (app store): http://itunes.apple.com/us/app/firetop- ... ?mt=8&ls=1
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Postby Kodo » Wed Jul 04, 2007 7:06 pm

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
Inogames: http://www.inogames.com iOS gaming
Firetop Adventure (app store): http://itunes.apple.com/us/app/firetop- ... ?mt=8&ls=1
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Postby makslane » Wed Jul 04, 2007 7:34 pm

I will see waht's happen.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest