Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Uh... Okay, this isn't good.

5 years ago

So... I'm inputting POF into CYS and I'm using the exact same coding as I've always used in every other game I've ever made and... It doesn't work.

For instance:

%%GENDER%=%1%boy%%%%GENDER%=%2%girl%%

In the original, this would show up as just "boy" if gender was set to 1, or "girl" if gender was set to 2... But in the game I'm making now, it's showing up as "%%GENDER%=%1%boy%%%%GENDER%=%2%girl%%"... What is up with that?

... This should be working, right? Did I miss something at all? Is there something else I need to do to get the script to work? frown

Uh... Okay, this isn't good.

5 years ago
That should work. You are putting it directly on the page, right? Check for ascii in there where you see a percent, but it is actually an &something.

Uh... Okay, this isn't good.

5 years ago

Yey! My favourite penguin's back! ^v^

Uhh... I have no idea what ascii is. I know! I'll add you as a co-author. Then you can fix it for me! heart

Uh... Okay, this isn't good.

5 years ago
Which page is it not working?

Uh... Okay, this isn't good.

5 years ago

All of them... Try the stats page first. Can you see anything wrong with it? If I know why it's not working, I should be able to fix the rest myself. ^_^

Uh... Okay, this isn't good.

5 years ago
Since you're using the RTE, my first thought is that you're bringing some crud over from whatever you're copying from that's confusing it. You could test it by pasting into Notepad or something first just to make sure you've only got plain text.

Also, turn off the RTE in your profile.

Uh... Okay, this isn't good.

5 years ago

Well, I'm clicking "Paste as plain text" every time, so I assumed it would work. (If there's one thing I'm REALLY going to miss about CoG, it's the simple as hell coding.) cheeky

Uh... Okay, this isn't good.

5 years ago
You using rich text editor or normal one?

Like Berka mentioned, a single weird ascii character will mess the whole thing up.

Uh... Okay, this isn't good.

5 years ago

I don't know! I just don't know! crying

Uh... Okay, this isn't good.

5 years ago



Go into your profile settings and uncheck the Rich Text Editor. It is very bad.

Uh... Okay, this isn't good.

5 years ago

Oh! Yeah, it's working now. Thanks miz! heart

Uh... Okay, this isn't good.

5 years ago
OK, fixed.

You were missed a % after your span. One missing % will blow up everything following it.

Fwi, mods can look and edit without being added as co-author. ^v^

Uh... Okay, this isn't good.

5 years ago

My hero! heart

But... What's a span?

Uh... Okay, this isn't good.

5 years ago
Okay wait, you had scripting and variables set to basic in the Storygame Properties. I went and changed them, did that to anything?

E: okay nvm, Berka got it. I thought Basic may have disabled on page stuff.

Uh... Okay, this isn't good.

5 years ago

Well, now I'm even more confused. The whole thing is in source mode now, and I can't turn it off. sad

Uh... Okay, this isn't good.

5 years ago
I'm not sure what you mean my source now but that's probably the setting I just changed, just go into storygame properties > editor features to turn it off.

Uh... Okay, this isn't good.

5 years ago
Or I guess I can do it, hang on.

Uh... Okay, this isn't good.

5 years ago

You guys are good at knowing stuff. ^_^

Uh... Okay, this isn't good.

5 years ago
It's awesome how helpful everyone is. All hands on deck!

Uh... Okay, this isn't good.

5 years ago

Dec? Oh don't you worry, I'll put my hands on him alright! ... Is Ant here too?

Uh... Okay, this isn't good.

5 years ago
A 100k story with customization and stats made with the RTE and by just clicking the little plus signs for variables is shattering my whole world view though. That can't possibly work, can it?

I mean I guess End doesn't use variables at all but I'm sure that just has something to do with his natural elements being chaos and death.

Uh... Okay, this isn't good.

5 years ago
Commended by mizal on 1/9/2019 8:23:28 PM

If RTE (Rich Text Editor) is turned off, then you will only see the source code. The issue with RTE is that it ends up adding in stuff you cannot see without looking at the source, which can mess up the on page script stuff.

If I recall, you can have the RTE on and then press some button to view the source code, which may help in seeing if all the things around the %'s are clear/appropriate.

ASCII is a way that computers represent stuff, and because html (the thing web-pages are made with) uses certain characters in it's 'coding', such as < and > you cannot type them out yourself (in some conditions) without it getting read as html by the browser, which means they won't show up as you want. However, you can type out something else instead which will let the browser know to interpret it as the symbols without thinking of them as part of the html (& l t ; for less than, without the spaces, & g t ; for greater than).

As I recall, some things the RTE puts in are literally just invisible ASCII, things no one will see but that can mess with on page scripting if they end up being in certain spots, which makes the storygame code get interpreted wrong (or I should say not at all).

A span is something used in html to separate stuff, it is super generic and probably something the RTE put in by itself for whatever reason. Not necessary at all as far as I'm aware (for making a storygame).

Worth mentioning that one of the reasons RTE is so often suggested to be turned off is because the functionality it provides is easy enough to just do yourself by typing the html into the source, as the basic things are simple enough to learn, <p> </p> for paragraphs, <b> for bold </b> (or use strong instead of the b), i or em for italics, <br> for a paragraph break (like shift-enter in word), etc. As such, there ends up being very little reason to use the RTE, but it does make global font changing (and color changing) a bit easier, but they can still be done without it (and global scripts are a thing).

Anyway, the more complex html stuff can also be implemented (as far as I'm aware) and is in fact easier to deal with without the RTE messing you up constantly.

TL;DR
Just me attempting to explain some things that came up in this thread, because I felt people weren't explaining it as much as they could. Granted, I might have gotten something wrong, in which case I await people to correct me.
Also, with RTE turned off, the only thing you'll see is the source code (which probably shows that what you were copying pasting wasn't clean [or became corrupt after pasting into RTE]).

P.S. Right click a page then 'inspect' or 'view page source' to get a glimpse into web creation with html + css. It will probably be messy... but might be interesting to take a glance at (you might even find a span or hundred).

Uh... Okay, this isn't good.

5 years ago
Well now her head exploded. You killed her, Zake. I hope you're satisfied.

Uh... Okay, this isn't good.

5 years ago
I'm sure people will take my post for some sort of sci-fi exposition dump if it gets too confusing, so I'd wager on the head still being intact, and thus your hope is well placed, as yes, I am satisfied.

Uh... Okay, this isn't good.

5 years ago

That... Most certainly didn't register. I pretty much just heard, "Blah, blah, blah, code, code, code, blah, blah, computers, blah, scripting, blah, blah, blah, it will probably be messy..." Wait, what will be messy? Dude! Totally inappropriate! >.<

Uh... Okay, this isn't good.

5 years ago

Ah, well it probably wasn't the best explanation regardless.

Here's another:

- ASCII is like an alphabet for computers.

- Without RTE, source code is what you'll be seeing.

- With RTE, a letter may be added where you don't want one, so then the script won't be read properly, it is like misspelling a word.

- So to misspell words less, you can turn off RTE.

- However now you are seeing stuff that may look weird, because you are seeing ASCII letters as well as English ones.

Hopefully this makes more sense.

I should add that you can pretty much write plain English into source code (along with the %%VAR%=%1%TEXT%% script) and have it work fine.

Only the formatting may be lacking. That is why I mentioned some HTML things.

HTML = Hyper Text Markup Language.

So think of it as a computer language. Stuff that changes things (such as bolding a word) but isn't actually writing.

The <p>paragraph</p> <b>bold</b> <i>italics</i> <br> break (no closing for this one) are the main ones I imagine might be used. You put paragraphs in the paragraph tags, you put bolded words in the bolded tags, italics in the italics tags, and break can replace the enter key (mainly for being used inside the text area of "%%VAR%=%1%TEXT%%" to have paragraphs, if you want). If there is other things (like changing color) you can always google "html changing text color" and copy the tags they show you.

There, a simpler explanation.

TL;DR
Err, HTML can be used for formatting when writing straight into 'source'.

P.S. You learnt the CoG coding, this is the same thing, just more universal (ASCII and HTML aren't site specific). I'd say you only really need to know that HTML is used to format stuff, as opposed to site specific 'coding' doing that. Offering 'inspecting' via right click was probably not the best idea on my part tho (and viewing page source is even worse, since there are heaps of unmentioned tags, and this site is old so it is not a prime example of HTML anyway).

Uh... Okay, this isn't good.

5 years ago

Oh! I think my tiny, blonde brain actually took some of that in. Thank you! Yeah, basically... If you're trying to explain anything to me about coding, just imagine that you're trying to explain it to a five year old. (Would probably help if you bring a colourful picture book and a couple of hand puppets.) ^_^

Uh... Okay, this isn't good.

5 years ago



It's the RTE that adds all this crap to yours, my games don't look like that except for the occasional italics tag I add myself.

If you're planning to use images at all the RTE will eat them which is another reason we usually recommend turning it off.

Uh... Okay, this isn't good.

5 years ago

Okey dokey. If I ever try to add something simple to the game and it doesn't work, at least I'll know why. ^_^

Uh... Okay, this isn't good.

5 years ago
@Chanbot

53%

Uh... Okay, this isn't good.

5 years ago
54%

Uh... Okay, this isn't good.

5 years ago

Que?

Uh... Okay, this isn't good.

5 years ago
He requested updates on the status of my phone battery.

(84% right now)

Uh... Okay, this isn't good.

5 years ago

Damn, mizal! You like to live life on the edge! cheeky