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 05-23-2007, 02:37 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
script/math question

Well, I can't seem to find a algorithm/function for it..
Like, if you have a music length, lets see 3mins and 2 secs

0 = 0 ---> 1 = 3.20mins
0 is 0 and 1 is max (3.20 mins)
like percentage, but with lower number (0 -> 1)

Or, if you have a rgb from a program (like paint) which is probably max 255 if I remember
0 = 0
1 = 255

Easy Example:
Max: 2

0 = 0
0.1 = 0.2
0.2 = 0.4
0.3 = 0.6
0.4 = 0.8
0.5 = 1
0.6 = 1.2
0.7 = 1.4
0.8 = 1.6
0.9 = 1.8
1 = 2

I'm using this for a GuiProgressCtrl control..
__________________
Reply With Quote
  #2  
Old 05-23-2007, 02:52 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
(currentnumber/maxnumber)
(rgbvalue/255)
(musicpos/musiclen)
Is that what you're looking for?
Reply With Quote
  #3  
Old 05-23-2007, 02:57 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Yeah, for percentages you always just do (currentnumber/highestnumber)
0/anything = 0
anything/anything = 1

Get it?
__________________
Do it with a DON!
Reply With Quote
  #4  
Old 05-23-2007, 03:18 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Just what I needed, Thank you both

Quote:
Originally Posted by zokemon View Post
Yeah, for percentages you always just do (currentnumber/highestnumber)
0/anything = 0
anything/anything = 1

Get it?
Thanks
__________________
Reply With Quote
  #5  
Old 05-23-2007, 03:36 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Not a problem!
__________________
Do it with a DON!
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 01:21 AM.


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