Jump to content

How to use Player.Name with a Multi-choice question

Followers 2

Recommended Posts

I am trying to set up a multi-choice question, where one of the possible choices is the player's name.
Is there a way to set up Player.Name or any other variable as a possible choices? 

Link to comment
Posted (edited)

The builders might have trouble accomplishing this, but it is still possible by editing the Lua directly.


require "Wherigo"

ZonePoint = Wherigo.ZonePoint
Distance = Wherigo.Distance
Player = Wherigo.Player

cartExampleCartridge = Wherigo.ZCartridge()

cartExampleCartridge.Id = "52928615ce751b7cf4d3ebf7b7cd8090"
cartExampleCartridge.Name = "Example Cartridge"
cartExampleCartridge.Activity = "TourGuide"
cartExampleCartridge.Version = ""
cartExampleCartridge.Company = ""
cartExampleCartridge.Author = ""
cartExampleCartridge.TargetDevice = "SmartPhone"
cartExampleCartridge.TargetDeviceVersion = "0"
cartExampleCartridge.BuilderVersion = "WWB 0000.3.2019.09.16.174037"
cartExampleCartridge.StateId = "1"
cartExampleCartridge.CountryId = "2"
cartExampleCartridge.Description = [[]]
cartExampleCartridge.StartingLocationDescription = [[]]
cartExampleCartridge.Visible = true
cartExampleCartridge.Complete = false
cartExampleCartridge.UseLogging = false
cartExampleCartridge.CreateDate = "5/19/2021 04:23:23 AM"
cartExampleCartridge.PublishDate = "1/1/1970 01:00:00 AM"
cartExampleCartridge.UpdateDate = "7/8/2021 07:52:46 PM"
cartExampleCartridge.LastPlayedDate = "1/1/1970 01:00:00 AM"
cartExampleCartridge.StartingLocation = Wherigo.INVALID_ZONEPOINT

zinputexampleQuestion = Wherigo.ZInput(cartExampleCartridge)
zinputexampleQuestion.Id = "922332dde2e64a2b74deb2ba1afd1b35"
zinputexampleQuestion.Name = "exampleQuestion"
zinputexampleQuestion.InputType = "MultipleChoice"
zinputexampleQuestion.Choices = {                       -- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    "Alice",                                            -- Notice how I have just used Player.Name
    "Bob",                                              -- (with some additional text concatenated around it)
    "Charlie",                                          -- as one of the options of the multiple-choice
    ("Or, maybe " .. Player.Name) .. "?"                -- question.
}                                                       -- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
zinputexampleQuestion.Text = "What is your name?"
zinputexampleQuestion.Visible = false

function cartExampleCartridge:OnStart()

return cartExampleCartridge


This produces the desired effect (the default player name in Webwigo is "[Unknown]")




If you're using a builder, you could probably add an "Author Script" that sets up the ZInput, and later when you want to prompt for the question you could use a "raw Lua statement" to trigger the question.

Edited by Hügh
  • Helpful 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Followers 2
  • Create New...