Move Player to Page + Message

Is there a way to have a message seen before being taken immediately to a page?
I've tried to just create a new page link, but it never wants to work


The workaround way would be to simply put that message on the page they are being automatically moved to, then put a link (or links) on that one. But what I think you're wanting is that a message is displayed before you're automatically moved. Can you give an example of what the game's doing there, some context?


well, the optimum would be to have them move forward at their own pace , or have an option to go somewhere else----not only this new page...

But I guess I can give them the same options plus the new one on another page.
Just requires me to think differently


I figured out one reason I would want this.
Since I haven't figured out a way to refresh the page,
I want an input to print a message before restarting the code.
I want the player to be able to continually interact with an object until they want to stop,
without having to leave the page and come back.


How do you want them to interact with the object? Are they like, petting it? Punching it? Talking to it? Just curious, cause it helps with a contextual solution.

In the interim, alternating pages is a workaround. Have two pages with a bunch of conditions that just point to one another, with links on both that gets them out of the loop to progress.

Page 1: pet the object!
(goes to page 2)
Page 2: you pet the object! Now what?
Pet it again! (sets counter/flag/whatever that the object has now been pet twice)
Back to Page 1 (the counter/flag/whatever knows there's been 2 pets).
Do you want to pet the object again? Yes! (boosts the Counter/Flag/whatever to three pets)
Goes to Page 2 (etc.)

There's an easier way but that's the simplest one I've found that works as a novice in Gamebook mode.


unfortunately, the built-in page movement/links already exist, which means you got to go into them (copy button on the right side and then edit the scripting, or on the left side at the bottom: filter -> show library elements: toggle/check it on/in, then find the movement scripting in the now revealed built-in stuff as the light grey text on the left side's 'tree of stuff'), and find the movement scripting and add in your 'msg' Script before the movement script line(s). But, this is going to be universal (for all movement between pages), and not just for going (from any page) to a specific page (or even more specified: from a specific page to a specific page). You can add in an 'if' Script for having the 'msg' Script only be for going (from any page) to a specific page (or: from a specific page to a specific page). I'm not sure if there's already a built-in movement control for local/non-universal/non-global (aka: specific) page movement, but maybe there is, and so you wouldn't have to mess with the universal/global page movement stuff.

I am pretty sure that the 'game' Game Settings Object has a built-in 'on entering a page' Script, but this will apply to/for all pages (universal/global). I'm not sure if there's a 'on entering a page' Script for/on (each) individual/specific page.


otherwise...

you can always manually create/scripting/code-in your own page movement instead of using the built-in one, which would let you fully control/determine how it works, putting in whatever you want for only specific page to page and etc like stuff you might want.


MP, I'm looking to create a type of puzzle/exploration game.
I wanted the player to be able to interact with the same object repeatedly in many different ways.
In some cases I'd even like the player to try as many options as they can imagine
(push, punch, examine, lick, use cheese grater, whatever)
I would want each to yield a different response

[while being mindful of the dreaded TRIAL AND ERROR puzzle solving ]

I don't know that I would care to focus too much on the flag system for repetition,
though I may need to look into flags if I want to deactivate/nullify something that you have "seen"

[I'm not sure what to do when I come to time where I want the player to have an optional, temporary item that they may or may not be holding later in a room. I don't want to resort to forcing them to put things down all the time...]

I was trying to avoid making a page for every little interaction,
but maybe that's what I'll need to do.
If I incorporate the HasSeenPage stuff,
and think less in the " if, then, print message/ create new page link"
then I should be able to do many of the things that I want so far..


The hardest way to do it is to write them all out, and what happens after each:

GetInput() {
  if (LCase (result) = "kick") {
    msg ("you kicked it")
    MovePlayer (PageWithKickOptions)
  }
  else if (LCase (result) = "lick") {
    msg ("you licked it")
    MovePlayer (PageWithLickOptions)
  }
  else (LCase (result) = "punch") {
    msg ("you punched it")
    MovePlayer (PageWithPunchOptions)
  }
}

And you can put as many "else if"s in there as you want.

Unless someone else chimes in with answers, as far as I know, the far more robust way to use the input is the text adventure, it's just a steeper learning curve! Otherwise you gotta do it all clunky and by hand like this in gamebook mode. :)


If you want to finesse it so that only certain things are available to type in depending on where you are in the story, first (and always) think logically about where the player can possibly go and where they could have possibly been to reduce your workload.

In other words, put in forced bottleneck areas so the players can't have seen too much too fast to give them too many options at whatever given point.


And if you want repeatable stuff that's being counted. Make a counter that then triggers some event/script when it hits a certain amount.

  if (LCase (result) = "poop") {
    msg ("you pooped on it")
    MovePlayer (PageWithPoopOptions)
  }

Now on the Poop page, add the counter:

SetCounter ("PoopedOn", 1)

On subsequent pages, increase or change that counter. (This is actually a pain in the ass, no pun intended). And then have a line of code telling what to do once they hit 3 or whatever.

  if (GetInt(game, "PoopedOn") = 3) {
    msg ("You pooped on it three times!")
    AddPageLink (FromThisPage, ToThisPage, "Claim your prize!")
    RemovePageLink (FromThisPage, ToOptionsThatWereThereBefore)
  }
 else {...
}

The problem here is that you have to put the "if pooped on three times" thing first on all the pages with the input box, so the page will check for that condition first. And then the input box would go in the "Else" or "Else If" on the all the pages. So all the pages check first to see if that PoopedOn counter has hit 3. Sort of a pain in the butt and may be worth investigating the text adventure mode for what it sounds like you want to do...

Depending on how many things you want to let the player do and how many things you're tracking, this could turn into a lot of pages doing a lot of things really fast. So you either gotta hunker down and accept your fate in gamebook mode, or see if TA is simpler (I think it it is, but it still takes a fair amount of work).


If the Game Book can do the 'Command' Element, that's a method, as you can have it handle many different inputs (punch, kick, etc), an example:

// during game play, you'd type into the command/input bar at the bottom, for this example:
// example punch
// example kick
// example (etc etc etc)

<command name="example_command">
  <pattern>example #text_parameter#</pattern>
  <script>
    switch (text_parameter) { // you can use an 'if' block too, but I'm using the 'switch' block for this example
      case ("punch") {
        // blah scripting
      }
      case ("kick") {
        // blah scripting
      }
      // etc more or less cases
      default {
        // blah scripting
      }
    }
  </script>
</command>

if the Game Book has the built-in special 'changedNAME_OF_ATTRIBUTE' Script Attribute, that can be helpful, as it imemdiately runs/activates/executes it's script(s) upon that Attribute's Value changing/being-changed:

<game name="example_game">
  <attr name="state" type="int">0</attr>
  <attr name="changedstate" type="script">
    if (game.state = 1) {
      // goto page 10
    } else if (game.state = 10) {
      // goto page 100
    }
  </attr>
</game>

<object name="player">
  <attr name="weapon" type="string">unarmed</attr>
  <attr name="gems" type="int">0</attr>
  <attr name="changedgems" type="script">
    if (player.gems = 10) {
      player.weapon = "club"
    } else if (player.gems = 20) {
      player.weapon = "dagger"
    }
  </attr>
</object>

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

Support

Forums