Jump to content

Looking for a programmers guide for building a Wherigo


inkasso

Recommended Posts

I've seen the Wherigo Builder and Urwigo. As I already develop software for Windows, they both are a real pain to me.

 

Is there any guide showing me, how to build cartridges from scratch by using a simple text editor? I think this would save me a lot of time and headaches.

 

Any help would be appreciated.

Thanks a lot!

 

inkasso

Link to comment

I've seen the Wherigo Builder and Urwigo. As I already develop software for Windows, they both are a real pain to me.

 

Is there any guide showing me, how to build cartridges from scratch by using a simple text editor? I think this would save me a lot of time and headaches.

 

Any help would be appreciated.

Thanks a lot!

 

inkasso

I have made a small Wherigo course step by step with tips and trix. Send me a mail with your mailadress and I will connect you to my dropbox where I have the 7 page course. I have 25 pupils in sweden which are connected to the swedish version. I have 6 Wherigo in operation, here is one http://www.geocaching.com/seek/cache_detai...6c-6ac244cfb42d

j-annie

Link to comment

j-annie tried to help me with a guide how to use the Wherigo builder.

 

I thank you for the attempt. But this is not an option. No Wherigo builder and no Urwigo. I just need a guide to LUA in connection with the limitations and dependencies for Wherigo cartridges. Then I'll code it using some text editor. This will be much faster and easier to me than any of those "click, drag and drop"-GUIs.

 

Any suggestions in this direction?

Link to comment

Hi J-Annie

I am in the process of producing a Wherigo cache for an event on the 4/5th Dec 2010. I am having a few hiccups with tasks etc. Can you forward to me your course with tips and trix? It may be very helpful at the moment as time is running out for me.

Regards,

troo1@bigpond.com

Gil aka (troobloo)

Link to comment

j-annie tried to help me with a guide how to use the Wherigo builder.

 

I thank you for the attempt. But this is not an option. No Wherigo builder and no Urwigo. I just need a guide to LUA in connection with the limitations and dependencies for Wherigo cartridges. Then I'll code it using some text editor. This will be much faster and easier to me than any of those "click, drag and drop"-GUIs.

 

Any suggestions in this direction?

Find open source cartridges, download their code, and look at them. At the moment, there isn't a way to search for open source cartridges, so you'll just have to look at each cartridge listing until "Download source" appears at the bottom of the left column.

 

While I share your sentiment that coding can usually be faster than clicking around in the GUI, some of the more elementary things can be done faster in the GUI and with less errors, such as object creation. When I create a cartridge, I typically go back and forth between the Builder and the lua script file, depending upon what I want to do.

Link to comment

Finally some replys :rolleyes:

 

I know how to develop software. As I tried to "click" my first Wherigo, the first problems arose quite fast. Besides getting lost in dozens of screens in which there is no way in determining when the displayed part of the program will run (keyword: call stack) I learned very fast, that I would have no chance in recycling parts that would probably come in handy more often (keyword: functions, methods).

 

Another problem I already learned of is a bug in the Oregon Wherigo player which doesn't work with onClick-Events. Why is there no Text-based approach to Wherigo? I would expect this to be the first step - before any GUI-based approach would be provided.

Link to comment
Besides getting lost in dozens of screens in which there is no way in determining when the displayed part of the program will run (keyword: call stack)

There is no call stack, or at least, nothing that need to worry about or can do anything about. Everything is an event handler. The player does something, and an event handler runs. When I was studying computer science (1979-1981), a language called Simula came up quite a lot - it was all about cooperative multitasking/multithreading. It was hard for someone who had been brought up (since... 1975) on Fortran and Algol to understand, but it prepared me nicely for the first time I had to program a Macintosh. Lua is from the same family, and Wherigo builds on Lua's cooperative multitasking/multithreading capabilities, albeit without actually calling the yield routines from the cartridge code directly.

 

I learned very fast, that I would have no chance in recycling parts that would probably come in handy more often (keyword: functions, methods).

Yes, the Builder's "exact opposite of object-oriented" approach can result in doing a lot of things 10 times, with the obvious resultant problems of updating all 10 when something changes. My builder (Earwigo) doesn't have methods as such, although you can make Lua equivalents in the (syntax-checked!) Author Script window, but it does have recyclable (write once, use many times) functions and conditional expressions.

 

Why is there no Text-based approach to Wherigo? I would expect this to be the first step - before any GUI-based approach would be provided.

Only Groundspeak could answer that, and I'm not going to bet next month's paycheck on them doing so. I'm guessing that it's because, while you can program, and you know that whatever you're doing with all the clicking you're really writing code, and so do I, and so does Ranger Fox, and so do a couple of hundred other people, still, 99.9% of the people whom Groundspeak hopes will write a Wherigo cartridge, will never learn (or have any interest in learning) the syntax of Lua - indeed, if they thought that they had to, they would spend the hours required placing lame microcaches instead. That's why the GUI approach was provided. Indeed, one of the main things that people complain about here is that the GUI in the Builder is to hard to understand, for non-programmers.

Link to comment

There is no call stack, or at least, nothing that need to worry about or can do anything about. Everything is an event handler. The player does something, and an event handler runs. When I was studying computer science (1979-1981), a language called Simula came up quite a lot - it was all about cooperative multitasking/multithreading. It was hard for someone who had been brought up (since... 1975) on Fortran and Algol to understand, but it prepared me nicely for the first time I had to program a Macintosh. Lua is from the same family, and Wherigo builds on Lua's cooperative multitasking/multithreading capabilities, albeit without actually calling the yield routines from the cartridge code directly.

 

I just want an easy way of seeing, which part of the "code" will run in what order. This is why I mentioned the keyword "call stack". I am capable of multithreaded programming. Events don't scare me off :laughing:

 

Yes, the Builder's "exact opposite of object-oriented" approach can result in doing a lot of things 10 times, with the obvious resultant problems of updating all 10 when something changes. My builder (Earwigo) doesn't have methods as such, although you can make Lua equivalents in the (syntax-checked!) Author Script window, but it does have recyclable (write once, use many times) functions and conditional expressions.

Well that would be nice if there is at least somewhere a reference for the programming language (which should respect the limitation of all official Wherigo players).

 

Only Groundspeak could answer that, and I'm not going to bet next month's paycheck on them doing so. I'm guessing that it's because, while you can program, and you know that whatever you're doing with all the clicking you're really writing code, and so do I, and so does Ranger Fox, and so do a couple of hundred other people, still, 99.9% of the people whom Groundspeak hopes will write a Wherigo cartridge, will never learn (or have any interest in learning) the syntax of Lua - indeed, if they thought that they had to, they would spend the hours required placing lame microcaches instead. That's why the GUI approach was provided. Indeed, one of the main things that people complain about here is that the GUI in the Builder is to hard to understand, for non-programmers.

 

That was not what I wanted to propose. Every programming starts with code which is compiled oder interpreted. After this level is developed, a GUI is usually set on top for those who cannot write code by themselves. So there should be possible to write code instead of clicking GUI.

Link to comment
Well that would be nice if there is at least somewhere a reference for the programming language (which should respect the limitation of all official Wherigo players).

As far as I know there's no API guide to the Wherigo.xxx() functions and the data structures.

 

That was not what I wanted to propose. Every programming starts with code which is compiled oder interpreted. After this level is developed, a GUI is usually set on top for those who cannot write code by themselves. So there should be possible to write code instead of clicking GUI.

I understood what you wanted; I was just telling you that Groundspeak chose not to do it. :laughing: You'd have to ask them why not, but I'm guessing it's because they took one look at how hard it is for non-programmers to write Lua code and said "we need a GUI-based builder".

 

If Wherigo had really taken off, it would have been documented by now. It needs a little injection of energy to counteract all the entropy which has accumulated.

Edited by sTeamTraen
Link to comment

At the moment, there isn't a way to search for open source cartridges, so you'll just have to look at each cartridge listing until "Download source" appears at the bottom of the left column.

 

Advanced Search, set Search Type to 'Keyword Search', enter keyword 'source'.

Or go to http://www.Wherigo.com/search/results.aspx?&sname=source&stype=7

Unfortunately, this does not display all open source cartridges. At the very least, mine are missing.

 

Even if I kept a bookmark list on geocaching.com or off site, the list would not be comprehensive because cartridge authors can change their cartridges' source control settings at any time.

 

As I've said before, chalk up another thing I'd like to do if I had to keys to the kingdom.

Link to comment

It actually isn't to hard to figure out. The lack of a formal API means you have to do some reverse engineering as Ranger Fox suggests. You will soon discover that the Lua code consists of a chunk that defines the objects in your cartridge (including the cartridge object) and the event handlers that will be invoked when certain events occur. The Lua chunk is invoked when the cartridge is loaded. The code in the handlers is invoked when the event takes place.

 

The Lua Wherigo class defines the methods that are called to construct the objects in your cartridge: cartridge, zones, zone points, characters, items, commands, inputs, timers, etc.; and provides some methods to invoke the capabilities or the Player from your event handlers: display message box, display dialog, display user input dialog, play sounds, save cartridges, compute distances, etc.

 

The Wherigo builder wiki has most of the information. I don't know why this isn't more active. Surely the people who have built Builders or Players have discovered more about these items and could be adding to the wiki.

Link to comment

Well, there's the Wherigo wiki you can update and there's this programming reference guide I found by searching on Google for thirty seconds.  (I'd sure like to import the reference guide to the wiki...)

I can't speak for everyone, but I suspect it's the same.  We didn't create a programming reference for the community because what references we created were just scribbled notes as we were creating our own projects, and we were focused upon that as a goal.  When I created Kit's linear Q&A kit, I started by creating a cartridge using Groundspeak's builder, then made sure Kit output the same thing.  In creating my arcade cartridges like Whack-A-Lackey, Battleship, Cacher Pursuit, and Tetris, I used Groundspeak's builder to output what objects I needed, then used my programming experience to poke around and try things out.  When I needed to reference lua syntax, I consulted the lua 5.1 reference manual.  All cartridges save Tetris are open source.  I will not open source Tetris because the player apps need to be improved, and I don't want people creating Tetris derivatives, expecting everything to work well in the player apps.  I've seen some documentation others created over the years, but it always seemed in pursuit of other projects.

In short, I don't have any notes on the Wherigo API, private or public.  Had I been able to work with Groundspeak to continue Wherigo's development, the Wherigo Foundation would have had to produce API documentation as a side effect of communicating with each other concerning the changes we were proposing and making to the API.  And I did request from Groundspeak the API documentation they provided to Garmin during that collaboration, but I was told it was confidential (and they'd have to look for it).  Even if I had a partnership with Groundspeak, I and the group I'd create (the Wherigo Foundation) could not expect support.

I believe whatever obstructionist policy you are observing is more of a symptom than an intentional cause.  I believe it's due to everyone working on their own projects: they find things out for themselves, learn, and then create what they set out to create.  If you don't find convenient documentation, it's just because no one decided to make that their project.  Then again, I might not know of documentation beyond a web search.  I can't keep up with everything.

 

Anyway, this isn't supposed to be in defense of anything.  I'm sharing my thoughts and point of view.  Do you feel it worthwhile for someone to spend time absorbing that reference guide link into the Wherigo wiki?  Would it be sufficient just to link to that page from my signature line?  What additional presentation would help for the documentation?  Who would take the responsibility of maintaining it?  Would you like to volunteer to help with something?

  • Upvote 1
Link to comment

Came accross this post, just poking around the forums... And to be honest, it sounds like 'my' story too... It's a steep learning curve.

What I miss most (as far as documentation for Wherigo goes) are two things:

1. A decent introduction to the event based style in which Wherigo's work. Without that, it's very hard to get started.

2. An overview of the dos & don'ts from a Wherigo-player/platform point of view.

<edit>

3. A "debugger" that gives some control when testing cartridges. (Using Webwigo now...)

</edit>

Point 1. for me was solved because I had the chance of having a couple of sessions of an experienced Wherigo builder in Belgium to explain us a bit on the inner workings of Wherigo (and specifically Earwigo).

Point 2. was noticed mostly when I have had a lot of trouble with my last cartridge to get it to work both in the emulator and on my smartphone (Android-Wheryougo). iPhone was tested by friends and introduced new issues... Still haven't gotten around to test it on a Garmin. And that's just speaking about the bugs/errors/exceptions being thrown (and not the differences of look&feel between players).

And so I'm wondering... Is there any place where we can share our experiences / solutions in a more or less structured way? Is the WF Wiki a solution for this?

Edited by SWIPEE
Added 3. the debugger...
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...