Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Simple Advanced Editor Question

9 years ago

Just wondering:

What script do I put in to have text show only if a certain choice was picked?

eg. Character in front of you. Can say. "I hate you" or "Lets be friends!"
You need their help, but if you pick 1st option you lose 10 relations, you gain 10 if you pick the 2nd. Either way you will still travel with them and their relation will matter later and change their dialouge.

I am assuming its something like:

IF %MEAN = 1 THEN
SHOW = blablabla

Obviously I am missing something so would like some help.

P.S. What's the difference between := and =

Simple Advanced Editor Question

9 years ago

You can put it right on the page as %%MEAN%=%1%blablabla%% or in a page script as IF MEAN = 1 THEN $PAGETEXT := $PAGETEXT + "blablabla".

The difference between := and = is that := is an assignment operator: "%VAR := 1" means "assign a value of 1 to %VAR", whereas = is an equality operator: "%VAR = 1" simply means "%VAR equals 1"—it doesn't do anything on its own and must be used in conjunction with an IF statement.

Simple Advanced Editor Question

9 years ago

Thanks a heap!

Now I can make it look like choices matter more then they do! :D

Simple Advanced Editor Question

9 years ago

No problem.

Also, if you go the page script route, don't forget the percentage sign ("IF %MEAN = 1...") like I did.

Simple Advanced Editor Question

9 years ago

Just like the dev team for Mass Effect.

Simple Advanced Editor Question

9 years ago

Hehe... that game was a huge success, so I sure hope it works out like that xD

Simple Advanced Editor Question

9 years ago

New question!

If I have a Variable, TOTAL, to help determine the total value of 4 other Variables, ONE, TWO, THREE and FOUR, could I type into global link:

%TOTAL := %ONE + %TWO + %THREE + %FOUR

It lets me do this, but I am just wondering if it will achieve what I want it to.

 

Simple Advanced Editor Question

9 years ago

Yes.

However, note that since the processing order is "Variable Changes (±) > Global Link Script > Link Script", if you change the value of ONE, TWO, THREE, or FOUR in a specific link script instead of using the ± button, that change won't be reflected in the TOTAL until another link is clicked unless "%TOTAL := %ONE + %TWO + %THREE + %FOUR" is also present in that link script.

Simple Advanced Editor Question

9 years ago

A combination of the two previous questions. Would this work?

 

%%DONETOTAL%=%0%You are at sea now. There are 4 islands for you to explore.%% 

%%DONETOTAL%=%1%With 1 down only 3 remain.%%
%%DONENORTH%=%1%Since north is done you now have knowledge of...%% 
%%DONEEAST%=%1%Since east is done you now have knowledge of...%% 
%%DONESOUTH%=%1%Since south is done you now have knowledge of...%% 
%%DONEWEST%=%1%Since west is done you now have knowledge of...%%

%%DONETOTAL%=%1%With 2 down only 2 remain.%% 
%%DONENORTH%=%1%Since north is done you now have knowledge of...%% 
%%DONEEAST%=%1%Since east is done you now have knowledge of...%% 
%%DONESOUTH%=%1%Since south is done you now have knowledge of...%% 
%%DONEWEST%=%1%Since west is done you now have knowledge of...%% 

%%DONETOTAL%=%1%With 3 down only 1 remain.%% 
%%DONENORTH%=%1%Since north is done you now have knowledge of...%% 
%%DONEEAST%=%1%Since east is done you now have knowledge of...%% 
%%DONESOUTH%=%1%Since south is done you now have knowledge of...%% 
%%DONEWEST%=%1%Since west is done you now have knowledge of...%% 

%%DONETOTAL%=%1%With 4 down only none remain.%% 
%%DONENORTH%=%1%Since north is done you now have knowledge of...%% 
%%DONEEAST%=%1%Since east is done you now have knowledge of...%% 
%%DONESOUTH%=%1%Since south is done you now have knowledge of...%% 
%%DONEWEST%=%1%Since west is done you now have knowledge of...%%

 

Think of
DONETOTAL as TOTAL
DONENORTH as ONE
DONEEAST as TWO
DONESOUTH as THREE
DONEWEST as FOUR

in regards to previous examples.

Other questions in regards to this:
Do I add THEN after each one so that the paragraphs are joint conditions?
Also is there a way to get rid of the big gap it creates, when you don't have any variables?

 

Thanks a heap!

Simple Advanced Editor Question

9 years ago

To get rid of the gaps, just run it all together in one big block of text. (Add spaces behind the % to anticipate more than one showing at a time)

%%DONETOTAL%=%0%You are at sea now. There are 4 islands for you to explore.%%%%DONETOTAL%=%1%With 1 down only 3 remain.%%%%DONENORTH%=%1%Since north is done you now have knowledge of...%%%%DONEEAST%=%1%Since east is done you now have knowledge of...%%%%DONESOUTH%=%1%Since south is done you now have knowledge of...%%%%DONEWEST%=%1%Since west is done you now have knowledge of...%%%%DONETOTAL%=%1%With 2 down only 2 remain.%%%%DONENORTH%=%1%Since north is done you now have knowledge of...%%%%DONEEAST%=%1%Since east is done you now have knowledge of...%%%%DONESOUTH%=%1%Since south is done you now have knowledge of...%%%%DONEWEST%=%1%Since west is done you now have knowledge of...%%%%DONETOTAL%=%1%With 3 down only 1 remain.%%%%DONENORTH%=%1%Since north is done you now have knowledge of...%%%%DONEEAST%=%1%Since east is done you now have knowledge of...%%%%DONESOUTH%=%1%Since south is done you now have knowledge of...%%%%DONEWEST%=%1%Since west is done you now have knowledge of...%%%%DONETOTAL%=%1%With 4 down only none remain.%%%%DONENORTH%=%1%Since north is done you now have knowledge of...%%%%DONEEAST%=%1%Since east is done you now have knowledge of...%%%%DONESOUTH%=%1%Since south is done you now have knowledge of...%%%%DONEWEST%=%1%Since west is done you now have knowledge of...%%

 

Simple Advanced Editor Question

9 years ago

Also, your "="s are all 1, you probably meant 1-4 for totals. I didn't account for this in my sample above.

 

Example -

%%DONETOTAL%=%1%With 1 down only 3 remain.%%
%%DONENORTH%=%1%Since north is done you now have knowledge of...%% 
%%DONEEAST%=%1%Since east is done you now have knowledge of...%% 
%%DONESOUTH%=%1%Since south is done you now have knowledge of...%% 
%%DONEWEST%=%1%Since west is done you now have knowledge of...%%

%%DONETOTAL%=%2%With 2 down only 2 remain.%% 
%%DONENORTH%=%2%Since north is done you now have knowledge of...%% 
%%DONEEAST%=%2%Since east is done you now have knowledge of...%% 
%%DONESOUTH%=%2%Since south is done you now have knowledge of...%% 
%%DONEWEST%=%2%Since west is done you now have knowledge of...%% 

%%DONETOTAL%=%3%With 3 down only 1 remain.%% 
%%DONENORTH%=%3%Since north is done you now have knowledge of...%% 
%%DONEEAST%=%3%Since east is done you now have knowledge of...%% 
%%DONESOUTH%=%3%Since south is done you now have knowledge of...%% 
%%DONEWEST%=%3%Since west is done you now have knowledge of...%% 

%%DONETOTAL%=%4%With 4 down only none remain.%% 
%%DONENORTH%=%4%Since north is done you now have knowledge of...%% 
%%DONEEAST%=%4%Since east is done you now have knowledge of...%% 
%%DONESOUTH%=%4%Since south is done you now have knowledge of...%% 
%%DONEWEST%=%4%Since west is done you now have knowledge of...%%

Simple Advanced Editor Question

9 years ago
In regards to the 1's I mean:
The DONETOTAL is the other 4 added together. But the other ones are basically - You done this, so now its a 1, - so if you haven't done this, its a 0 - which means you won't see it unless you done it.

Hmm I think I could just make it:

%%DONETOTAL%=%1%With 1 down only 3 remain.%%
%%DONETOTAL%=%2%With 2 down only 2 remain.%%
%%DONETOTAL%=%3%With 3 down only 1 remain.%%
%%DONETOTAL%=%4%With 4 down only none remain.%%
%%DONENORTH%=%1%Since north is done you now have knowledge of...%%
%%DONEEAST%=%1%Since east is done you now have knowledge of...%%
%%DONESOUTH%=%1%Since south is done you now have knowledge of...%%
%%DONEWEST%=%1%Since west is done you now have knowledge of...%%

Should it still be one block?

%%DONETOTAL%=%1%With 1 down only 3 remain.%%%%DONETOTAL%=%2%With 2 down only 2 remain.%%%%DONETOTAL%=%3%With 3 down only 1 remain.%%%%DONETOTAL%=%4%With 4 down only none remain.%%%%DONENORTH%=%1%Since north is done you now have knowledge of...%%%%DONEEAST%=%1%Since east is done you now have knowledge of...%%%%DONESOUTH%=%1%Since south is done you now have knowledge of...%%%%DONEWEST%=%1%Since west is done you now have knowledge of...%%

I will probably test these two by changing the variables, (along with testing the ones you posted above), so that's all for now. :D

Simple Advanced Editor Question

9 years ago
NEW QUESTION:

Is there a way to make extra text show on a page the first time the reader goes to it without using variables? Or is there a way to use only one variable, but for more then 1 page.

ie. Start Page
Page 2
Page 3
Page 4

You start on Start Page. Then you can go to any of the other pages.
From any of the other pages you can go back to Start Page.
So it repeats, but I want extra text for the first time you visit the other pages.

Simple Advanced Editor Question

9 years ago

Yeah, you can have that, but will need a %VARIABLE to keep track of which pages have been visited/how many times. You can use that %VARIBLE with either On Page Scripting OR Pagetext := Scripting.

Simple Advanced Editor Question

9 years ago
How can you track every page with 1 variable?

Or are you just confirming it can be done in general with a variable per page?

Simple Advanced Editor Question

9 years ago

Yes, 1 variable per page. Though mathematically you could use just one variable - giving it the number of possible page visit combinations... (yeah, too much work there).

Simple Advanced Editor Question

9 years ago
MORE QUESTIONS!
_____________________


You arrive from %%SCORE%=%1%the steering wheel.%% %%SCORE%=%2%the front of the ship.%% %%SCORE%=%3%the middle of the ship.%% %%SCORE%=%4%below the deck.%% %%SCORE%=%5%the captains cabin.%% %%SCORE%=%6%the right side of the ship (starboard).%% %%SCORE%=%7%the left side of the ship (port).%% %%SCORE%=%8%the back balcony.%%

You are at the middle of the ship.

___________________


Steering Wheel - 1
Front - 2
Middle - 3
Below Deck - 4
Captains Cabin - 5
Starboard - 6
Port - 7
Back Balcony - 8


____________________

I am using SCORE to keep track of what page you come from. What I done was set it so each time you click a 'moving location' link, the variable SCORE would be RESET to the value besides the locations (see above).

Testing this I ended up getting a few glitches where the score wouldn't work properly. Was just wondering if there is a better way to do this (or something I need to change).


Thanks a heap!

Simple Advanced Editor Question

9 years ago

That should work. If you are having 'bugs' then something in the math and/or logic is broken. Note that variable changes happen when you leave the page, not when you enter it, so you will see a timing issue when changing variables between Links, Page, and Item Scripts.

Simple Advanced Editor Question

9 years ago
So if you click, say, middle. The variable SCORE will become 3 as the page middle is loading? Or when the link is clicked?
But mainly just wondering if clicking links really fast breaks the scripts/variable changes?

Thanks!

Simple Advanced Editor Question

9 years ago

Try clicking on the Variables to Show On every page, then step through your pages and see what the values are as you click the links and if they match what you are expecting to see, as you go along.

Simple Advanced Editor Question

9 years ago
Good idea! Trying this.

EDIT - It helped work out what I was doing wrong...
I didn't tick -Use Multiple- next to the variable change xD

Simple Advanced Editor Question

9 years ago

Glad you figured it out!

Simple Advanced Editor Question

9 years ago
I can appreciate you wanting to add this much detail to the story. That said, you could consider, well, dropping this idea entirely. After all, the reader was just there, so they know where they just came from... is it worth this kind of complexity to add something that most likely no one will even notice?

Simple Advanced Editor Question

9 years ago
Most people likely won't notice, but some people might. BUT all the story will have is detail, I am trying to make it really matter what choices you make, where you look and where you use items.

This detail is pretty small, but say if you are going from Middle to Front. I want the text to be something like "walking between the tall dust covered crates you arrive at the front of the ship." (but more detail!)

If it proves to be too bothersome I will get rid of it, but I won't be happy about it xD

(Also finding it fun to learn about this type of scripting, its like simple game making! Writing is fun too [but will come later]).

Simple Advanced Editor Question

9 years ago

What kind of glitches?

Simple Advanced Editor Question

9 years ago
I would be at say, middle, then go to front (it says I came from middle), then go to middle (it says I came from front) then go to the front (it says I came from front).

Will test it a bit more, to make sure that its. (Should be.)

Simple Advanced Editor Question

9 years ago
Use a custom variable instead of score. Dunno if it will fix it, but variables should be related to what the actually do.

Simple Advanced Editor Question

9 years ago
I don't want to get bogged down in Variables so I want to min-max. But I might change it, not sure if it will matter thought.

I am trying to re-use variables that are just slight text changes, like where you come from, since it isn't really affecting the plot (yet).