Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

A Somewhat Extensive Guide to BBCodes

Forum Index > PokéFarm > Guides >

Pages: 123··· 179180181182183··· 762763764

DrWho's AvatarDrWho
DrWho's Avatar
No question is stupid ♥
[style] .accordion { width: 50%; } [/style]

Hide Box

Make me smaller!

Display Box

Leave me alone!

The number in orange is the number of hideboxes you want to display in one line.
[sc=sidebyside][hide=Hide One]Text One[/hide][hide=Hide Two]Text Two[/hide][/sc] [style] .sidebyside .panel{ float: left; width: calc(100/2%-1px); } [/style]

Hide One

Text One

Hide Two

Text Two

I'm sorry if the second answer is a bit ugly. Normally flexbox deals with problems like this, but I don't understand why it does this to panels (see below)

Hide One

Text One

Hide Two

Text Two
[sc=flexhide][hide=Hide One]Text One[/hide][hide=Hide Two]Text Two[/hide][/sc] [style] .flexhide { display: flex; } .flexhide .panel { flex: 1 0 auto; } [/style]
Avatar by Kaelwolfur. Sent from my PokéNav
pumpkab00's Avatarpumpkab00
pumpkab00's Avatar
awesome, thanks so much!
✿ ally ✿ she/they ✿
Bluk Berry

Bluk Berry

Berry

(: 0)

Though this small, delicately skinned Berry is blue in colour, it dyes the mouth black when eaten.

Flavour: Sweet
Colour: Purple
Firmness: Soft
Growth time: 8 hours

Sells for 20

Lv. 100 — +15,371,792
Aspear BerryAspear Berry
Aspear Berry (SOUR)
Cheri BerryCheri Berry
Cheri Berry (SPICY)
Chesto BerryChesto Berry
Chesto Berry (DRY)
Pecha BerryPecha Berry
Pecha Berry (SWEET)
Rawst BerryRawst Berry
Rawst Berry (BITTER)
Likes:
Sour food
Dark
Happiness 27%
Lax nature
Sweet Apple

Sweet Apple

Evolution Item

(: 0)

A peculiar apple that can make a certain species of Pokémon evolve. It's exceptionally sweet.

Sells for 1,000

Lv. 36 — 4,483 / 4,996
Aspear BerryAspear Berry
Aspear Berry (SOUR)
Cheri BerryCheri Berry
Cheri Berry (SPICY)
Chesto BerryChesto Berry
Chesto Berry (DRY)
Pecha BerryPecha Berry
Pecha Berry (SWEET)
Rawst BerryRawst Berry
Rawst Berry (BITTER)
Likes:
Sweet food
Normal
Happiness 27%
Timid nature
©
coded by me except pkmnpanel. avatar. bg.
Hey guys! I'm trying to create a progress bar to indicate how many boxes I've hoarded. I'm trying to hoard a Box Box Box worth of boxes (hence the 126) for my birthday, but I've also got 4 Box Boxes to hunt (hence the 84). I want a progress bar to show me how many I've hoarded, excluding the number of boxes going towards my box hunts. I'm not looking for a progress bar that shows me the number of boxes in my inventory, because I've already got that down.

The Error

The Broken Code

[progress="[math][math][inventory=Cute Box]+[inventory=Dainty Box]+[inventory=Deluxe Box]+[inventory=Glittery Box]+[inventory=Gorgeous Box]+[inventory=Hard Box]+[inventory=Heavy Box]+[inventory=Light Box]+[inventory=Nifty Box]+[inventory=Pretty Box]+[inventory=Shiny Box]+[inventory=Sinister Box][/math]-84[/math]/126"][math]([inventory=Cute Box]+[inventory=Dainty Box]+[inventory=Deluxe Box]+[inventory=Glittery Box]+[inventory=Gorgeous Box]+[inventory=Hard Box]+[inventory=Heavy Box]+[inventory=Light Box]+[inventory=Nifty Box]+[inventory=Pretty Box]+[inventory=Shiny Box]+[inventory=Sinister Box])-84[/math][item=Sinister Box] /1 [item=Box Box Box][/progress]


Yes, I have tried it with one set of [math] tabs.

Avenged Sevenfold - "Bat Country"

I'm too weird to live, but much too rare to die.

advertising

Niall's AvatarNiall
Niall's Avatar
Your progress bars can't have a negative number, as the error code mentions ;) You should just make the progress bar "[math][inventory=Box blah blah blah blah][/math] / 210" but you can put "( [math][inventory=Box blah blah blah blah][/math] / 210 ) - 84" in the text.
Oh, okay! Thanks!
DrWho's AvatarDrWho
DrWho's Avatar

Option 1: Ignore negative values

It's true, you can't have negative numbers in your progress bars. However... Since your progress is basically 0 when you have negative boxes, you can also look for a function that leaves numbers greater or equal to 0 as they are, but turns all numbers less than 0 to 0. Here's one: [math]((x)^(1/2))^2[/math] What is this? It takes the square root of x, then squares the result. For 0 and any positive number that's the number itself. For negative numbers: You traditionally can't take the square root (or any even root) of a negative number. It's a complex number. I'm not sure why, but Sally returns the square root of a negative number as 0. So if you put 20 into the function above, you get 20. If you put -20, you get 0. Now here's a progress bar that utilises this function and puts your progress at 0 when you have negative boxes:
[progress="[math]((([inventory=Cute Box]+[inventory=Dainty Box]+[inventory=Deluxe Box]+[inventory=Glittery Box]+[inventory=Gorgeous Box]+[inventory=Hard Box]+[inventory=Heavy Box]+[inventory=Light Box]+[inventory=Nifty Box]+[inventory=Pretty Box]+[inventory=Shiny Box]+[inventory=Sinister Box])-84)^(1/2))^2[/math]/126"][math]([inventory=Cute Box]+[inventory=Dainty Box]+[inventory=Deluxe Box]+[inventory=Glittery Box]+[inventory=Gorgeous Box]+[inventory=Hard Box]+[inventory=Heavy Box]+[inventory=Light Box]+[inventory=Nifty Box]+[inventory=Pretty Box]+[inventory=Shiny Box]+[inventory=Sinister Box])-84[/math][item=Sinister Box]/1[item=Box Box Box][/progress]
-76/1

I put the part that is read by humans as the negative number, but you can change that of course. Note: Only individual boxes are counted just like in your example, if you want it to include BoxBoxes add [item=Box Box]*21 to the functions.

Option 2: Signed progress bar

[progress="[math](((([inventory=Cute Box]+[inventory=Dainty Box]+[inventory=Deluxe Box]+[inventory=Glittery Box]+[inventory=Gorgeous Box]+[inventory=Hard Box]+[inventory=Heavy Box]+[inventory=Light Box]+[inventory=Nifty Box]+[inventory=Pretty Box]+[inventory=Shiny Box]+[inventory=Sinister Box])-84)^2)^(1/2))[/math]/252"][math](([inventory=Cute Box]+[inventory=Dainty Box]+[inventory=Deluxe Box]+[inventory=Glittery Box]+[inventory=Gorgeous Box]+[inventory=Hard Box]+[inventory=Heavy Box]+[inventory=Light Box]+[inventory=Nifty Box]+[inventory=Pretty Box]+[inventory=Shiny Box]+[inventory=Sinister Box])-84)[/math][item=Sinister Box]/1[item=Box Box Box][/progress] [style] .expbar > div { left: 50%; } .expbar > div:nth-child([math][math]((([inventory=Cute Box]+[inventory=Dainty Box]+[inventory=Deluxe Box]+[inventory=Glittery Box]+[inventory=Gorgeous Box]+[inventory=Hard Box]+[inventory=Heavy Box]+[inventory=Light Box]+[inventory=Nifty Box]+[inventory=Pretty Box]+[inventory=Shiny Box]+[inventory=Sinister Box])-84))^(1/2)[/math]+1[/math]){ transform: translateX(-100%); } [/style]
-76/1

Explanation

If this is badly worded or wrong, please let me know and I'll fix it. Traditionally, a progress bar looks like this. [progress="count/goal"]some text[/progress] count is how many of the item you have at the moment, goal is your desired quantity. The signed progress bar needs both BBCode and CSS, let's go through each step by step. [progress="[math]((count)^2)^(1/2)[/math]/[math]goal*2[/math]][/progress] count is now [math]((count)^2)^(1/2)[/math]. This squares count and then takes the square root. Positive numbers will stay the same, negative numbers will lose their sign. Meaning 26 → 26, -26 → 26. This number determines the width of our progress bar. -26 to 0 takes up the same space as 0 to 26, so both of them should have the same positive width. goal is now [math]goal*2[/math]. The range of a traditional bar is, say, 0 to 10. Now we want to include -10 to 10, so we need to double our range.
Now comes the CSS bit.
[style] .expbar > div { left: 50%; } .expbar > div:nth-child(1){ transform: translateX(-100%); } [/style]
.expbar refers to the container of our progress bar. > div is the div inside it - the filled part that expands as we fill up our bar. First we move the position of 0 in our progress bar's range. In a traditional progress bar with a goal of 10, the range is 0 to 10. We start with 0 on the left and end with 10 on the right. Our signed progress bar reaches from -10 to 10, so we have to move the 0 dead center. This is done by shifting the filled bar 50% to the left. Now we have a bar that has 0 in the center and both negative and positive values are valid widths. Now there's only one thing missing: When we have a positive count, the bar should expand to the right. When we have a negative count, the bar should extend to the left. How do we do this? We tell the filled bar to move left by its entire length when our count is negative. This is the purpose of "transform: translateX(-100%);". How do we adress the filled bar? .expbar > div:nth-child(1) If the number between the parantheses is a 1, we address the filled bar. If it is anything other than 1, we address a non-existent element so nothing changes. We only want to run the code when we have a negative count, so now we have to find a function that turns any negative count into a 1 and any positive count into something other than 1. One such function is [math](count^(1/2))+1[/math]. It takes the square root of count and adds +1. Sally interpretes the square root of a negative number as 0, so for every negative number we get 0+1 = 1. For every positive number we get somehing other than 1, because no positive number has a square root of 0. For a count of 0 we also get 1 and the code is run. However since the filled bar has a width of 0px at a count of 0, the bar is moved by 0px so nothing will change.
OH MY GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOODDDDDDDDDDDDDDDDD Yes!!!! That's exactly what I'm looking for! Thank you so much, @DrWho! Also, that is weird that Sally returns the square root of a negative number as 0. shouldn't it be i to some power or something like that?
AnonymousOTP's AvatarAnonymousOTP
AnonymousOTP's Avatar
wheezes i dont wanna accidentally reask a question but i also dont see it on the main post and i mightve missed it while readin all the pages?? (theres so much info lol) how would i make a progress bar half the size so i can place another one next to it?
ive (dragalia) lost my mind <3
ãruktai's Avatarãruktai
ãruktai's Avatar

QUOTE originally posted by DrWho

No question is stupid ♥
[style] .accordion { width: 50%; } [/style]

Hide Box

Make me smaller!

Display Box

Leave me alone!

The number in orange is the number of hideboxes you want to display in one line.
[sc=sidebyside][hide=Hide One]Text One[/hide][hide=Hide Two]Text Two[/hide][/sc] [style] .sidebyside .panel{ float: left; width: calc(100/2%-1px); } [/style]

Hide One

Text One

Hide Two

Text Two

I'm sorry if the second answer is a bit ugly. Normally flexbox deals with problems like this, but I don't understand why it does this to panels (see below)

Hide One

Text One

Hide Two

Text Two
[sc=flexhide][hide=Hide One]Text One[/hide][hide=Hide Two]Text Two[/hide][/sc] [style] .flexhide { display: flex; } .flexhide .panel { flex: 1 0 auto; } [/style]
Note: scroll up :P EDIT: I may have misread progress bars as hideboxes, but I'd say the fundamentals are there >w<
Curently hunting: SNORUNT Avatar by Planes Stamp Credit
88penguintreats
AnonymousOTP's AvatarAnonymousOTP
AnonymousOTP's Avatar
ah okay im not super knowledgable with style codes and everythin so im gonna have to figure out what im doin i guess x D thanks tho i might be able to figure it out

Pages: 123··· 179180181182183··· 762763764

Cannot post: Please log in to post

© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page