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 04-20-2012, 02:25 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Shield Math Question

Would anyone happen to know a formula for working which part of a shield image would go where on the character?
I am asking because I am going to make a shield viewer just for fun but I am not sure on how to determine which parts are what?
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #2  
Old 04-20-2012, 02:31 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
iirc it went by a ratio D:

edit- found this: http://forums.graalonline.com/forums...1&postcount=15

Quote:
I think that any shield size will technically work, and when you set a shield image for the player, the game automatically totals pixels horizontally and divides them into 4 sections, proportional to how the regular small shields are..and then automatically centers them on the player.
sounds legit?
__________________
Reply With Quote
  #3  
Old 04-20-2012, 03:03 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Thanks!
Just in case it helps anyone here is some data I have acquired.

Overall Dimensions: 38x20

Up: 6x20
Up: 15.789473684210526 %

Left: 8x20
Left: 21.052631578947366 %

Down: 17x20
Down: 44.73684210526316 %

Right 8x20
Right: 21.052631578947366 %

Now I just need to work out a formula to figure out how many pixels any given shield part would be xD
I am not good at mathematics but I shall give it a crack

Well I failed miserably..
Hers was my attempt.
PHP Code:
function WorkOutParts(max){
  
temp.up max/6.714;
  
temp.left max/5.035;
  
temp.down max/2.37;
  
temp.right max/5.035;
  echo(
"UP: "@int(up));
  echo(
"LEFT: "@int(left));
  echo(
"DOWN: "@int(down));
  echo(
"RIGHT: "@int(right));

Any math guru's on here that would be able to work this puzzle out?
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion

Last edited by Gunderak; 04-20-2012 at 04:16 PM..
Reply With Quote
  #4  
Old 04-20-2012, 04:28 PM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
Quote:
Originally Posted by Gunderak View Post
Thanks!
Just in case it helps anyone here is some data I have acquired.

Overall Dimensions: 38x20

Up: 6x20
Up: 15.789473684210526 %

Left: 8x20
Left: 21.052631578947366 %

Down: 17x20
Down: 44.73684210526316 %

Right 8x20
Right: 21.052631578947366 %

Now I just need to work out a formula to figure out how many pixels any given shield part would be xD
I am not good at mathematics but I shall give it a crack

Well I failed miserably..
Hers was my attempt.
Any math guru's on here that would be able to work this puzzle out?
Did you even read what crono posted? It's the solution in black and white.
Reply With Quote
  #5  
Old 04-20-2012, 04:37 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
I know how it works but I am trying to figure out a formula.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #6  
Old 04-20-2012, 05:28 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
All you do is maintain the same pixel ratio.

Ratio: 1

Width: 38 * ratio
Height: 20 * ratio

Up: 6 * ratio
Left: 8 * ratio
Down: 17 * ratio
Right: 8 * ratio

Heights for each shield: 20 * ratio

There's no complicated formula, for simplicity sake avoid ratios that result in decimal points.

For an in-game shield viewer you can simply use a gani.
__________________
Quote:
Reply With Quote
  #7  
Old 04-20-2012, 06:57 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
This is regarding an external viewer in VB.
I'm making it so iClassic players can see their shields on a character before uploading them.
Thanks for that though, I guess i'm half asleep lol
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #8  
Old 04-21-2012, 10:16 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Ok, now say that is for a 38x20px shield.
Say the user selects a 147x40px shield.
How would it work? would the ratio be like pixelwidth/38?
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #9  
Old 04-21-2012, 11:31 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
Quote:
Originally Posted by Gunderak View Post
Ok, now say that is for a 38x20px shield.
Say the user selects a 147x40px shield.
How would it work? would the ratio be like pixelwidth/38?
If a user selects a 147x40 shield, the width to height ratio is out and the creater of said shield should be shot.

Also yes, the ratio would be given from pixelwidth/38.
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 10:26 PM.


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