Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Link Variables in 1.4

For some reason, I cannot for the life of me get link variables to set consistently. I'm sure it's just some little thing I'm doing wrong.

I can get it to work on a blank project, but even when I copy and paste, I cannot get the exact same code to work in my real game.

Here's the code. I copy and pasted it into my game and changed value to 10.
[[link text|passage name][$var = 10]]
In Testing.tws works. The macro <<print $var>> prints 10. I copy and pasted the code into my Abaddon game without making any changes and it prints 0.

Attached are the two files.

It's frustrating, but I know it's just some little glitch in what I'm doing.

Thanks for helping me out!

Comments

  • I also tried re-tying it from scratch and changing the variable name and link passage to no avail.
    [[Test][$foo = 10]]
    It will print 0 no matter what I change the variable name or value, even if it's a string. Even if I declare it first, the link won't change it.

    EDIT: I also tried starting a new story in 1.4 and copying all the passages over to it to no avail.

    EDIT x2: So, as further testing, I tried my Testing.tws and everything worked with the link variables as expected. Then, I copy and pasted all my passages from Abaddon, rebuilt, played and it no longer worked . . . What the heck?! XD Same passage (Start) with no changes, none of the Abaddon passages were even accessible. They were just tacked in there.
  • I have a follow-up question if I can get them to work at all. How does one set multiple variable in a link?

    I tried [[Test][$foo = 10 $goo = 20]] and [[Test][$foo = 10][$goo = 20]] and [[Test][$foo = 10 and $goo = 20]], but none of those worked.
  • The problem is the StoryRegions Module. You have to change these two lines in it:
    History.prototype.display=function(D,B,A){
    state.realdisplay(D,B,A);
    Change both of these to:
    History.prototype.display=function(D,B,A,C){
    state.realdisplay(D,B,A,C);
    By the way, where did you get that module? I don't think I've seen it before.


  • That worked! :D

    L! I love you man! Thanks so very much!

    I wrote the module from scratch since I'm such a cool expert coder. Well, HarmlessTrouble helped a wee little amount on the Google Group. ;)
  • Oh, as a follow-up, is there a way to set multiple variables in links?

    Thanks again! :)
  • The way to do that is separate them with either commas or semicolons. [[passage][$var = 4, $var2 = 8]]
  • You're the greatest, L!

    *Big hairy bearded man smooches*
Sign In or Register to comment.