Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Adding buttons with JavaScript

5 years ago

So... @mizal (or anyone else who knows how to do this) ... How do you do it? Before I publish Innocence Lost, I'd really like to give it a proper Stats page and get rid of the stupid "Check Stats" button at the bottom of every page. >.<

Adding buttons with JavaScript

5 years ago
Oh yeah I forgot about this. Uh, I'll PM you later, I don't want to try and copy over the things from my phone.

Adding buttons with JavaScript

4 years ago
Hey @mizal, I'm having a bit of trouble with this myself with an added button at the top of the page, but I'm using CSS/HTML. What I'm doing is using a div (and I had a bunch of help getting that right from Ogre11, BradinDvorak and Killa Robot for that), but there are two cosmetic problems with what I have.

(1) My button doesn't have the translucency of the ones at the top of the page.

(2) The hover color is the one I'm using for bottom links (probably because I've just added a permanent link which is positioned at the top of the page rather than a real button).

Could I get a little help on this? I'd like to work with what I have, but if you could show me this other script I'd appreciate it. Also if posting my own script or PMing it will help you (or anyone else) help me to try to get the standard translucence and hover color (and even the font is a little off), of course I'd do that.

I have zero familiarity with Javascript, and I'm guessing I'm going to have to learn some to do this as well as possible. Any help would be appreciated.

EDIT- Oh, wait... does that picture you posted have the script I'd need? It looks a lot like what's on the page source.

Adding buttons with JavaScript

4 years ago
I'm sure I know even less about JavaScript than you do since I pretty much just copy and paste what is handed to me by Brad, but I'll send you what I have when I get home if you think it will help.

Adding buttons with JavaScript

4 years ago
I would appreciate that. I'm not sure if I'll still use it for my current game (I might just go with a more stylized button than one that looks like the generic ones, which I can do right now), but it won't hurt to have the script for future reference.

Adding buttons with JavaScript

5 years ago
You dont actually need javascript for this. Html can handle it just fine.

And why not just use an item anyway?

Adding buttons with JavaScript

5 years ago
Items are annoying and look like shit.

Adding buttons with JavaScript

5 years ago
Should work if you just change the button text to whatever and dump it all into a global page script.

Adding buttons with JavaScript

5 years ago
@Avery_Moore

Adding buttons with JavaScript

5 years ago
Btw if you're going to use different pages for stats (in another chapter or whatever) you have to plug in the ID number that now shows up when you link to it from another page.

Adding buttons with JavaScript

5 years ago

Awesome!!! ... But uhh... Any chance you can explain that all again, like you're talking to a five year old child? So I go to the Global Page and... ... ... That's literally all I got. crying

Adding buttons with JavaScript

5 years ago
Scripts > Global Page > paste everything from that first page.

The page I pasted it all on itself isn't necessary, just needed a convenient place to store it that wouldn't get confused by all the greater than/less than signs, and somewhere to link the other pages from so I could see their ID number.

If you're having trouble with it I could plug it in for you, but then you will definitely have buttons that describe how Jason Hill likes snuff videos starring young African boys and I'm not sure who might see it before you get around to changing it.

Adding buttons with JavaScript

5 years ago

OHHHH! You added them to my game! Thanks mizal. Didn't see them there and was super confused. I was like... How the hell do I copy it when I don't know where it is? cheeky

Adding buttons with JavaScript

5 years ago

... Okay, so now I'm lost again. I open the page, but it just says:

$PAGETEXT := "" + $PAGETEXT $PAGETEXT := "" + $PAGETEXT

Adding buttons with JavaScript

5 years ago
When you open the page up to actually edit it it does that?


Asddfghjkcfjfuck this is probably an RTE thing so I'm blaming you, it still shows up as code for me. I'll probably have to just dump it in on pastebin or something and get you a link. Or I may just add it in once I'm on the computer later, I just don't want to screw around with someone else's game on mobile lest I accidentally commend something 23 times again.

Adding buttons with JavaScript

5 years ago

Okay, so I turned off RTE and the script is actually showing now. Unfortunately, it's still not working. The extra button shows up at the top, but when I click it, it just takes me to a page that says "Server Error in '/' Application." ... Gonna fiddle around with it a bit and see if I can figure out what's wrong, but knowing me, I'll probably just break it some more. cheeky

Adding buttons with JavaScript

5 years ago
Double check that I typed the right page ID in there. (It's the number that shows up next to the link on the HEY BRIAR page.)

It might be simpler for me to just do it later this evening so don't spend too much time with it.

Adding buttons with JavaScript

5 years ago
Ah! Yeah, the ID was for a page that didn't exist. It's working now. Yahoo! Thanks so much Mizal!!! ... Now all I have to do is go to every single page and delete that bloody "Check Stats" button >.<