Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   screenx/y() bug? (https://forums.graalonline.com/forums/showthread.php?t=42960)

CheeToS2 02-22-2003 03:27 AM

screenx/y() bug?
 
Ok. I'm trying to use screenx(x,y) & screeny(x,y) to display 3 images above an npc precisely (pixel-wise), and i'm experiencing 2 problems.
1) It doesn't work serverside
2) It returns negative values, even when the x/y I specified is clearly in my screen range.

Im also using setshape2 if it matters.

EDIT: strange, it only shows it incorrectly when its used in the if created event, I used it in a timeout loop & the numbers were correct @_@.

Falados 02-22-2003 04:41 AM

Re: screenx/y() bug?
 
Quote:

Originally posted by CheeToS2
1) It doesn't work serverside
It shouldn't, how the hell would the server know your screen size and resolution?
2) It returns negative values, even when the x/y I specified is clearly in my screen range.
Beats me about this one, but if its server side, I explained above that it shouldn't work regaurdless.

Kaimetsu 02-22-2003 06:57 AM

Hey guy, why not just use a complimentary gani? Like the stuff over the guy's head in the tutorial.

Loriel 02-25-2003 11:59 AM

Uhm, why use screenx/y for exact displaying of stuff?

CheeToS2 02-25-2003 01:35 PM

Quote:

Originally posted by Loriel
Uhm, why use screenx/y for exact displaying of stuff?
that isn't my point anymore, now its just the fact that they're returning invalid values within the created event >.>
I'd edit the post, but I can't.

Kaimetsu 02-25-2003 01:54 PM

It is always fun to give some code illustrating the problem.

CheeToS2 02-25-2003 09:51 PM

Quote:

Originally posted by Kaimetsu
It is always fun to give some code illustrating the problem.
Put the npcs right in front of each other, make sure they'll be displayed on your screen when you press play/enter the level.

Example of bug:
if (created){
setimg block.png;
setcharprop #c,#v(screenx(x+3,y)) - #v(screeny(x,y));
}

Example of it working:
if (created) {
timeout=.05;
}
if (timeout){
setimg block.png;
setcharprop #c,#v(screenx(x+3,y)) - #v(screeny(x,y));
timeout=.05;
}

tlf288 02-26-2003 12:08 AM

It is because Graal takes a minute (well, .05 seconds to be percise) to load the screenx\y variables.

Try the code to test my theory
NPC Code:

if (created) {
sleep.05;

setimg block.png;
setcharprop #c,#v(screenx(x+3,y)) - #v(screeny(x,y));
}


CheeToS2 02-26-2003 12:26 AM

Quote:

Originally posted by tlf288
It is because Graal takes a minute (well, .05 seconds to be percise) to load the screenx\y variables.

Try the code to test my theory
NPC Code:

if (created) {
sleep.05;

setimg block.png;
setcharprop #c,#v(screenx(x+3,y)) - #v(screeny(x,y));
}


Works, but its a bug nonetheless. :x


All times are GMT +2. The time now is 01:53 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.