If Player sees pages... (Gamebook)

Hey everyone. I need to make an IF game for a university assignment, so I've never done this before and need some help.

Basically, what I'm trying to do, is that if a player sees 4 specific pages, an option will "unlock" on an already established page. One of my pages is an office with a locked door, and right now I have it set that if the player goes up there they can just go back to the foyer where they came from. But I want an option to appear for them to proceed if they saw all 4 specific pages in any order, which would give them the clue to unlock the door.

I've been trying to do this through "functions", Script, clicking "if" and then clicking "player has seen page", but for some reason something I'm doing isn't working.

While I'm here, I'm also trying to have this game have multiple ending. I basically want say, if you see pages 3, 5 & 7, but not 2, 4 and 6, you get ending 1. If you see pages 2, 4 and 6, but you don't see 3, 5 and 7 you get ending 2. If you see pages 2-7 you get ending 3. If you DON'T see pages 2-7, but you see pages 8, 9, 10 (the pages I want the player to need to see to just unlock the door as I mentioned already) you'll get ending 4.

I hope this makes sense. This project is for an English class and so I don't know how to code. I thought Gamebook would be easier, and I've made all the pages I want the player to be able to access already and have been able to "link" them properly. But when it comes to how to do the actual endings for the game and getting the player to be able to unlock the door I'm completely lost.

Thanks!


I'm going to use code view for suggesting scripts. You might find it easier to work by clicking things in the script editor GUI, but code view is a lot more efficient when asking for help because it lets you copy and paste code to and from the forums. If you want to see what the code I'm suggesting looks like in the GUI, you can just paste it into code view and then switch back.


I've been trying to do this through "functions", Script, clicking "if" and then clicking "player has seen page", but for some reason something I'm doing isn't working.

You haven't told us what you're trying, so it's hard to say why it isn't working. Are you creating a function? If so, when are you calling it?

For this problem, I would suggest making the room that contains the door a "Script & text" type.

If the door leads to page8, and you have to have seen pages 4, 5, and 7 to unlock the door, the script would look something like:

if (HasSeenPage (page4) and HasSeenPage (page5) and HasSeenPage (page7)) {
  AddPageLink (this, page8, "Unlock the door")
}

I'm also trying to have this game have multiple ending.

I assume there's a page that all paths lead to which should then send you to the appropriate ending?

I'd suggest creating a "Script" type page for the exit. This page never actually displays, but sends the player to a different page depending which ending they should see.

In code view, the script would look something like:

if (HasSeenPage (page3) and HasSeenPage (page5) and HasSeenPage (page7) and not HasSeenPage (page2) and not HasSeenPage (page4) and not HasSeenPage (page6)) {
  MovePlayer (ending1)
}
else if (HasSeenPage (page2) and HasSeenPage (page4) and HasSeenPage (page6) and not HasSeenPage (page3) and not HasSeenPage (page5) and not HasSeenPage (page7)) {
  MovePlayer (ending2)
}
else if (HasSeenPage (page2) and HasSeenPage (page3) and HasSeenPage (page4) and HasSeenPage (page5) and HasSeenPage (page6) and HasSeenPage (page7)) {
  MovePlayer (ending3)
}
else if (HasSeenPage (page8) and HasSeenPage (page9) and HasSeenPage (page10)) {
  MovePlayer (ending4)
}

I'm assuming your pages are named page1, page2, and so on, and that your endings are in pages named ending1, ending2, ending3, and ending4. You can change the page names easily enough to match how you named them in your game.


mrangel's way works.

This can work too.

Page11.seen = false
Page7.seen = false
Page4.seen = false
Page2.seen = false

Then when a page is turned to, you can set the seen to true.

firsttime {
  Page11.seen = true
}

And then you can do this.

if (Page11.seen = true and Page7.seen = true and Page4.seen = true and Page2.seen = true) {
  msg ("You have seen all the pages. ")
}

Not sure how to do a reply, but I did it mrangel's way and everything is working now. Thank you so much guys!


hey cal, u same person on utube? (loved your spice and wolf reactions!) (I'm redmoon bloodmoon on utube, commented on your spice and wolf reactions)

glad to have you here on quest (how did you find us? lol), we got a small community but a very helpful and friendly community here with quest

(ah, college assignment, hehe)

(well, if you interested in making games and/or learning to code, quest and its users, can help you with it, I found quest ~7 years ago, knowing ZERO about coding and game-making, and now I'm taking programming classes in college myself, I learned to code/program through quest and its moderators and users, helping me with learning to code)


This new need to learn about this coding for easy accessing happy wheels unblocked online


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums