Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Scripting

3 years ago

I have a few questions...

1. How do you script? I never knew you could so I don't really know how to do it. 

2. Since you can script, what can you script in a storygame?

Scripting

3 years ago
1. Two is a couple, not a few. A few is at least three.

2. Do you even script, bro?

Scripting

3 years ago

1. Oops-

2. No, bro 

Scripting

3 years ago
1. You're not old enough
2. Great examples are provided in this forum, articles, and the cys discord. GLHF.

Scripting

3 years ago

Okay!

Scripting

3 years ago
If you're wanting to make a game, it'd really be better to focus on the actual writing part (which is way more important) before worrying about scripting.

Scripting

3 years ago

I'll keep that in mind. ^_^

Scripting

3 years ago

Check out these articles.

The help section really gives you what you need. You can make a script to do most everything you could need. 

Scripting

3 years ago

Thanks!

Scripting

3 years ago
And honestly, unless you want to do something in your writing that you cannot already do with the current engine, there's no need for scripting. In other words, you don't use scripting because you can, but because you have some need and desire to do something. So a better question would be, "Can I do X with scripting?"

Scripting

3 years ago

Can I make a virtual dice with scripting?

 

Scripting

3 years ago
You can and even have an animated gif show them rolling up the number, but it's a huge amount of work for a very small payoff.

Rolling random numbers is easy though.

%DICE := 1D6

Scripting

3 years ago

Does a text box pop up saying "You got a [the number]!"?

Scripting

3 years ago

You would have to make it do all of that, which is pretty complex. The xDy that he showed is built in, all it does is give a random value, it's up to you to implement how it is reported, if at all. 

Scripting

3 years ago

Dang, this is hard. >-<

Scripting

3 years ago

Here's a basic battle system that I threw together awhile ago to see what kind of functionality I could come up with, if you want some kind of example.  It's just a couple of links in. 

http://chooseyourstory.com/story/funstuff

Scripting

3 years ago

Whoa! Nice job with this storygame by the way.

(Sorry, I just had to point that out ^u^)

Scripting

3 years ago
No offense to AL, but she is ten years old and at a level of tech savviness where the only thing preventing her from deleting System32 on request would be the inability to find it. I don't think this is gonna happen lol.

Scripting

3 years ago

Really it was just my two cents on the second question on the original post, to give a visual example. 

Scripting

3 years ago

I don't even know what System 32 is. >->

Scripting

3 years ago
$PAGETEXT:="You have got a "+%DICE

Scripting

3 years ago

Ohhhh! Does the + mean where the number will go?

Scripting

3 years ago
There are articles in the Help section that explain both page text and on page scripting. I think you should take a look at those, and at the others and then experiment around a bit before deciding if this is definitely something you want to mess with at this stage.

Scripting

3 years ago
%DICE represents the number the plus adds things together.

Scripting

3 years ago
Why would you think it would do that?

Scripting

3 years ago
Setting a random number is easy, saving that number is easy, displaying that number on the page is easy, but it might be overwhelming for you to do all at once if you don't understand how a variable works or any of the logic behind this stuff. You should read the articles and play around with the editor a little to get a basic idea of what a variable is, that will help you do pretty much all the future things you want to do. But first, like I said, you should really focus on the actual writing. Adding a dice roll isn't going to keep a game from being unpublished, it needs to be a good story for that.

Scripting

3 years ago

Is making a test storygame good for that?

Scripting

3 years ago
Why don't you copy over the page of your story that the dice number will be on, and where you want it to go, and maybe someone can give advice on how to do it best based on that.

Scripting

3 years ago

Good idea! Thanks, mizal! :D

Scripting

3 years ago

Another question I have:

Can you put the username of the person who is reading it with scripting?

Scripting

3 years ago
No

Scripting

3 years ago

Dammit!

Scripting

3 years ago
Sort of, but it's not really worth that much effort, if you ask me.

Scripting

3 years ago
You mean from the cookie?

Scripting

3 years ago
You can't actually get the CYS user name (that I'm aware of), but you can, using the scripts in that link, get the user to enter a name.

Scripting

3 years ago

That would be cool, but I'm worried about inappropriate names. 

But the biggest question I have is this: Where do I put the script?

Scripting

3 years ago
If you look in that page linked, you will see that you need a page for every letter you want to allow. And then scripts go in the link script for each letter of each link on each page. So yes, that means if you have 8 letters you need 26 links on each page, for a total of 208 links (not counting reset and end links). In EACH of those 208 links you will need script code. Then you will need to add the on page script code to use the name. Did I mention this was a tremendous amount of work for very little return?

Scripting

3 years ago
Why would it matter to you what name somebody used?

Scripting

3 years ago

...Oh right, this isn't Roblox.

Scripting

2 years ago
In this article where it states 'On the enter letter 1 page, make 26 links. These links are from A to Z.'.. Would these be links to a new page? (and then create a new page for each letter a-z)?

Scripting

2 years ago
As I understand it, all of them will link to the second page.

Scripting

2 years ago
I just made the letters as new page links and changed the destinations so i think i've got it now, thanks anyway :)

Scripting

2 years ago
I mean that works too, but you could've just pointed them all back at that same page, the only thing you're trying to do is refresh to update the link script.

Scripting

3 years ago

Oh, I have a good one! 

Can I play music with scripting?

Scripting

3 years ago
In principle you can play music, unless people have disabled it in their browsers.
You don't even need scripting.
You can just put "audio src="file /audio" into the source of your web-page.
Where file is a valid url to the file.

Scripting

3 years ago

Ooooh, yes! Thank you! :D

Scripting

3 years ago
Sorry, ' <audio src="file"> </audio>'

Scripting

3 years ago

<audio src="https://www.youtube.com/watch?v=ncjuqj0WN6s"> </audio>

Did I do it right?...

Scripting

3 years ago
Thats a link to a webpage, not an audio file.

Scripting

3 years ago

Oh-

Scripting

3 years ago
Keep in mind that not everybody might appreciate music, though. (i.e. it better be good)

Scripting

3 years ago

My storygame is called "The Dark Side of Christmas" and this is just for the starting page. Don't worry, it's instrumental. -u-

Scripting

3 years ago
You can also just use Share > Embed on the YouTube page to get code you can use.

But I'm not sure if any of these are going to work for you since you're using the rich text editor and this all needs HTML.

If the music auto plays you should include a warning about it on the description of your game for people reading these at school or work.

Scripting

3 years ago

I agree about the warning, but what the heck is an HTML? 

Oh boy, I'm getting so confused... ~-~

Scripting

3 years ago
HTML (hypertext markup language) is the language that you use to explain the browser what to do. It is basically text plus commands in pointy brackets.

Scripting

3 years ago
Check this out: link

Scripting

3 years ago

This is so informative, thank you so much. ^u^

Scripting

3 years ago
It's what most people recommend for writing around here, it helps you avoid of the glitches with the rich text editor, plus it just looks so much better than that ugly cluttered white box (and works better with dark mode.) You only need to know how to use html in a story if you want to do things like have italic or bold text for the most part, and those are simple.

On the forum you'd have to use it for making links or posting images, and that's a little more complicated until you memorize it, but since the RTE is glitchy with images anyway you might as well.

Just uncheck the Rich Text option in your profile and then log out and then in again so the change will take effect.


Scripting

3 years ago
Also HTML is a good skill to have. If you combine it with some other skills you can make awesome websites from scratch.

Scripting

3 years ago

Absolutely, and this is absolutely the best time they can start learning these skills.