If Result = A Then AddPageLink

brenden.winger
10 Jun 2017, 16:26

It displays the text "correct" but not the link...
(You're on page 4, and page 5 is a proper link)

if (result = "password")
{
msg ("that is correct")
AddPageLink (page 4, page 5, "correct")
}


DarkLizerd
10 Jun 2017, 19:48

Is your pages...
page 4 or page4
???
or could it be Page4 or Page 4
???
Your code looks good, BUT, it looks like there needs to be refresh command to show the exit...


brenden.winger
17 Jun 2017, 15:16

It isn't a page name issue because it won't take me to any page...


major powers
17 Jun 2017, 23:46

Does the page exist that you're trying to get it to go to?


major powers
18 Jun 2017, 00:14

Oh hey, just as a tip if you didn't know this, put LCase in so the player can enter the password in any case (i.e. PASSWORD, Password, password, paSSWord, etc.)

GetInput() {
  if (LCase (result) = "hello") {
    msg ("Why, hello.")
    AddPageLink (Page1, Page2, "WINNER!")
  }
  else {
    msg ("Nope.")
    AddPageLink (Page1, Page3, "LOSER!")
  }
}

major powers
18 Jun 2017, 00:24

Oh hey @brenden.winger you're right, your original question doesn't work. I'm a noob but have been off and on writing a Gamebook for a couple years and asking questions here. Most of the folks here aren't Gamebook mavens, most of them like the text adventure style of game. But they always try to help. Anyway:

I just tried this and it worked! You have to "MovePlayer" and not try to "Add" a link!

GetInput() {
  if (LCase (result) = "hello") {
    msg ("Why, hello.")
    MovePlayer (Page1)
  }
  else {
    msg ("Nope")
    MovePlayer (Page2)
  }
}

In other words, I suppose as a workaround, I think you have to "Move" them to a page, and then add the links on that page.


brenden.winger
18 Jun 2017, 00:30

oh! Thank you! I'll try that.
I'm so poor with coding that I felt it would be best to stick with gamebook and learn the basic coding when necessary.


major powers
18 Jun 2017, 00:39

I'm in the same boat, friend.