Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-01-2003, 10:46 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Just wondering.

Take a look at this code:

NPC Code:

//#CLIENTSIDE

if (created || timeout) {
this.h=textheight(.6,Courier New,b);
showtext 200,screenwidth-100,screenheight-this.h,Courier New,b,X:#v(playerx) Y: #v(playery);
changeimgcolors 200,1,1,1,1;
changeimgzoom 200,.6;
changeimgvis 200,4;
message #v(this.h);
timeout = .05;
}



I was testing textheight() yesterday,i understand how it work etc,but i can't figure out how the value is set,i mean,this.h returns 14,so what i want to know is how the calcule was made.

Quote:
textheight(zoom,font,style) calculates
the height of text displayed with the
given zoom factor, font name and style;
I read that at newfeatures,so,each font name and style has a determined value?
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #2  
Old 08-01-2003, 11:22 PM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
pixels? fontsize?
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #3  
Old 08-01-2003, 11:34 PM
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
Did you even ask a question, osrs? You need
more than a question mark to make something
a question. I don't even know what you are
asking .
__________________
new account: Trevor
Reply With Quote
  #4  
Old 08-02-2003, 01:29 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by tlf288
Did you even ask a question, osrs? You need
more than a question mark to make something
a question. I don't even know what you are
asking .
NPC Code:

this.h=textheight(.6,Courier New,b);



Explain me why that variable is equal to 14.
That's what i wanna know,i didn't get how the calculation is done..
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #5  
Old 08-02-2003, 01:36 AM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
It probably checks all characters available to the font and takes the largest height.
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #6  
Old 08-02-2003, 08:07 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Yes, it would do the largest height. But it just checks what it's written/drawn and sees how tall it is... it's not all that hard =x
Think about it, triggeraction works, but you don't know HOW other than that Stefan coded it in... does it really matter HOW opposed to it's actual use?
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #7  
Old 08-02-2003, 09:19 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Projectshifter
it just checks what it's written/drawn and sees how tall it is...
That's very unlikely.
__________________
Reply With Quote
  #8  
Old 08-02-2003, 11:12 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Nah, it's possible, depending no HOW you go about showing things... I dunno about Delphi... but it could set vars and draw the image the size of the vars... does it really matter HOW or WHY it works though as long as we both know it works?
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #9  
Old 08-03-2003, 01:40 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Projectshifter
Nah, it's possible, depending no HOW you go about showing things... I dunno about Delphi... but it could set vars and draw the image the size of the vars...
You said that it would draw the text and then see how big the rendered text is. That would be stupid. It's more likely that the height of the font's surface is modified by zoom parameters etc and outputted directly.

Quote:
does it really matter HOW or WHY it works though as long as we both know it works?
Obviously it matters to the creator of the thread. Are you entitled to tell him not to care?
__________________
Reply With Quote
  #10  
Old 08-04-2003, 12:46 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally posted by Kaimetsu
Obviously it matters to the creator of the thread. Are you entitled to tell him not to care?
HONESTLY, why does everything lately have to be so hostile with you? to find out, you'd have to ask Stefan, but I'm merely stating that it doesn't change anything. That's like asking some random person "Do you live in an urban area or suburban area?" If you never go to that persons house, does it matter all that much? It doesn't change anything in your universe =x
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #11  
Old 08-04-2003, 02:01 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
hey guys,no need to fight.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #12  
Old 08-04-2003, 02:07 AM
voicedcow6666 voicedcow6666 is offline
Registered User
Join Date: May 2002
Location: Texas
Posts: 182
voicedcow6666 is on a distinguished road
Quote:
Originally posted by osrs
hey guys,no need to fight.
I don't think they were fighting as much as Kaim was pointing out the flaws in PS's thinking, which is always fun to do. PS thinks he knows a lot more than he really does. *thinks back to PS and mine's "debate" about coding standards earlier*
__________________
-Zega, Staff Advisor of Delteria
Reply With Quote
  #13  
Old 08-04-2003, 04:56 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Projectshifter
HONESTLY, why does everything lately have to be so hostile with you? to find out, you'd have to ask Stefan, but I'm merely stating that it doesn't change anything.
So what? So he's not allowed to ask? Sometimes people want to know things just out of curiosity.
__________________
Reply With Quote
  #14  
Old 08-04-2003, 09:07 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally posted by voicedcow6666


I don't think they were fighting as much as Kaim was pointing out the flaws in PS's thinking, which is always fun to do. PS thinks he knows a lot more than he really does. *thinks back to PS and mine's "debate" about coding standards earlier*
Thanks Zega, glad to know my old friends are always on me side...
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #15  
Old 08-04-2003, 09:36 PM
voicedcow6666 voicedcow6666 is offline
Registered User
Join Date: May 2002
Location: Texas
Posts: 182
voicedcow6666 is on a distinguished road
Quote:
Originally posted by Projectshifter


Thanks Zega, glad to know my old friends are always on me side...
---Shifter
Heh, sorry that I agree with Kaim over you....I'm also sorry you were acting like a nut in Delt's RC yesterday....I'm also sorry you blocked me on aim because I proved you wrong about coding standards.
__________________
-Zega, Staff Advisor of Delteria
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 12:15 PM.


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