Jump to content

variables is massagebox


Városi

Recommended Posts

You can display a message and a variable at the same time. You have to use some special LUA characters:

 

.. is used to concatenate strings

 

[[ ]] are text delimeters

 

So if "Tequila" is the player's name and you want to write out "Hello Tequila, How are you today?." you would code the following:

 

[[Hello ]] .. Player.Name .. [[. How are you today?]]

 

Player.Name is a system variable that contains the name of the Wherigo account that downloaded the cartridge.

Link to comment

You can display a message and a variable at the same time. You have to use some special LUA characters:

 

.. is used to concatenate strings

 

[[ ]] are text delimeters

 

So if "Tequila" is the player's name and you want to write out "Hello Tequila, How are you today?." you would code the following:

 

[[Hello ]] .. Player.Name .. [[. How are you today?]]

 

Player.Name is a system variable that contains the name of the Wherigo account that downloaded the cartridge.

 

Thanks for the quick help.

Link to comment

This is a very nice feature.

 

If I wish to get the player to introduce a variable, let's say that he's with someone, and I want him to put the other person's name. How will I do to get that value into the message?

 

For example, in:

 

[[Tell ]] .. ???????????????????? .. [[to get the hell out of here.]]

 

What shall I put instead of ?????????????? so that it takes the value storage in the desired variable?

I wonder if it's something like "zvariable.varname", or so? I have no idea...

Thanks in advance.

 

Edited to add a missing "t".

Edited by Team Geo-Cricket
Link to comment
What shall I put instead of ?????????????? so that it takes the value storage in the desired variable?

I wonder if it's something like "zvariable.varname", or so? I have no idea...

Just "zvariable" without the quotes.

 

But how do I make the distinction between several variables used in the cartridge?

Link to comment

By the (case-sensitive) variable name you give it in the Builder. For ease of using variable names, use only alphanumeric characters and no spaces.

 

Therefore, I can go into the Builder and create one variable called "timesTalked" and another called "tripsAcrossBridge". If I want to display any of these in a message box, I just call them by name using the same approach cited in this article:

 

[[You have talked to me ]] .. timesTalked .. [[ times.]]
[[You have crossed this bridge ]] .. tripsAcrossBridge .. [[ times.]]

Link to comment

Hello again. I have a few questions about this theme.

To contextualize, I'm using Groundspeak's Wherigo Builder.

 

1- I tried to put several variables on the same message box and I wasn't able to.

The idea was to manage several types of coins (gold, silver and copper) and show them to the player when he performs the "money pocket count". Because I wasn't able to, I abandoned the different types of coins and sticked to one. But I got that stuck in my mind and now, by the end of the game, I'd like to show the ammount of damage the player caused during the game, but again, I'm restricted to 1 variable per message box.

Is there a way to include more than 1 variable per message box?

 

2- The only place where I can show variables is the message box? I tried in the item description and it didn't accept... Is there other "fields" where I can show the variables, and the commands are the same [[my text]] ..variableName.. [[my text]] ?

 

3- Besides

..variables..

.. Player.Name ..

.. Player.CompletionCode ..

what other "goodies" can I show to the player (and the command if there isn't a place where I can see it)?

 

Thanks in advance.

Link to comment

For Groundspeak's Builder, you should have been able to type this for a message box:

 You have completed the game with a total of ]] .. goldCoins .. [[ gold, ]] .. silverCoins .. [[ silver, and ]] .. bronzeCoins .. [[ bronze coins and have caused ]] .. damageAmount .. [[ points of damage. 

Note we're fooling the Builder into displaying the variables' values. (For the other third-party Builders, you'd have to implement this a different way.) If this doesn't work for you, I'll have to create an example cartridge to test it out.

Link to comment

HI,

 

I am building a first Wherigo, currently using Urwigo and although I have been able to manage to find a way to do everything I wanted to do up to now, well I would like to know how to implement the variable in my text using that builder... do I need to use usercode? I don't mind using just Player.Name for now if its easier, I just think it makes the game more personalized that way!

 

Thanks!

 

Andouille

Link to comment

HI,

 

I am building a first Wherigo, currently using Urwigo and although I have been able to manage to find a way to do everything I wanted to do up to now, well I would like to know how to implement the variable in my text using that builder... do I need to use usercode? I don't mind using just Player.Name for now if its easier, I just think it makes the game more personalized that way!

 

Thanks!

 

Andouille

To use a variable in a expression in Urwigo, just drag the variable from Objects and Properties panel (expand +Variables to see the variables you have defined) to the expression, just as you would drag Player.Name to get the player name. For a message box you will probably create a concatenate expression with from text values, variables, and properties. Just drag Concatenate from the list of expressions in the actions panel to replace the default null string parameter in the message box then start dragging values, properties, variables, and other expression if you need them to build the string you want displayed.

Link to comment

To use a variable in a expression in Urwigo, just drag the variable from Objects and Properties panel (expand +Variables to see the variables you have defined) to the expression, just as you would drag Player.Name to get the player name. For a message box you will probably create a concatenate expression with from text values, variables, and properties. Just drag Concatenate from the list of expressions in the actions panel to replace the default null string parameter in the message box then start dragging values, properties, variables, and other expression if you need them to build the string you want displayed.

 

I will try that tonight, I might have more question about it, but let me test it first! :D

 

Thank you for your help!

 

Andouille

Link to comment

Me again!

 

I have been able to create an input to fullfill a variable playername and then using the concatenat I have been able to usie it in a text with success!

 

What I have NOT been able to do, is to use the Player.Name Variable I can't drag it if I do not set it, but if I create it then it take whatever setting I gave it! If there is no way its fine I'll just always use the player's input, but I was curious!

 

Andouille

 

P.S: Expect more question from me, I finished a nice easy cache yesterday, but my next project is going to be much more complex!

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.

Guest
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.

Loading...
×
×
  • Create New...