Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Variable Equality

7 years ago

I have one variable that goes random upon clicking a page and chooses any number between 1-150 to reset the amount to (the variable is called CANDY).

I want the game SCORE to be equal to that chosen random number. Is there a script (or any way, really) that will set the SCORE equal to the amount of CANDY? I've searched quite a bit but cannot find a way to do so, I'm also still fairly amateur in the scripting department.

Variable Equality

7 years ago

Edit: Welp, I am an idiot. What 3J said.

Variable Equality

7 years ago

%CANDY := 1D150
%SCORE := %CANDY

I'm guessing that I'm misunderstanding your problem, but if not, the above should work when placed in a link script. (caveat: I haven't done any CYS scripting in close to a decade).

Variable Equality

7 years ago

Yes, this works. Thank you so much.

Variable Equality

7 years ago
Out of curiosity, why did you want this?

Variable Equality

7 years ago

It's probably for her story, Trick-or-Treating.

Variable Equality

7 years ago

Haha, yeah. It's a bit where the reader can choose to gamble for a potential higher score.

Variable Equality

7 years ago
Why not just do $SCORE := 1D150 and ignore the second variable all together?

Variable Equality

7 years ago

I actually decided later (and after many scripted pages) to add the actual game score. So having a simple script at the end would easier than to go back and add the score after every page. I also wanted the reader to see 'candy' opposed to 'score' for visual sake. But thank you. ^-^

Variable Equality

7 years ago

Couldn't you have done a Candy: %%SCORE%% sort of thing, so that what you show as "candy", is taking the number from the variable, SCORE?

Variable Equality

7 years ago

...I'm not that advanced to have known to do that!

Variable Equality

7 years ago

xD But its basics! I think. 

Well, anyways, I'm pretty interested in this trick-or-treating story now.

I am determined to get the highest score when it comes out :P

Variable Equality

7 years ago

Haha, I started it quite awhile ago and I'm simply trying to salvage it and get everything (re)scripted, and extend my knowledge of scripting! Thank you for your help.

Variable Equality

7 years ago
Oh I see. You have the candy variable set to display on all pages, don't you?

Variable Equality

7 years ago

Oh! Goddamn it, comprehension skills >~<