Doing some more work trying to find a 'workaround', I
discovered the problem isn't entirely with MapToScreen() but
more with GetPersonY() and GetPersonX().
When a person goes off the bottom of the screen, it keeps
adding or subtracting to the value.
For example, if my map is 1200 pixels tall (75 tiles x 24 pixels
per tile) a character could go off the bottom and technically
be at Y=100, but the engine will return 1300 which confuses
MapToScreenY().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Doing some more work trying to find a 'workaround', I
discovered the problem isn't entirely with MapToScreen() but
more with GetPersonY() and GetPersonX().
When a person goes off the bottom of the screen, it keeps
adding or subtracting to the value.
For example, if my map is 1200 pixels tall (75 tiles x 24 pixels
per tile) a character could go off the bottom and technically
be at Y=100, but the engine will return 1300 which confuses
MapToScreenY().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Doing some more work trying to find a 'workaround', I
discovered the problem isn't entirely with MapToScreen() but
more with GetPersonY() and GetPersonX().
When a person goes off the bottom of the screen, it keeps
adding or subtracting to the value.
For example, if my map is 1200 pixels tall (75 tiles x 24 pixels
per tile) a character could go off the bottom and technically
be at Y=100, but the engine will return 1300 which confuses
MapToScreenY().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made a simple work around. Since I already was storing the
camera's X and Y into a variable because of some dynamic
camera moving scripts I was working on, I used that.
[code]
function myMapToScreenY(loc)
{
loc -= system.cameraY
loc += GetScreenHeight()/2
return loc;
}
function myMapToScreenX(loc)
{
loc -= system.cameraX
loc += GetScreenWidth()/2
return loc;
}
[/code]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=937308
If it matters I'm also using 800x600 resoloution?
Logged In: NO
Doing some more work trying to find a 'workaround', I
discovered the problem isn't entirely with MapToScreen() but
more with GetPersonY() and GetPersonX().
When a person goes off the bottom of the screen, it keeps
adding or subtracting to the value.
For example, if my map is 1200 pixels tall (75 tiles x 24 pixels
per tile) a character could go off the bottom and technically
be at Y=100, but the engine will return 1300 which confuses
MapToScreenY().
Logged In: NO
Doing some more work trying to find a 'workaround', I
discovered the problem isn't entirely with MapToScreen() but
more with GetPersonY() and GetPersonX().
When a person goes off the bottom of the screen, it keeps
adding or subtracting to the value.
For example, if my map is 1200 pixels tall (75 tiles x 24 pixels
per tile) a character could go off the bottom and technically
be at Y=100, but the engine will return 1300 which confuses
MapToScreenY().
Logged In: YES
user_id=937308
Doing some more work trying to find a 'workaround', I
discovered the problem isn't entirely with MapToScreen() but
more with GetPersonY() and GetPersonX().
When a person goes off the bottom of the screen, it keeps
adding or subtracting to the value.
For example, if my map is 1200 pixels tall (75 tiles x 24 pixels
per tile) a character could go off the bottom and technically
be at Y=100, but the engine will return 1300 which confuses
MapToScreenY().
Logged In: YES
user_id=937308
oops sorry for the triple post, was having trouble getting it to
work I figured 'cause I wasn't logged in =Z.
Logged In: YES
user_id=937308
I made a simple work around. Since I already was storing the
camera's X and Y into a variable because of some dynamic
camera moving scripts I was working on, I used that.
[code]
function myMapToScreenY(loc)
{
loc -= system.cameraY
loc += GetScreenHeight()/2
return loc;
}
function myMapToScreenX(loc)
{
loc -= system.cameraX
loc += GetScreenWidth()/2
return loc;
}
[/code]
Logged In: NO
if the values keep adding, use modulus to restore the x & y