Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Scripting

4 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

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

2. Do you even script, bro?

Scripting

4 years ago

1. Oops-

2. No, bro 

Scripting

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

Scripting

4 years ago

Okay!

Scripting

4 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

4 years ago

I'll keep that in mind. ^_^

Scripting

4 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

4 years ago

Thanks!

Scripting

4 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

4 years ago

Can I make a virtual dice with scripting?

 

Scripting

4 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

4 years ago

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

Scripting

4 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

4 years ago

Dang, this is hard. >-<

Scripting

4 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

4 years ago

Whoa! Nice job with this storygame by the way.

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

Scripting

4 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

4 years ago

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

Scripting

4 years ago

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

Scripting

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

Scripting

4 years ago

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

Scripting

4 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

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

Scripting

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

Scripting

4 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

4 years ago

Is making a test storygame good for that?

Scripting

4 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

4 years ago

Good idea! Thanks, mizal! :D

Scripting

4 years ago

Another question I have:

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

Scripting

4 years ago
No

Scripting

4 years ago

Dammit!

Scripting

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

Scripting

4 years ago
You mean from the cookie?

Scripting

4 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

4 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

4 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

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

Scripting

4 years ago

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

Scripting

3 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

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

Scripting

3 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

3 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

4 years ago

Oh, I have a good one! 

Can I play music with scripting?

Scripting

4 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

4 years ago

Ooooh, yes! Thank you! :D

Scripting

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

Scripting

4 years ago

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

Did I do it right?...

Scripting

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

Scripting

4 years ago

Oh-

Scripting

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

Scripting

4 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

4 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

4 years ago

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

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

Scripting

4 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

4 years ago
Check this out: link

Scripting

4 years ago

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

Scripting

4 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

4 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

4 years ago

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