WatchNon-threaded

Forums » Advanced Editor Forum » Read Message

Talk about it. Ask for help on it. Compliment it.

Scripting

9 months 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

9 months ago
1. Two is a couple, not a few. A few is at least three.

2. Do you even script, bro?

Scripting

9 months ago

1. Oops-

2. No, bro 

Scripting

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

Scripting

9 months ago

Okay!

Scripting

9 months 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

9 months ago

I'll keep that in mind. ^_^

Scripting

9 months 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

9 months ago

Thanks!

Scripting

9 months 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

9 months ago

Can I make a virtual dice with scripting?

 

Scripting

9 months 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

9 months ago

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

Scripting

9 months 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

9 months ago

Dang, this is hard. >-<

Scripting

9 months 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

9 months ago

Whoa! Nice job with this storygame by the way.

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

Scripting

9 months 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

9 months ago

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

Scripting

9 months ago

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

Scripting

9 months ago
$PAGETEXT:="You have got a "+%DICE

Scripting

9 months ago

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

Scripting

9 months 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

9 months ago
%DICE represents the number the plus adds things together.

Scripting

8 months ago
Why would you think it would do that?

Scripting

9 months 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

9 months ago

Is making a test storygame good for that?

Scripting

9 months 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

9 months ago

Good idea! Thanks, mizal! :D

Scripting

8 months ago

Another question I have:

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

Scripting

8 months ago
No

Scripting

8 months ago

Dammit!

Scripting

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

Scripting

8 months ago
You mean from the cookie?

Scripting

8 months 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

8 months 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

8 months 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

8 months ago
Why would it matter to you what name somebody used?

Scripting

8 months ago

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

Scripting

8 months ago

Oh, I have a good one! 

Can I play music with scripting?

Scripting

8 months 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

8 months ago

Ooooh, yes! Thank you! :D

Scripting

8 months ago
Sorry, ' <audio src="file"> </audio>'

Scripting

8 months ago

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

Did I do it right?...

Scripting

8 months ago
Thats a link to a webpage, not an audio file.

Scripting

8 months ago

Oh-

Scripting

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

Scripting

8 months 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

8 months 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

8 months ago

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

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

Scripting

8 months 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

8 months ago
Check this out: link

Scripting

8 months ago

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

Scripting

8 months 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

8 months 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

8 months ago

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