Jump to content

Variables in "Descriptions"


Treasure Hunter G

Recommended Posts

Is it possible to make a points system tied to individual characters? For example,

I can make a character named "Todd". Without programming any commands, I can make it so that when you click on him in your inventory, a status screen appears that says "Todd has 0 apples". Every time I click on "Todd", it'll say he has 0 apples...Even after I trigger events in other zones that should give him more apples. I even checked the true value based on if/else triggers; basically I can't get the stated count listed under Todd.Description (in terms of lua function coding) to match the actual count.

Any ideas on how to solve this problem? I'm thinking it might have something to do with metatables or OOP, (but any easier solutions, or at least simplified solution would be GREATLY APPRECIATED!!)

Link to comment

If you are using Urwigo to build your cartridges I have a solution for you.

 

You create a variable called, say, "Todd's Apples". Every time Todd finds an apple you:

 

1. [increment] [Todd's Apples] +1; and

2. [set] Todd.Description = [concantenate] "Todd has " [Todd's Apples] " apples."

 

Cheers,

 

Geoff aka Tyreless

Link to comment

... I can make a character named "Todd". Without programming any commands,...

 

Here is the Earwigo solution. No "real" programming required. Similar to the Urwigo example you need a variable that holds the current number of apples. I have named the variable Numeric. The Earwigo "secret" secret is that you can present the variable value (the current number of apples) if you enclose them name of the variable in ~~ characters.

 

ae556eef-0838-4ce9-8fa3-4d22b3676c71.jpg?rnd=0.5340647

 

...when you click on him in your inventory,...
I suggest you use commands instead of the OnClick event (see example above). OnClick will crash Garmin devices. Earwigo will warn you if you attempt to use "critical" Wherigo functionality.

 

If you want to have an additional screen that pops up after the increment, add a "Display Message" statement to the above example.

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