Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Exp. bar

6 years ago
So I've had this idea for a while to use on page script to create HP and Exp bars, which I realised would take a huge amount of script, but only realised just how much when I actually made it.

In order to do this, I created script created variable %EXPPERC, which is the percentage that the %EXP variable is of the %MAXEXP. In the link going to my stats page (where the bar is), I have in the link script:

%EXPPERC:= (%EXP*100)/%MAXEXP

Then I tried to create a huge chunk of on page script which checks for every integer between up to 100 to show the respective number of empty spaces (using  ) with background colours (to give a solid bar effect), gradually adding a single space bar coloured slightly different for each consecutive value to give a nice, building gradient effect. I also spent ages making my own exp bar with a transparent inside so the bar is a bit more fancy and not just a block of colour. A full exp bar would look like this:



But, very very sadly, there seems to be a limit to how much I can fit on a page. I worked down from 100 and got to about 78 before I got the 'Error 500' message or whatever it is. I could just screenshot all 100 pictures and do it via the page script, but I was wondering if anyone knows a better way of doing this? It would take so, so long and unfortunately you can put on page script inside the page script and have it run corrently.

Exp. bar

6 years ago
You're insane.

Exp. bar

6 years ago
Heh... ahaha... AHAHAHA!!

Exp. bar

6 years ago
If I were insane as well, I think I would just have different images swapped out and tacked on after $PAGETEXT based on the amount of EXP.

My brain is really struggling to parse the OP so maybe that's already what you're trying to do.

Exp. bar

5 years ago
Also yeah fair enough having trouble understanding it- reading back I think I was delirious with hopelessness and sleep deprivation.

Exp. bar

6 years ago
Two suggestions

Go Lo-Fi, let the Health Ticks be something like the | key (the thing that appears when you press Shift + \), and store health as versions of that (e.g. Full Health = |||||||||| while low looks like |||)

The other option is to use images that are based on conditionals (since I don't think the site coding has a Switch function), and don't try and make 100 variants, just 10 should be fine

Exp. bar

6 years ago
Considered that but thought if I had to go lo-fi a better option would be spaces but only every 5% intervals or so.

Exp. bar

6 years ago
100 Pics right? Have you tried using on-page script to show or no show them?

Exp. bar

6 years ago
On page is the one that doesn't like html, right? Or at least that's the impression I've been under, I usually go with $PAGETEXT := blah blah when I need to do formatting.

Exp. bar

6 years ago
On-Page loves Pics, haha! (You just have to use single quotes inside the code).

EDIT - or maybe that's with $PAGETEXT?

Goint to have to go into a sample and look...

---

Yeah, here's some On-Page with Pics:

%%CARD10%=%0%<img src="http://chooseyourstory.com/i/?43869" width="95" />%%
%%CARD10%=%500%<img src="http://chooseyourstory.com/i/?43870" width="95" />%%

Exp. bar

6 years ago
Well this is just bizarre. I remember at one point getting really frustrated because I couldn't get it to do bolding and line breaks or whatever and I've been doing it the hard way ever since.

Still, good to know, I always hated the way everything had to be separated out with $PAGETEXT.

Exp. bar

6 years ago
Pretty sure you can’t use line breaks by enter bar because that screws up on page for some reason, but you can use HTML and always a double (br) (cba to encode- you know what I mean) to manually start new paragraphs- do it all the time in longer variable text or especially bits with dialogue.

Exp. bar

6 years ago
Yep, could also do it that way!

Exp. bar

6 years ago

Two images: one for the background, one for the bar. For the HTML, three nested div elements: the container for the whole thing, the container for the bar, and the bar itself.

Position the first element relatively, set its background image to the exp bar background, and set its width to the image's dimensions. Position the second element absolutely and give it the exp bar's image dimensions and appropriate left and top offset. Set the third element's background image to the exp bar, set its height to 100%, and set the width to the percentage of exp.

https://jsfiddle.net/392ym22f/

Exp. bar

6 years ago
Need to look at the code when I have a little more time, but if you’ve just solved my problem that quickly after hours of work just to test this, I’m going to be really happy and also incredibly frustrated:)

Exp. bar

6 years ago
Okay so I've had a look now. As far as I can see, this makes creating the bar more simple, but I'm guessing I'm still going to have to copy and paste that HTML 100 times and set up 100 'IF' statements, right?

Still, this refines the process so thank you!

Exp. bar

6 years ago

Nah, no ifs. All you need to do is plug the percentage into the CSS and you'll only need to do it once.

width: " + %EXPPERC +"%;

Exp. bar

5 years ago
Holy shit thank you how did I not see that- my method is so crude compared to this haha