Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Shield Math Question (https://forums.graalonline.com/forums/showthread.php?t=134266289)

Gunderak 04-20-2012 02:25 PM

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?

Crono 04-20-2012 02:31 PM

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?

Gunderak 04-20-2012 03:03 PM

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?

Hezzy002 04-20-2012 04:28 PM

Quote:

Originally Posted by Gunderak (Post 1692577)
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.

Gunderak 04-20-2012 04:37 PM

I know how it works but I am trying to figure out a formula.

fowlplay4 04-20-2012 05:28 PM

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.

Gunderak 04-20-2012 06:57 PM

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

Gunderak 04-21-2012 10:16 AM

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?

Tricxta 04-21-2012 11:31 AM

Quote:

Originally Posted by Gunderak (Post 1692624)
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.


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

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