Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Scripting this time!

6 years ago

Hi. I'm here. 
Again. 

This is a new system to me, so it's taking a while to figure it out fully even after the help and info pages. So wanted to make sure that this script does what I think it does so I don't start basing a bunch of stuff around it only to figure out that it doesn't work right. 

I have a Codex page. Thanks to Mizal, I got it working. I was confused on where to put the script mentioned in the Codex help and info until I figured out the option on the story properties to enable advanced scripting. 
But! There's a variable which, when you exit the codex page back to the story, affects another variable. 

So on the link back to the story, I should put in a thing saying 
(if the variable is between -1 and 1, then continue with the story and make sure %Z1 is set to 1. Otherwise add 1 to %A1


IF %Z1 >= -1 <= 1 THEN
 %Z1 := 1
ELSE
 %A1 := 1

Once A1 = 1, how do you keep Z1 value above 1? I've gone through all the scripting articles, but I still find myself being unclear on all the commands and how they work. 

(is there anyone willing to let me poke them every five minutes asking about how this or that works or how to implament a feature like ____ in a story?)

Scripting this time!

6 years ago
%Z1 >= -1 <= 1 is not valid. You would have to do %Z1 >= -1 AND %Z1 <= 1 I also don't understand the rest of your question. Just do %Z1 := 2

Scripting this time!

6 years ago

Thank you! 

As for the rest, Z1 is a variable that'll be changing constantly, as it tracks the change in magic energy level you're using from what you have stored. Or as it goes into negatives, the energy you're storing. It's interactive via the codex page setup, like the Homo Perfectus (5, I think?) where you can alter specifac amounts of the dna a certain extent.
Once A1 is triggered, you are forced to keep using the energy until it is gone, and therefore cannot have a value of 1 or below. 
The magic usage must be a gradual thing, one level per story page in either direction, otherwise a temporary magic whiplash coma occurs. It gives you the ability to increase it by however much you want per story page, as that is how you end the game (either that or death) but deciding when to do it and how opens up a lot of possibilities, and the goal is to see as much of the story as possible before you die or fall into a coma. Or you could just look for the most badass op fight. There'll be little secrets and tidbit hidden here and there depending on which abilities you use and how. 

I had it set Z1 to 1, so that when they return to the story page they can't just go back into the items again and alter it more without consequence. The next page story link sets it to 0, and once it's 0 you can continue to manipulate it. A different variable tracks the magic level it actually is at. 

Although now that I'm seeing this, I'm realizing that they could continue to go in and keep storing energy indefinitely, even if they can't raise their energy usage that much. I suppose I'll have to make a mirror set of variables, just doing it for the negatives as well. Unless I can figure out some other way. 

Guess this is what happens when you make a fantasy world with certain rules and ways of doing things, and then try to form a cyoa around it. This is getting rather complex. And I'd be just fine with changing it to be simpler, but I've already got some major plot points planned that occur later on based around the way magic works later on in the comic I'm doing with it. 

I feel like I'm doing this the really hard way when there's something much simpler staring me in the face. 

Scripting this time!

6 years ago
IF (-1 <= %Z1) = (%Z1 <= 1) THEN
 %Z1 := 1
ELSE
 %A1 := %A1 + 1

IF %A1 = 1 THEN IF %Z1 <= 1 THEN
 %Z1 := 2

Test whether %Z1 is greater than or equal to -1, then test whether it's less than or equal to 1. Both return a TRUE/FALSE value, and if both are equal, set %Z1 to 1; otherwise set %A1 to itself plus one. Afterwards, if %A1 is 1 and then if %Z1 is less than or equal to 1, set %Z1 to 2.

Normally, you'd use the AND operator with these, but it doesn't work properly with greater/less thans. In the first IF, you can cheat by replacing the AND with an equals sign (since both will never be simultaneously false), and in the second, you have to nest another IF within it.

Scripting this time!

6 years ago

Both you and Killa have a different example? Do they both work, or...?

Scripting this time!

6 years ago
Actually it means the same thing if I'm understanding it right.

IF (-1 <= %Z1) = (%Z1 <= 1) THEN

Logically speaking the = sign represents an AND. Both (-1 <= %Z1) and (%Z1 <= 1) will return true or false depending on the result. So assuming both statements are true, logically the result would be:

IF (TRUE) = (TRUE) THEN

Which functionally speaking would be the equivalent of:

IF (TRUE) AND (TRUE) THEN

Thus making them the same. It's a pretty cleaver way of getting around AND statements not working right (as they are prone to not working correctly for some reason), assuming it works.

Scripting this time!

6 years ago

If I wanted to have a set of script run every single link in the story except for those in a specific chapter, how would I do that? I believe you'd put it into the global link script, but how do you exclude the ones in that chapter? Or maybe just excluding a specifac page? Or do you just have to copy/paste it onto every link that it goes in and hope you don't miss one. 

Scripting this time!

6 years ago

Do it globally and then add an IF check for the chapter or page ID. In a link script, the IDs are taken from the chapter/page on which the link was clicked.If for instance, you wanted to do something unless you were on chapter 2 or page 3, you do this:

IF $CHAPTERID != 2 AND $PAGEID != 3 THEN
BEGIN
# Do something
END

Scripting this time!

6 years ago

So something like this in global link,

IF $CHAPTERID != 1 THEN
BEGIN
%AIM := %AIM - %AIMU
%BAL := %BAL - %BALU
(etc)
END

and then copy paste for the other chapters just changing the id?

Also, does using items count as if it were a link? 

Scripting this time!

6 years ago
Yeah that looks alright; does it work?

If you want to exclude more than one page you're better off using 'THEN IF' where you'd put an 'AND' because it doesn't seem to work with more than one for some reason.

Not sure about the item question. You could just run a test where you allow a variable to be seen on page, put something to change it in the global link, and see if it changes when you play through after using the item.

Scripting this time!

6 years ago

It seems that using items does not count as links. Although the global link is working, it isn't excluded from either chapter.

I have chapter 1 for main story. Chapter 2 for item pages that are out of the story and where you control settings and all that and cannot have the same scripting running as it does for the actual story part. Chapter 3+ for tangents that come off the main story. 

Scripting this time!

6 years ago

FWIW, AND does work perfectly fine as long as either side is an equality (=) or inequality (!=) operation.

Scripting this time!

6 years ago

Ah! It seems I did it wrong! 
The various := / = / != were confusing to my sleep deprived brain.

It seems to work perfectly fine now that I've fixed that. Thank you so much!

Scripting this time!

6 years ago
Or you could just make a toggle specifically for the effected pages and avoid specifying chapters altogether. Depends on how many pages you're talking as to whether that's easier though. (E: nvm misread an earlier post, if it's just one chapter it should be simplest to just exclude the whole thing)

IF %EXCEPTION = 1 THEN whatever

I would assume an item script is run before taking you to another page but I haven't tested it.


E2: should not attempt to be helpful before 5am

Scripting this time!

6 years ago

The chapter is more of a place holder/organizer for items. There's only about 3 of them so far, and probably won't be more than 5/6. 

With what brad suggested, either I did something wrong or it didn't work right. 
Edit: I did something wrong. This is why I shouldn't be doing this at 3 am. But it'd be nice to know how this way works as well to understand the system a bit better. 


I sorta have jumped right into the deep end without knowing how to swim, and now I'm just floundering around. 

So I'd have 
IF %EXCEPTION = 1 
THEN 
(insert everything for the normal pages) 

And then on the pages that are excluded, use the page script to change the value to '0', and that will stop anything from happening on those pages?

Scripting this time!

6 years ago
Right. Have the variable set to 1 (or whatever you want to use) when you create it, then have the links leading to any pages you want to exclude toggle that variable off. (And then back on again when the player leaves.)

All most scripts are doing is checking whatever variable you point them at for a red light or a green light. The basic IF THEN stuff will see you through 90% of scenarios you can come up with.

Scripting this time!

6 years ago

What about multiple conditions to do one thing? The and statements are buggy?

Scripting this time!

6 years ago
That's what I was on about. Use 'IF THEN' where you'd use 'AND' and throw in some 'ELSE' stuff to check for all of the variables you can dream of.

Scripting this time!

6 years ago

Alright, so I have this on the page. On-page variable trick. The base is '%%VARIABLE%=%100%TEXT%%' correct? So shouldn't this work? When I playtest it, it's not working like this. It's showing most of the other sections as well. (I'm making paragraph spaces here for easier reading, but there aren't any instory)

%%WEIU%>%1%He hisses, gritting his teeth while keeping his fractured leg off the ground.%%
%%MSPU%>%1%He rubs his forehead where I headbutted him.%
%
%%
AIMU%>%1% He rubs at his shoulder and his knee where I dislocated them.%%

Scripting this time!

6 years ago
You've edited now but I dumped all of what you originally had onto a page and it worked fine. Are you sure your variables are at 2 or higher?

Scripting this time!

6 years ago

I edited it becuase I found the problem was because I messed up with the 'WILU', but then I found a different problem of the same type further down on the page.

When I have 2+ in only WEIU, this also shows up with it. 
%AIMU%>%1% He rubs at his shoulder and his knee where I dislocated them.%%

Scripting this time!

6 years ago

Make sure you have the right number of percentage signs.

Scripting this time!

6 years ago

I do! When I'm editing the page, it shows up like this

%%AIMU%>%1%TEXT%%

And then when I'm viewing the story, it shows up like this.

%AIMU%>%1%TEXT%% 

No matter what values I have. 
 

Scripting this time!

6 years ago

Try to copy it and then paste it back in with Control + Shift + V.

Scripting this time!

6 years ago
Make sure you have a proper '>' and not '& gt;' in your script.

(which you have in the above pasted sample BTW)

Scripting this time!

6 years ago
It won't work if you're comparing different variables.

%%TOP%=%1%Bacon%%%%TOP%=%2%Cheese%%%%TOP%=%3%Ham%%

Works, because you're comparing the same variable, TOP.

%%TOP%=%1%Bacon%%%%FRANK%=%2%Cheese%%%%STEVE%=%3%Ham%%

Doesn't work, because you're comparing different variables, however:

%%TOP%=%1%Bacon%% %%FRANK%=%2%Cheese%% %%STEVE%=%3%Ham%%

Would work, because you have a space between the comparisons, so they aren't treated as one thing, and instead are three separate checks. Of course, the space between each check will always show, so it ends up looking kind of weird in practice.

Scripting this time!

6 years ago

I can't confirm this. I ran those three where %TOP = 1, %FRANK = 2, and %STEVE = 3 and got

Bacon
BaconCheeseHam
Bacon Cheese Ham

Scripting this time!

6 years ago
Weird. Comparing different variables in a chain has never worked for me.

Scripting this time!

6 years ago
Isn't the middle one just doing a more simplified version of the massive name script? Pretty sure the thing you can't do is trying to change one piece of text by checking more than one variable. I.e: You can only either check for different values of one variable and have one bit of text, or check for 'n' number of variables and have 'n' number of pieces of text all together.

Scripting this time!

6 years ago

I didn't realize that. I mean, I have this (but with 13 variables instead of just 3)  where I do that and it works just fine. 

%%STRU%>%1%With that I jerk free of his grip and hit with a flat palm to his sternum, leaving him breathless. %%%%PREU%>%1%I keep my hand flat as I chop at a specific point in his right shoulder that dislocates it and his skeletal arm crashes to the ground. He retrieves it and uses it as a shield against another blow before putting it back on.%%%%BALU%>%1%I then hook my foot behind his knee and push, his height setting him off balance and letting him crash to the floor as I stay upright. He struggles to his feet.%%

But between you and brad's suggestions, it's now fixed.

 

Scripting this time!

6 years ago
It will look at all %%VARIABLE%=%100%Text%% on-page and display the text if true.

So you won't have any problems mixing variables to create complex sentences. As for spacing, just add spaces in the %Text ... %% part as needed.

Scripting this time!

6 years ago

IF %A1 = 1 THEN 
BEGIN 
IF %HAT = 1 THEN 
BEGIN 
IF %ELEU < 2 THEN
BEGIN
%ELEU := 2
END END
IF % BALU < 2 THEN
BEGIN
%BALU := 2
END END END 
IF %RG = 1 THEN 
BEGIN 
IF %PREU < 2 THEN
BEGIN
%PREU := 2
END END END END 


I'm hoping I understand this correctly. Would this work?
If A1 equals 1, and hat equals 1, then if element is less than two, it becomes 2. If Balance is less than two, then it becomes 2. If RG equals 1, then if Precision is less than two, then it becomes 2. Right? Or do the IF/THEN not work this complex?
I mean, this would be just a sample. Wanted to double check before I go do the whole 13 set.

Scripting this time!

6 years ago
I feel like you have way too many ends, lol.

IF %A1 = 1 THEN
BEGIN
IF %HAT = 1 THEN
BEGIN
IF %ELEU < 2 THEN
BEGIN
%ELEU := 2
END END END

IF % BALU < 2 THEN
BEGIN
%BALU := 2
END

IF %RG = 1 THEN
BEGIN
IF %PREU < 2 THEN
BEGIN
%PREU := 2
END END

Is that how they logically are separated? Also, BEGIN and END are for if you have multiple statements for the result of a check. Without it, the check simply goes to the next line if it passes. The following would work as well:

IF %A1 = 1 THEN
IF %HAT = 1 THEN
IF %ELEU < 2 THEN
%ELEU := 2

Scripting this time!

6 years ago
You're too fast Killa haha! Beat me to the post!

Scripting this time!

6 years ago

Ahhah, wups. 
I don't believe that's what I was aiming for. 
If A1 = 1 is a condition for all that is below. 
A1 means that for the item you're using, you can no longer stop using your magic until it runs out. 
Hat, right glove, and left glove are magic items. 
If you're using Hat, then you cannot use the other items, and all miscellaneous magic enhancers must be in use. No mental or physical.
If you're using right glove, then you cannot use either the hat or the left glove, and all mental magic enhancers must be in use. No miscellaneous or physical. 
Left glove the same, but physical. 

But if A1 is not equal to 1, none of this applies.
 
I believe I had it mixed up in my head. Does this make more sense?

IF %A1 = 1 THEN 
BEGIN 
IF %HAT = 1 THEN 
BEGIN 
IF %ELEU < 2 THEN 
%ELEU := 2 
IF %BALU <2 THEN
%BALU := 2
END 
IF %RG = 1 THEN 
BEGIN 
IF %PREU < 2 THEN 
%PREU := 2 
END END 

Scripting this time!

6 years ago
Yeah and in Killa's code A1 being equal to 1 is also necessary to run the rest of the code. When the computer runs it through, it checks if A1 = 1 and if it is then it does the rest, and if it isn't then it ignores the rest of the code (and so on and so forth with each other 'IF' check).

E: You tend to use 'BEGIN' more if I need several things being done on one condition. E.G:

IF %VAR = 1 THEN
BEGIN
%HEALTH:= %HEALTH - 10
%STRENGTH:= %STRENGTH + 1
END
ELSE
//Blah blah blah//

Scripting this time!

6 years ago

Not from the way I understand it? What he has is 

IF %A1 = 1 THEN 
BEGIN 
IF %HAT = 1 THEN 
BEGIN 
IF %ELEU < 2 THEN 
BEGIN 
%ELEU := 2 
END END END 

IF % BALU < 2 THEN 
BEGIN 
%BALU := 2 
END 

(and another section that apparently didn't copy.) 

In the top section, there are 3 begins and 3 ends. Therefore, none of that section is still running, and the middle section is completely independent. There is one begin and one end, and therefore has no effect on the bottom section either. Please correct me if I'm misunderstanding this.


I'm pretty sure what I had in the post you replied to works the way I want it to, I'm just making sure there's no holes in it before I go and put it into my story. If you see something specific wrong with it, and perhaps a way to fix it, that would be awesome.

I try to think of it like parenthesis, or modified nesting dolls, in terms of keeping organized what depends on what. 
(A1(RG(PREU = 2   WILU = 2)   HAT(BALU = 2   ELEU = 2)   LG(STRU = 2   PSPU = 2)))

Scripting this time!

6 years ago
I can tell it won't work, even though I haven't read what does - because you must have an equal number of BEGIN & ENDS. For Example -

IF %A1 = 1 THEN
BEGIN
IF %HAT = 1 THEN
BEGIN
IF %ELEU < 2 THEN %ELEU := 2
END
END

IF % BALU < 2 THEN
BEGIN
%BALU := 2
IF %RG = 1 THEN
BEGIN
IF %PREU < 2 THEN %PREU := 2
END
END

In each case, all three variables must be true to change the last one.

Scripting this time!

6 years ago

I'm hoping to make a restart link at the end of a path that keeps track of how many times you've restarted and how often you use the powers and whether it was a complete waste of my time to script all that or not. 
It'd be in Score. +1 per time you use a power. +1,000 to  9,000 depending on which ending. Then when you hit restart, it multiplies the score by 1,000 and keeps going. So lets say they play through 5 times. The score could possibly end up being something like this.
10123024809270562018
First ending, third ending, eighth ending, seventh, second. Along with how much they used their powers, 12 times, 24 times, 92, 56, and 18. 
Just curious, but is there a number limit to the score? Any value it cannot surpass? Or could it be 40 numbers long and still be fine? (10 resets)

Also, in the reset link script, I'd put something like
%BAL := 9
%BALU := 0 
%PRE := 9 
%PREU := 0
etc for all the values I wanted to have reset, correct?
Or is there possibly a button that says 'Reset all variable values to default except these'

Scripting this time!

6 years ago

Thread about Variable Upper Limit: http://chooseyourstory.com/forums/advanced-editor-forum/message/19764

"2,147,483,647. Any higher and it wraps back around to -2,147,483,648." - BradinDvorak

This means 10123024809270562018 is too big a number.

The thread is pretty old, so not sure if anything has changed, but if it hasn't you are gonna have to find another way to track how people played your game.

Scripting this time!

6 years ago

Faq. 
Maybe I'll just have it keep track of how much you've used the powers in general, and then make all those that have suffered reading through my game comment which endings they got and how many times they restarted. 

Also, it's quite handy knowing about the not needing to create variables thing. Wish I'd known about it sooner, woulda saved me a whole lot of trouble, but ya know. Maybe it'll make things easier from here on out. 

Scripting this time!

6 years ago
You could just use smaller numbers, say +1-9 depending on the ending. Also, you could put something in the global page/link like

IF %SCORE > (SOME NUMBER NEAR THE LIMIT) THEN %SCORE:= 100,000,000 //(or whatever number you want that's below the limit)//

You could put a note in explaining that this would be the maximum score, but obviously it would limit how many times you could reset and keep increasing your score. Still, it's not likely anyone's going to play through the whole thing like 15 times, no matter how good your story is.

Scripting this time!

6 years ago

That would take away any point of it. The score shows up when people comment, and I want to see what they did. 
Having the 1-9 depending on the ending means I still have no way of knowing at all what ending they got because each time they use the powers is also a +1. You couldn't differentiate whether the addition to the score was from the ending or the powers. 
The score has no reflection of in game achievements or anything of worth to the player. Originally it was just so I could collect data about what people did. 

Scripting this time!

6 years ago
Have you considered just asking them to post it or PM you?

Using the score is pretty pointless anyhow since all it tells you is at what point they decided to comment.

Scripting this time!

6 years ago

"Faq. 
Maybe I'll just have it keep track of how much you've used the powers in general, and then make all those that have suffered reading through my game comment which endings they got and how many times they restarted. "

It'd be a pain in the arse for anyone to keep track of how many times they've used the powers, or recall it afterwards. Or if they saved it. Etc. So the score can keep track of that. But yeh, I'll have people comment what ending they got. 

Scripting this time!

6 years ago
'Author's Note: I'm actually very interested in collecting this data and would love a PM from you with a copy and paste:

You used [NAME OF POWER] %%POWER%% amount of times while playing through this path.

etc.'

Getting a sense you're making this more complicated than it needs to be.

Scripting this time!

6 years ago
Not Editing. Feel Free to Edit Lock. Really. It's Ok, go on. I will still respect you in the morning. I promise.

Scripting this time!

6 years ago

A link from the epilogue to the start again. 
Things change if you use that link instead of the one provided on the upper right hand corner. 

Edit: Ah! Sorry. Didn't see you edit the 'editting' in there. 

Scripting this time!

6 years ago
So, in theory, if you want to reset the game, you would have to literally reset every single variables you have in the story game except those variables that you don't want to change. Which would be a lot of work, if you have a lot of variables.

Scripting this time!

6 years ago

57, yeah. I made them rather short and easy to change on purpose though. Such as Y01-Y13 and Z1-Z13. The wonders of copy/paste. 

Scripting this time!

6 years ago
So can't you just do plus 10,000 each time they restarted the story?

Scripting this time!

6 years ago

I am confused by your question.

Scripting this time!

6 years ago
"Then when you hit restart, it multiplies the score by 1,000 and keeps going. So lets say they play through 5 times. The score could possibly end up being something like this.
10123024809270562018"

You wanted to multiply by 1,000, which would make the number too big. It wouldn't work. So I was just suggesting that you add 10,000 instead, every time they restarted the story game, so it wouldn't exceed the limits.

Scripting this time!

6 years ago

I was hoping to know which ending they got as well. 

I'm just gonna stick to them commenting what endings they got and the score keeping track on how much they used the energy manipulation thing. 

Scripting this time!

6 years ago
Well dont you only have 9 endings? And you were only using the thousand place to keep track of it right?

So 24,051 would mean, 2 restart, 4th ending, 51 power used.

Scripting this time!

6 years ago

Heyyyy, so, I went to test my game, and something that was previously accessible, is no longer accessible. I get this error. Did I do something wrong? Is there a way to fix this?

 

Server Error in '/' Application.

Index was outside the bounds of the array.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error: 
 

Line 45: Line 46: //must be, load storystate Line 47: State = StoryState.CreateFromString(Request.Form["SS"]); Line 48: Line 49: //determine action


Source File: c:\Websites\ChooseYourStory\ChooseYourStory.com\Story\Viewer\Default.aspx    Line: 47 

Stack Trace: 
 

[IndexOutOfRangeException: Index was outside the bounds of the array.] ChooseYourStory.Stories.StoryState.LoadFromString(String encodedSaveString) in C:\ProgramData\InedoAgent\BuildMaster\Temp\_E67973\Src\ChooseYourStory\Stories\StoryState_ToFromString.cs:63 ChooseYourStory.Stories.StoryState.CreateFromString(String storyState) in C:\ProgramData\InedoAgent\BuildMaster\Temp\_E67973\Src\ChooseYourStory\Stories\StoryState.cs:63 ASP.story_viewer_default_aspx.OnLoad(EventArgs e) in c:\Websites\ChooseYourStory\ChooseYourStory.com\Story\Viewer\Default.aspx:47 System.Web.UI.Control.LoadRecursive() +68 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3811


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2106.0

Scripting this time!

6 years ago

I've tried everything from remaking the page to deleting the global link I'd just put in. There's no link scripts directly on the link going to the error page, or page scripts on the page, otherwise I'd check that too. 
I cannot figure out how to fix it. 

I thought it had something to do with me trying to put in scripting that I hadn't checked if worked here first, but that doesn't seem to have any effect. Putting this in bugs and problems. 

Scripting this time!

6 years ago

I have hope that this is the reason for the error and that it's fixable. It's the only thing I can think of. But this is fine, right? I didn't get confirmation for my small sample the other day, and I ended up plowing ahead anyway. 

IF %A1 = 1 THEN 
BEGIN 
IF %HAT = 1 THEN 
BEGIN 
IF %ELEU < 2 THEN 
%ELEU := 2 
IF %AIMU <2 THEN
%AIMU := 2
IF %BREU <2 THEN
%BREU := 2
IF %HEAU <2 THEN
%HEAU := 2
IF %SENU <2 THEN
%SENU := 2
END 
IF %RG = 1 THEN 
BEGIN 
IF %PREU < 2 THEN 
%PREU := 2
IF %BALU <2 THEN
%BALU := 2
IF %PSPU <2 THEN
%PSPU := 2
IF %STRU <2 THEN 
%STRU := 2
IF %WEIU <2 THEN
%WEIU := 2 
END
IF %LG = 1 THEN 
BEGIN
IF %MCAU <2 THEN
%MCAU := 2
IF %MSPU <2 THEN
%MSPU := 2
IF %WILU <2 THEN
%WILU := 2
END 
END

Scripting this time!

6 years ago
Is it just on one page?

Just delete that page, and remake it again.

Scripting this time!

6 years ago

Already did that. 
Still got the same error.

Scripting this time!

6 years ago
You probably messed up some HTML code or something. Try editing the page itself, to see if that's the problem. For example, just type the words: "TESTING" on the page, save it, and load it again to see if it works or not.

Scripting this time!

6 years ago

Still there. 
Edited page with the error, and page before hand. 
Deleted and remade the page. Changed the link. Checked all scripts. 

Scripting this time!

6 years ago
Have you checked to see if any $dest scripts are missing the @ in @P100?

Scripting this time!

6 years ago

There are only two scripts that deal with $dest so far, and that deals with the codex and the page you access right before the error page. I checked them both anyway, and there's nothing wrong with them. They do exactly as they're supposed to, and they don't effect the error page at all. Just in case, I fiddled with the one that lead to the page before the error and put it as 
IF %A1 = 1 THEN $DEST := "@P" + 6  and it still took me to the desired page, and the error was still on the page after it.

Scripting this time!

6 years ago
So the page crashing was caused by On-Page code broken with Span info between the wrong %%.

You can only include html formatting in the text portion of the On-Page code. Anywhere else breaks the entire page.

Hope this helps, good luck!

Scripting this time!

6 years ago
Lol he tried to put html in the link descriptions? No wonder.

Scripting this time!

6 years ago
Lol you can put html in the link descriptions.

Scripting this time!

6 years ago
No, not that.

Scripting this time!

6 years ago

I didn't realize that could be a problem. I use the rich text editor, due to several colour changes with the text and other annoying fun stuff. So something wrong with the span info didn't even cross my mind. 

Scripting this time!

6 years ago

Any chance you can change the title of the page based on variables? 
The title of the pages address you as the reader. So when you use the in-game reset button, it changes what is being said to you. If you repeatedly make choices that end up with Ahti getting killed it'll warp to loathing scathing comments. If everything turns out to be semi-alright, or you're trying to change things towards the better, it'll be comments that tolerate you and perhaps a mild curiosity. 
This would be just musings about a feature to include after the contest, unless it's somehow really simple. 

Scripting this time!

6 years ago
I don't believe that's a variable that's exposed and that you can access. If you really, really wanted to do it, I'm thinking you could write some crazy css that would allow you to do it...

Scripting this time!

6 years ago

What'll happen if on link script: 
IF %RESETS = 2 THEN $DEST := @P16
IF %A1 = 1 THEN $DEST := @P12

If they're both true, what page does it go to? The first or last $dest listed? Or does it spazz out the system?

Scripting this time!

6 years ago
I'd guess it would set page destination to page 16, because that's first. Actually, I've been wondering if any code written after the destination set is read and have been putting it beforehand just in case, so I'll test it now.

EDIT: I was wrong- looks like it reads the whole thing and applies the last one, so the last true statement that sets the page destination is where you'll go and the rest is null. You can always quickly test this stuff yourself if you're not sure.

Scripting this time!

6 years ago
Yes, because of the order of the processing, the script cannot stop in the middle of execution, so the destination only gets applied after the entire script has been completed.

Scripting this time!

6 years ago

Is there a way to have multiple variables affect whether or not a certain text pops up in the middle of the page?
With scripting and pagetext, that's only at the bottom of the page, right? On page variables can be anywhere on the page, but only deal with one variable at a time? 

If I'm misunderstanding it and there is a way to do it, lemme know. Otherwise I guess I'll have to figure out some throwaway variables to include. Pagescript runs before you read the page itself, right? 

Scripting this time!

6 years ago
Using the pagetext variable, you can place text at the beginning of the page text or at the end of the page text, depending on if you use $pagetext := $pagetext + "Stuff" or $pagetext := "Stuff" + $pagetext. Combine that with on page variable if statements and you really should be able to put darn near anything anywhere you want it.

Scripting this time!

6 years ago

On page variable if statements? 

Scripting this time!

6 years ago

Scripting this time!

6 years ago

Those seem to be dealing with only 1 variable at a time though. 
In pagetext it would be something like 
IF %PSP > 1 THEN
BEGIN
IF %STR > 1 THEN 
$PAGETEXT := $PAGETEXT + "With your speed and strength combined, you hit him multiple times with considerable force."
END

Is there a way to have that in the middle of the page instead of the end of the page?

Scripting this time!

6 years ago
If you put

$PAGETEXT := "With your speed and strength combined, you hit him multiple times with considerable force." + $PAGETEXT

It will appear before the text typed on the page.

I have never tried nesting if statements with the in-page variable tricks. I'm not sure I could count the number of percent signs I'd need to get that right. It might work, it might not.

Scripting this time!

6 years ago

What do the % with onpage variables do anyway? I believe two together, %%, is start/stop. Not sure what the rest do, or how.

Scripting this time!

6 years ago
I haven't tried to decipher their exact meanings yet. I just copy and paste from that page when I want to use them. :)

Scripting this time!

6 years ago
You made me curious...and it blew up. Apparently you CANNOT nest if statements using the on-page variable tricks and piles and piles of percent signs.

Scripting every time!

6 years ago
Eh, this can be hard. You could set another variable equal to one in the page script with an IF statement regarded the two or more variables you want to affect the text. For example, if you want certain text to appear if %VAR1, %VAR2, and %VAR3 all equal 1, you could put something like:

IF %VAR1 = 1 THEN IF %VAR2 = 1 THEN IF %VAR3 = 1 THEN %VAR4:= 1

And use on page script with %VAR4. Can even set %VAR4 to different values depending on how many of 'n' number of variables that affect the text are equal to 1 or 0, or any combination thereof, and have 'n' number of text options.

Alternatively, if it's a major change to the text or storyline, then I'd copy and paste onto a new page, change the text accordingly, and put in the link script something like:

IF %VAR1 = 1 THEN IF %VAR2 = 1 THEN IF %VAR3 = 1 THEN $DEST:= @PX

(Also $PAGETEXT can be used to add stuff at the start by doing $PAGETEXT := $PAGETEXT + "TEXT", or setting the text to whatever you want depending on certain variables, which might actually be easier than creating a new page)

EDIT: Ogre is a faster typer than me.

Scripting every time!

6 years ago

This is what I was thinking when I mentioned 'throwaway variables'. Of course, I'd have to add them all to the reset script, and there's probably about a dozen at least to do if I were to do it that way. 

Hopefully there's something easier, but if I can't keep the coloured text with pagetext easily, or some other method, I can always do this. 

Scripting every time!

6 years ago
Yeah, it's a pretty crude, but so is making new pages. Probably about 10,000 words or so of my contest story is copy and pasted from pages, then changed for different choices picked by the reader to affect the storyline differently. On page script tends to be better for the smaller pages- I barely use $PAGETEXT because it can only add stuff at the start or end really.

Scripting this time!

6 years ago
It depends. If you go into detail we might be able to find a way to make it work. But it'd have to involve on page variables, not pagetext.

Scripting this time!

6 years ago
I dunno. Maybe I'm not the most efficient, but there are places where I have piles of code and blocks of text completely in my script and zero text actually on the page at all with a nice fat line at the end of my text adding %MYTEXT to $pagetext.

Scripting this time!

6 years ago

I didn't think about that. That'd be easy to do instead. 

When doing $PAGETEXT, can you still have colour changes? 

Scripting this time!

6 years ago
Yeah, but you'd need to do that manually with html. Put tags around it like <font color= red>TEXT</font>.

Scripting this time!

6 years ago
Absolutely! You can include html and css in there, too, if you want, just all text (and if you want to put in special characters, you can even do that with ascii code tags, like if you want conversations with quotation marks).

Scripting this time!

6 years ago

With how often I change colours, I'm going to have to pass on this method for now. I'll keep it in mind as a possibility. 

Scripting this time!

6 years ago
You could always use a site like this to write your text, then copy and paste into the script file.

Scripting this time!

6 years ago

Alright. Thank you!

Scripting this time!

6 years ago
Bookmarked- that's really useful. Thanks:)

Scripting this time!

6 years ago

Just clarifying how ELSE statements work. 

IF %PSP = 2 THEN
BEGIN
IF %STR = 2 THEN
$PAGETEXT := $PAGETEXT + "speed and strength"
END 
ELSE
BEGIN
IF %PSP = 2 THEN 
$PAGETEXT := $PAGETEXT + "speed"
IF %STR = 2 THEN
$PAGETEXT := $PAGETEXT + "strength"
END

If I understand this correctly, if you have both Speed and Strength set to 2, then it only shows the first batch of pagetext, not the second? Then if you only have one set to 2, it only shows dialogue for that one attribute instead of both. 

Scripting this time!

6 years ago
Your script is a little strange I think. Because of the first BEGIN, the ELSE statement applies to the the first IF statement regarding %PSP. The ELSE statement will come into effect if %PSP is not equal to 2, but then you use an IF statement after the ELSE to check if %PSP is equal to 2. To do what you thought that did, I'd script something like this:

IF %PSP = 2 THEN
BEGIN //BEGIN used so you can use apply another IF statement for further checks but also use an ELSE statement to apply to the first IF statement//
IF %STR = 2 THEN $PAGETEXT:= $PAGETEXT + "speed and strength"
ELSE $PAGETEXT:= $PAGETEXT + "speed" //ELSE used here without an IF to check because the only logical possibility is that %STR is not equal to 2 and %PSP is, so it only shows "speed"//
END
ELSE IF %STR = 2 THEN $PAGETEXT:= $PAGETEXT + "strength" //ELSE applies to IF before the BEGIN, because all the stuff between BEGIN and END applies only if that IF statement is true, and is null if not, thus triggering the ELSE commands//

Scripting this time!

6 years ago

For the sake of organization and simplicity, if I were to move the BEGIN, does it make a difference?
BEGIN
IF %PSP = 2 THEN 
IF %STR = 2 THEN
$PAGETEXT := $PAGETEXT + "speed and strength"
END 
ELSE
BEGIN
IF %PSP = 2 THEN 
$PAGETEXT := $PAGETEXT + "speed"
IF %STR = 2 THEN
$PAGETEXT := $PAGETEXT + "strength"
END

(also, for that first 'if then if then', does it have to be connected by another begin/end for both to need to be true to move on, or is it fine as is?)

 

Scripting this time!

6 years ago
In this one, and the first one, you're crossing the lines of IF statements and BEGIN END blocks. That's a big no-no and makes things go really screwy.

If you are going to have a BEGIN...END block, contain all of the IF...THEN...ELSE statements inside it. This last one has BEGIN...IF...END, and then the ELSE statement. That makes no logical sense (to me or the parser). Make sure all the IF...THEN...ELSE is inside a BEGIN...END and that all BEGIN...END blocks contain all parts of the IF...THEN...ELSE sections without breaking over the blocks. You can nest as much as you like, but don't cross the streams!

BEGIN...IF...THEN...ELSE...END...IF...THEN...BEGIN...IF...THEN...ELSE...END...ELSE...BEGIN...END

Scripting this time!

6 years ago
But you can do BEGIN ... END ELSE, right? Like in my example, you can do a IF ... THEN BEGIN ... END block, then use ELSE afterwards to add another command if the IF statement before the BEGIN is not true. I'm pretty certain I've done this a load of times and it's worked.

Scripting this time!

6 years ago

IF...THEN...BEGIN...IF...THEN...ELSE...END...ELSE
In his example, there's that. An else after the end which I believe applies to the first IF THEN here. So I would assume so. Unless he was rambling randomly. 
By crossing streams, I'm pretty sure he meant have nothing 'else' applies to be inside a BEGIN that the else is not in. Can't have else apply to anything outside the begin/end sequence that it is written in. 

 

Scripting this time!

6 years ago
Yes, because that doesn't break the blocks. That would be IF...BEGIN-END...ELSE. I always learned this with tabs, but of course with HTML, that's not a thing. Let's see if this works:

IF THEN
 BEGIN
  code here
 END
ELSE
 BEGIN
  code here
 END

If that works, you can see the blocks, and you cannot do this:

IF THEN
 BEGIN
  ELSE
 END

Because as you can see, the IF THEN block doesn't line up with the ELSE and breaks the code.

Scripting this time!

6 years ago
Oh yeah, I see what you're saying now.

Scripting this time!

6 years ago

Welp, this is going to get very confusing very fast. Wish I had known just how complex this was going to be BEFORE entering the contest. Or perhaps had already completed a story in this universe so I could've just copy/pasted my script instead of figuring it out and writing it all.

IF %PSP = 2 THEN IF %STR = 2 THEN IF %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "speed and strength and weight"

IF %PSP = 2 THEN IF %STR = 2 THEN IF %PRE = 2 THEN $PAGETEXT:= $PAGETEXT + "speed and strength and precision"

ELSE
BEGIN
IF %PSP = 2 THEN IF %STR = 2 THEN $PAGETEXT:= $PAGETEXT + "speed and strength" 

IF %WEI = 2 THEN IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "speed and weight"

ELSE 
BEGIN
IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "speed"
END

I can tell already this isn't going to work, since I believe that 'else' only applies to the previous statement? Not sure how to have something like this so that if you have 3, the text for only having 1 or 2 don't show up. Or if I have 2, the text for only having 1 doesn't show up. 

Scripting this time!

6 years ago
Yes, these get rather exponentially complex quickly. Are you trying to write code will display just that bit of text or information? In other words, what do you want to show? Do you want to show just the words "speed and strength" or the actual values, or other stuff as well? And you have three variables and you want to show just the ones that are equal to two?

Is there any reason you can't simply show them all, one at time?

So just:
IF %PSP = 2 THEN "spped"
IF %STR = 2 THEN "strength"
IF %WEI = 2 THEN "weight"

Scripting this time!

6 years ago

I have a couple pages where I just have on-page variables, but for energies that'd stack or affect one another, I found it rather limited and stunted. If this ends up being too terribly complex (I have 13 of these attribute variables to work with, different combinations. I won't be doing ALL combos, as that'd be ridiculous, but a few here and there to spice things up would be nice. If it's too complex, I'll have to stick with on-page stunted text and wait for this until after the contest.) This would be an example of what I'd have, if this code were to have been able to work.

IF %PSP = 2 THEN IF %STR = 2 THEN IF %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "My hand is blindingly fast as I swing hard, catching a person in the chest with enough force to knock the wind out of him and send him tumbling backwards, knocking over another two people. The weight behind the hit might've been enough to fracture his sternum, and I worry about him. My intent is to keep them away from the person with me, not send them to the hospital. I'm distracted by my worry, and I feel a blinding pain as someone lands a left hook to my jaw."


IF %PSP = 2 THEN IF %STR = 2 THEN IF %PRE = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit the same spot on a person's chest rapidly with enough force to set him off balance and take a couple steps back out of my immediate fighting range. A different person takes their place."

ELSE
BEGIN
IF %PSP = 2 THEN IF %STR = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit a person hard and fast, but my hits aren't very concentrated. It does damage though, and although he seems determined, it appears he'll withdraw soon." 

IF %WEI = 2 THEN IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I quickly place my hands on someones shoulders and jump, bearing all my increased weight on those points, knocking them off balance and they start to fall. Before I loose my balance as well, I quickly extend my legs to the ground again and let go. It'll keep people from coming from that direction for a moment, but I'll have to deal with him again later as I turn my attention to someone else in the mob."

ELSE 
BEGIN
IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I don't have force to put behind my hits, nor really much precision. I try my best to aim for soft spots that temorarily take them out of the fight, but they'll ultimately be just fine and coming back. I'm mostly just conserving my energy for a longer fight until Ammon comes to help me fend off the mob trying to lynch my newfound friend whom I don't know their name yet. Or perhaps if he doesn't come, I can outlast the mob and when they've drained their own energy stores we can skedaddle outta here."
END
 

Scripting this time!

6 years ago
For something like that, I think it's time to think of another way. After all, if you have 13 different variables, the possible combinations are 6 BILLION. No, I'm not exaggerating, that's what it is. The problem is that the scripting system here functions (as it is), but it is not super powerful. For that volume of options, you probably need arrays and databases. Since there's only a couple weeks left, if I were you I'd focus on just adding a couple in-page variable tricks with a few words for flavor (and hope someone notices them) -- especially if this isn't actually having a direct effect on the story.

As for the code you listed there...well first of all, it breaks. Next, there's no ELSE on the first IF statement, so if the first one is true, the processor will check the other ones as well. If I'm reading what you want to do right, this might work:

IF %PSP = 2 THEN IF %STR = 2 THEN IF %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "My hand..."
ELSE IF %PSP = 2 THEN IF %STR = 2 THEN IF %PRE = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit ..."
ELSE IF %PSP = 2 THEN IF %STR = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit a person..."
ELSE IF %WEI = 2 THEN IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I quickly..."
ELSE IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I don't have..."

This series works without and BEGIN blocks because each level down is less restrictive. Since it evaluates from the outside in, it will just process until it finds the first statement that is true, then will add that pagetext, then exit the sequence. In this particular case, if PSP and STR are 2 AND WEI and PSP are 2, the first sequence would be the only one processed.

Scripting this time!

6 years ago

Well, yes. I realized that. Like I said - "I won't be doing ALL combos, as that'd be ridiculous, but a few here and there to spice things up would be nice." And there prolly won't be anything more than maybe half a handful that depend on 3 variables. All the ones that depend on just 1 will be there. Quite a few that depend on 2, but not all combos. And there's also groupings, if you're using the attributes associated with the right glove (strength, speed, etc), then you can't use any that are associated with the left glove (mental abilities, willpower), or any with the hat (miscellaneous, elemental) So there's a group of 5, 3, and 5 that you can mix around with and combine with itself, but not the other groupings. 

Alright, that was a lot simpler then I thought it'd be. Didn't realize you could stack 'ELSE' like that. Thank you. ^_^ You're a life saver. 

Scripting this time!

6 years ago
Sounds great, glad to help! Just remember that it will always go in order, and when you make a stack like that, as soon as the parser finds a combination that's true, it won't even look at any other combinations after that line.

Scripting this time!

6 years ago
Hmmm... Did that work? I'm looking back at it, and I'm not sure this parser will do that the way I think it will. If that doesn't work, the ELSE statements might be matched with the most previous IF, which is not what we'd want to happen. If that one works, just ignore this. If that one doesn't work, you might try adding a couple BEGIN END blocks to ensure the ELSE connects with the right IF:

IF %PSP = 2 THEN
BEGIN
IF %STR = 2 THEN IF %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "My hand..."
END
ELSE IF %PSP = 2 THEN
BEGIN
IF %STR = 2 THEN IF %PRE = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit ..."
END
ELSE IF %PSP = 2 THEN IF %STR = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit a person..."
ELSE IF %WEI = 2 THEN IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I quickly..."
ELSE IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I don't have..."

Scripting this time!

6 years ago

IF %PSP = 2 THEN 
BEGIN 
IF %STR = 2 THEN IF %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "My hand..." 
END 
ELSE IF %PSP = 2 THEN 
BEGIN 
IF %STR = 2 THEN IF %PRE = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit ..." 
END 
ELSE IF %PSP = 2 THEN
BEGIN
IF %STR = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit a person..." 
END
ELSE IF %WEI = 2 THEN
BEGIN
IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I quickly..." 
END
ELSE IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I don't have..."


I tried it the first way you suggested, tried to the one mentioned above. Tried altering it a bit myself to see if maybe you'd just stopped halfway through. No matter what I do though, I don't get the text for anything other than if psp, str, and wei = 2. 

Scripting this time!

6 years ago

It's not working because macroscopically, you have something like this:

IF %PSP = 2 THEN
(BLOCK A)
ELSE IF %PSP = 2 THEN
(BLOCK B)

If %PSP is 2, it'll execute block A and then break out of the chain, without ever even considering block B. If it isn't 2, naturally neither of the blocks will execute. In this case, you've got multiple conditions that have some shared subconditions, so they each must be tested as a whole, and this is where a few logical ANDs can be really useful.

IF %PSP = 2 AND %STR = 2 AND %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "My hand..."
ELSE IF %PSP = 2 AND %STR = 2 AND %PRE = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit..."
ELSE IF %PSP = 2 AND %STR = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit a person..."
ELSE IF %PSP = 2 AND %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "I quickly..."
ELSE IF %PSP = 2 THEN $PAGETEXT:= $PAGETEXT + "I don't have..."

Don't be afraid of using AND and OR when you're dealing strictly with equality/inequality (= and !=). That's when they actually do work. In the event, however, that you end up using greater/less comparisons, you need to branch out your possibilities like this:

IF %PSP = 2 THEN
  BEGIN
    IF %STR = 2 THEN
      BEGIN
        IF %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "My hand..."
        ELSE IF %PRE = 2 THEN $PAGETEXT:= $PAGETEXT + "I hit ..."
        ELSE $PAGETEXT:= $PAGETEXT + "I hit a person..."
      END
    ELSE IF %WEI = 2 THEN $PAGETEXT:= $PAGETEXT + "I quickly..."
    ELSE $PAGETEXT:= $PAGETEXT + "I don't have..."
  END

Scripting this time!

6 years ago
Nice one. You know, I didn't even look at the actual variables, I was just copying and pasting. That'll show me!

Scripting this time!

6 years ago

IF %PSPU > 1 THEN
BEGIN 
IF %STRU > 1 THEN
BEGIN 
IF %WEIU > 1 THEN $PAGETEXT := $PAGETEXT + "My hand..."
ELSE IF %PREU > 1 THEN %PAGETEXT := $PAGETEXT + "
ELSE $PAGETEXT := $PAGETEXT + "I hit..."
END
ELSE IF %WEIU > 1 THEN $PAGETEXT := $PAGETEXT  + "I quickly ... "
ELSE IF %BALU > 1 THEN $PAGETEXT := $PAGETEXT + "PSPU AND BALU"
ELSE $PAGETEXT := $PAGETEXT + "I don't have ...."
END 
IF %STRU > 1 THEN 
BEGIN 
IF %BALU > 1 THEN $PAGETEXT := $PAGETEXT + "BALU AND STRU"
ELSE IF %WEIU > 1 THEN $PAGETEXT := $PAGETEXT + "STRU AD WEIU"
ELSE $PAGETEXT := $PAGETEXT + "STRU"
END 
IF %WEIU > 1 THEN $PAGETEXT := $PAGETEXT + "..." 
IF %PREU > 1 THEN
BEGIN
IF %BALU > 1 THEN $PAGETEXT := $PAGETEXT + "PREU AND BALU" 
ELSE $PAGETEXT := $PAGETEXT + "PREU"
IF %BALU > 1 THEN $PAGETEXT := $PAGETEXT + "BALU" 


If I'm understanding this correctly, this should work, yes?

Scripting this time!

6 years ago
The more variables you add, the more complicated the script gets via my way. There's probably an easier way that doesn't involve scripting every possible combination of the variables that Brad or Killa could figure out though. Couldn't you use on page script for this? You could do something like:

%%PSP%=%2%speed%%%%STR%=%2%and strength%%%%WEI%=%2%and weight%%%%PRE%=%2%and precision%% and just keep going with as many variables as you want.

Edit: Ogre you're too fast!

Edit 2: This way causes a problem if %PSP is not equal 2 though, because you'll have a random 'and'. You could always get rid of those but it might looks weird.

Scripting this time!

6 years ago

I do have that on a page. When you do what you're explicitly told not to do, and one of the only non-hero endings. (small sample)

I say, starting off softer and increasing to a shout.  
%%STRU%>%1%With that I jerk free of his grip and hit with a flat palm to his sternum, leaving him breathless. %%%%PREU%>%1%I keep my hand flat as I chop at a specific point in his right shoulder that dislocates it and his skeletal arm crashes to the ground. He retrieves it and uses it as a shield against another blow before putting it back on.%%%%BALU%>%1%I then hook my foot behind his knee and push, his height setting him off balance and letting him crash to the floor as I stay upright. He struggles to his feet. %%%%PSPU%>%1%My foot is blindingly fast and I land a kick, then a third and a fourth. %%

This is the most fluid I could have that way. If you look, no matter what combination you get, it does make sense. No random starting words that might've connected to something else that isn't there. This is also a lesser fight, where what your stats are don't affect anything at all besides the words on the page. For the big main fight, I wanted to go fancy. Different combinations mean different courses of action, and the injuries from those actions are still present in the epilogue, including hospital fees or going to court because of the various people you've seriously injured.  

 

Scripting this time!

6 years ago

Still wondering about the IF %PSP = 2 THEN IF %STR = 2 THEN and if that's valid or if I have to seperate it be begin/end statements. 

Scripting this time!

6 years ago
Yeah that's valid- you can chain as many variables as you want like that if you like.

Scripting this time!

6 years ago
Yes, you don't need any BEGIN...END blocks unless you want to do more than one thing in the IF statement. In your example, you're only doing one thing: a second IF statement. So this is legal:

IF THEN IF THEN IF THEN do this ELSE do this ELSE do this

In your case, here it is logically with spacing to make the blocks clearer:

IF %PSP = 2 THEN
 IF %STR = 2 THEN $PAGETEXT := $PAGETEXT + "speed and strength"
 ELSE
  BEGIN
   IF %PSP = 2 THEN $PAGETEXT := $PAGETEXT + "speed"
   IF %STR = 2 THEN $PAGETEXT := $PAGETEXT + "strength"
  END

Note how everything after the first line is simply one statement inside the first IF statement. You could even add an ELSE at the end of the block for code to do if PSP is not 2.

Scripting this time!

6 years ago

That makes things a whole lot simpler.