Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-22-2003, 03:27 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
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 @_@.
__________________

Reply With Quote
  #2  
Old 02-22-2003, 04:41 AM
Falados Falados is offline
Cucumber NPC
Falados's Avatar
Join Date: Jan 2003
Posts: 141
Falados is on a distinguished road
Send a message via ICQ to Falados Send a message via AIM to Falados
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.
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 02-22-2003, 06:57 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Hey guy, why not just use a complimentary gani? Like the stuff over the guy's head in the tutorial.
__________________
Reply With Quote
  #4  
Old 02-25-2003, 11:59 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Uhm, why use screenx/y for exact displaying of stuff?
Reply With Quote
  #5  
Old 02-25-2003, 01:35 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
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.
__________________

Reply With Quote
  #6  
Old 02-25-2003, 01:54 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
It is always fun to give some code illustrating the problem.
__________________
Reply With Quote
  #7  
Old 02-25-2003, 09:51 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
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;
}
__________________

Reply With Quote
  #8  
Old 02-26-2003, 12:08 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to 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));
}

__________________
new account: Trevor
Reply With Quote
  #9  
Old 02-26-2003, 12:26 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
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
__________________

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:39 PM.


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