Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Variables/Link restriction script

12 years ago

First, I must say I know literally nothing about scripting. So I think I'll describe what I've been doing manually(no script) and see if anyone knows of a script that will do it for me.

I have been keeping track of the scores given to each variable per link(this is what I would love scripting to do for me as it's a lot of work). Then whenever I come to a point where I need the player's variable score to determine what link options they receive(typically ranging between 1 of 2 or 1 of 3).

What I have been doing is taking the highest possible score of each variable and subtracting 15 from it to get the number to use in the link restriction. And the type I use in link restrictions for this sort of thing is going to be either > or <

So it looks something like this: (X represents highest possible score for that variable)

Variable A> X - 15 --->link sends player to Page A

Variable A< X - 15 --->link sends player to Page B

 

Basically I would love to find a script to calculate the X -15 automatically for me, then make the right link appear/dissapear. If there isn't anything like this, I'll just keep doing it manually. Just thought I'd ask since I'm only on chapt 3 and have between 5-7 more to go XD

If my explanation is confusing, just tell me and I'll try to reword it.

 

 

 

Variables/Link restriction script

12 years ago

I am a little confused by your explanation, but I'll throw out a reply anyway - as I never let ignorance on my part keep me from an opportunity to put my foot in my mouth ;)

Believe it or not, I actually don’t know how to Restrict a Link from showing through Scripting, but I do know how to get a Link to go where I want it to, based on Variable Restrictions.

Basically, point the Link to any Page you want (typically, I’ll point it right back to the same Page the Link is on, so I know It’s a Scripted Destination Link).

Then in the Link Script Box ( := ) Use something along the lines of the following:

IF %VARIABLE1 > (%SCORE - 15) THEN
  $DEST := @P100
IF %VARIABLE1 < (%SCORE - 16) THEN
  $DEST := @P200

Note the 15 vs. 16 in the lines (the top line looks for 16 or higher, while the bottom line looks for 15 or lower)

Hope this helps =)

 

Variables/Link restriction script

12 years ago

Hmmm that sounds like it is exactly what I was looking for(assuming I can get it to work XD).

The only issue is that I need the link that the player won't be able to click to be invisible.

What I do is make the options the same title so that when the player clicks on it they don't  know how it will play out. I like the element of surprise and if the links aren't invisible when they can't be clicked, then it will appear as a bunch of links with all the same titles.(not sure if all would be clickable) Or will that not be an issue?

Either way, I'm going to go attempt to use this fantastic script! Thank you so much!

Variables/Link restriction script

12 years ago

Yeah... I failed... epically. I have no idea what I did wrong, but it does not work. -_-

I must be scripting challenged. 

Variables/Link restriction script

12 years ago

I really don't understand the point in the (-15)  being taken from one of the variables.

Variables/Link restriction script

12 years ago

I have to account for the fact that the player has more than just 2 options and may or may not have reached the highest possible score for the variable. There are between 3 and 6 paths in my story game depending on which 'choice' the player is at. So it isn't as simple as they have X amount of points. They could have X amount, B amount,  or Y amount. The -15 accounts for that.

Variables/Link restriction script

12 years ago

Let's say the player has earned a Brave score of 80.

The highest possible Brave score to that point is 91 and the lowest possible is 68.(though usually it's not nearly as simple -_-)

91-15=76

So I need the link restriction for that single variable to be Brave > 76 --->Page A and Brave < 76 --->Page B

Since depending on their choices the player could have anywhere between 68 and 91, it would make the story much more linear if I simple used the highest possible variable since most players won't achieve that score on a first try(though depending on their goal they may not want too)

I may be doing it the hard way, most likely I am. But, I just started this site last month and after finishing over 100 pages in this story game I really don't want to go back and redo all my variables and the what scores the links give them.

If there is a better way to do it, I'd love to hear it. Because I'm starting to want to pull my hair out keeping track of all these variables and the possible scores per possible path. -_-

 

Variables/Link restriction script

12 years ago

I see. I was under the impression you were taking the 15 away from the players current score, not the max one. That makes sense then.

Variables/Link restriction script

12 years ago

Can you post or PM me the section of Script you are trying to use?

Variables/Link restriction script

12 years ago

I'll PM it

Variables/Link restriction script

12 years ago

Got it - glad to see you managed to fix it :)

Variables/Link restriction script

12 years ago

Yes, the save button is a magical thing XD 

That had to be one of my biggest facepalm moments of the year.