Jump to content

Sample source code


marekl

Recommended Posts

Hi Jeremy,

 

I've installed Wherigo Builder and found out that it is quite tricky development environment. Nothing for common geocachers. I think it would be helpful if you publish a sample code of any cartridge, for example the Player Tutorial. First time builders could analyze it and make own cartridges then more easily.

 

What do you think about it?

Link to comment

marekl,

 

I have already developed my first cartridge, using the Tools > Wizards > Create a Simple Cartridge option. While it is by no means great, it did show me that I can do it.

I can definitely see where some source code would be helpful, though.

 

Jeremy (or any of Wherigo team),

it might be helpful to point to the Wizard option somewhere on the builder webpage. I knew about it because I read through the forums. If an introduction to it were included as a sticky (more important as the forums grow) or it were pointed to on the webpage, the same questions might be curbed.

Link to comment

Is there any way I can just learn and script something in lua and compile it as a Wherigo cartridge without having to use the world builder? I'd rather just keep everything .Net and have it compile either into lua or whatever format is needed to then compile the cartridge.

 

But, yes, the best way to learn is by example. The more examples of all the features and capabilities of the builder, the better. Whether that's by examples using the builder or straight script, it would be much appreciated.

Edited by Ranger Fox
Link to comment

Our plan is to make all the cartridges open source so you can read through our code. But I must admit there are three issues as to why we haven't made our two listed cartridges open source (yet):

 

1. The lua doesn't open in the builder because we use special parsing to get the builder to load cartridges.

2. The code isn't exactly what we'd call "best practices" so we'd rather work through and present a good quality source for you.

3. The Play Anywhere cartridge is pretty unconventional since it builds zones on the fly - which is a cool thing but could use some better explanations.

 

We're going to work hard to have some open source cartridges available in the coming weeks that you can run in the builder. It's definitely in the plan. We even added Creative Commons options for cartridges so you will be able to download any open source cartridge directly from the site.

Link to comment

If all cartridges will be open source in the future, won't that open the way for people to unlock the more difficult challenges by editing the cartridge code and playing their hacked version?

 

And what of your pay-to-play plan? Why will those cartridges be open source? And what prevents one cacher from paying for a cartridge and giving it to all his/her friends, including the source?

 

If I spend my time building a cartridge, I would like to decide if I wish others to see its source. I would also like to make sure players visit the area itself instead of playing the cartridge through the emulator (though I plan to use a combination of timers, invisible zones, and difficult to answer questions unless you're there as a primitive way of checking the person's presence in the field).

Link to comment

If all cartridges will be open source in the future, won't that open the way for people to unlock the more difficult challenges by editing the cartridge code and playing their hacked version?

 

All cartridges will not be open source. You make a decision about your cartridge and whether you want to make it open source. We will most likely make ours open source but you don't have to :huh:

 

We implemented Creative Commons so you can decide whether to keep it at All Rights Reserved or open source with some restrictions. You can even make it open source but have the user request the source before you give it out. That way you can keep your experience secret until someone plays it.

 

And what of your pay-to-play plan? Why will those cartridges be open source? And what prevents one cacher from paying for a cartridge and giving it to all his/her friends, including the source?

 

This is probably based on the presumption that all cartridges are open source which is not the case. So these questions are probably moot. If they aren't just let me know and I'll clarify.

 

Obviously if you do choose to make your cartridge open source someone could read the code and figure out all your secrets. However, you make that choice as the author and owner of the experience.

 

If I was charging for a cartridge I probably wouldn't make it open source too.

 

I would also like to make sure players visit the area itself instead of playing the cartridge through the emulator (though I plan to use a combination of timers, invisible zones, and difficult to answer questions unless you're there as a primitive way of checking the person's presence in the field).

 

You can use hidden zones, timers, or even request that the user upload a log file containing their actions in the field if you really want to get specific about whether the user really played it instead of on the desktop. There are ways to determine whether the user actually played the experience. We've explored some ways and don't want to give them away quite yet.

 

Of course for now we're content allowing people to play them online to get the gist of the experience since they can't play a Seattle cartridge in Denver, but you can be as strict as you want with your own cartridge. You're the author after all!

Link to comment

You can use hidden zones, timers, or even request that the user upload a log file containing their actions in the field if you really want to get specific about whether the user really played it instead of on the desktop. There are ways to determine whether the user actually played the experience. We've explored some ways and don't want to give them away quite yet.

 

Of course for now we're content allowing people to play them online to get the gist of the experience since they can't play a Seattle cartridge in Denver, but you can be as strict as you want with your own cartridge. You're the author after all!

 

I appreciate it, Jeremy.

 

I, too, have been experimenting with various ways to "secure" a cartridge to make sure someone is playing in the field. The use of timers is one thing, as are hidden zones a player must pass through on the way to a certain destination. As is one more thing--and I'll cover that for you.

 

The first real cartridge I submit will be a mash-up of geocaching and Wherigo. Part of the experience will be the Wherigo virtual game, played in a specific location. Every so often, the user will encounter a small cache. For instance, if the user needs a screwdriver for something else in the game, the user will have to look around for a geocache in the area (and, therefore, the zone will be a small thousandth of a minute square instead of a larger box). Inside will be a screwdriver with a password (for instance, "Dz2*7"). To pick up the screwdriver in the virtual environment, the player must first enter the password. This further solidifies the experience between virtual and real. You get to hold the screwdriver as well as see the picture in your player.

 

Another cacher and I have been creating a story that will unfold while caching. For instance, a "cache stage" would involve searching through a briefcase you found or orienting an object in an abandoned shed in the woods. It's difficult to think of that many things outside the box, so progress has been slow. Incorporating Wherigo might make things easier to take the player on a story.

 

As is par for me and placing geocaches, it will always take a while before I put something out.

Link to comment

I posted the code of one of my test cartridges in this thread. You could play around with that to see if there's anything that interests you.

 

Basically, you go to the parking area, then go to the section on the peninsula on the lake, then the zone a little east of that, and have to get to the zone near the parking area in under ten minutes. There are a few other things I was playing around with inside that. Ignore them or mess with them later. Every little bit helps when learning something new.

Link to comment

Thanks Ranger Fox. Some things are getting clear now. Trial and error it is. I will work on a simple program first that works and from there struggle on to my first published cartridge

 

Yes, when learning something new, you do have to learn the building blocks. You can actually do some fairly seemingly complicated things just by using basic things.

 

If you need help, the Groundspeak crew is here. I'll also be hanging out for a while. I don't claim to know the answers, but I can catch on to things very quickly to find what we need to know.

 

Good luck and have fun!

Link to comment

I need some help with putting in the waypoint coordinates

what ever i try they seem to lay in the indian ocean instead of holland :( .

 

I enter them by pasting them from mapsource in ddd.ddddd

when i enter it with a dot i get a error saying value invalid ranges 0-90 or something

if i enter with a , it will accept but my waypoints are everywhere but on the right place

 

What is the proven method to enter coordinates?

Link to comment

I'm not quite certain when it comes to coordinates east of the prime meridian.

 

Check out File::Preferences and click on "Units of Measure". You do have "Decimal Degrees" selected, right? Asking just to be sure.

 

Would you mind including the coordinates in your next post so someone else can check?

Link to comment

Yes decimal degrees is selected. This is a piece of the code with the wp's

 

-- Zones --

zoneParkeerplaats = Wherigo.Zone(cartKetelbinkie)

zoneParkeerplaats.Id="b620ec2a-5596-4c25-b58c-12a7a9dcbb8b"

zoneParkeerplaats.Name="Parkeerplaats"

zoneParkeerplaats.Description=[[Parkeer hier je auto]]

zoneParkeerplaats.Visible=true

zoneParkeerplaats.DistanceRange = Distance(1500, "feet")

zoneParkeerplaats.ShowObjects="OnEnter"

zoneParkeerplaats.ProximityRange = Distance(200, "feet")

zoneParkeerplaats.AllowSetPositionTo=false

zoneParkeerplaats.Active=true

zoneParkeerplaats.Points = {

ZonePoint(51899890,20144,4478828,79856,0),

ZonePoint(51899890,20144,4478759,20144,0),

ZonePoint(51899959,79856,4478759,20144,0),

ZonePoint(51899959,79856,4478828,79856,0)

}

zoneParkeerplaats.OriginalPoint = ZonePoint(51899925,4478794,0)

zoneParkeerplaats.DistanceRangeUOM = "Meters"

zoneParkeerplaats.ProximityRangeUOM = "Meters"

zoneParkeerplaats.OutOfRangeName = ""

zoneParkeerplaats.InRangeName =

 

I know there is something wrong i am doing but cant figure out what

Link to comment

Yes decimal degrees is selected. This is a piece of the code with the wp's

-- Zones --

zoneParkeerplaats = Wherigo.Zone(cartKetelbinkie)

zoneParkeerplaats.Id="b620ec2a-5596-4c25-b58c-12a7a9dcbb8b"

zoneParkeerplaats.Name="Parkeerplaats"

zoneParkeerplaats.Description=[[Parkeer hier je auto]]

zoneParkeerplaats.Visible=true

zoneParkeerplaats.DistanceRange = Distance(1500, "feet")

zoneParkeerplaats.ShowObjects="OnEnter"

zoneParkeerplaats.ProximityRange = Distance(200, "feet")

zoneParkeerplaats.AllowSetPositionTo=false

zoneParkeerplaats.Active=true

zoneParkeerplaats.Points = {

ZonePoint(51899890,20144,4478828,79856,0),

ZonePoint(51899890,20144,4478759,20144,0),

ZonePoint(51899959,79856,4478759,20144,0),

ZonePoint(51899959,79856,4478828,79856,0)

}

zoneParkeerplaats.OriginalPoint = ZonePoint(51899925,4478794,0)

zoneParkeerplaats.DistanceRangeUOM = "Meters"

zoneParkeerplaats.ProximityRangeUOM = "Meters"

zoneParkeerplaats.OutOfRangeName = ""

zoneParkeerplaats.InRangeName =

 

I know there is something wrong i am doing but cant figure out what

This is also a internationalisation problem, here too you cannot work if you have your decimal-separator set to the comma instead of the point.

 

Go to Settings (configuratiescherm), countrysetting (landinstellingen), choose 'change' (aanpassen) after your country, and set de decimalseparator to '.' (point) and the digitgrouping to ',' comma

 

The problem is that during writing the lua-script is messed up because is writes , as digitseperator instead of .

it should be written like:

zonepplaats.Points = {

ZonePoint(52.75,4.75,0),

ZonePoint(52.76,4.75,0),

ZonePoint(52.76,4.76,0)

}

however, it gets written as:

zonepplaats.Points = {

ZonePoint(52,75,4,75,0),

ZonePoint(52,76,4,75,0),

ZonePoint(52,76,4,76,0)

}

Link to comment

This made all the difference for me. Suddenly i end up where i am supposed to be!

 

Thanks kalkendotters ( i could have just shouted from here!) :D

 

Yes decimal degrees is selected. This is a piece of the code with the wp's

-- Zones --

zoneParkeerplaats = Wherigo.Zone(cartKetelbinkie)

zoneParkeerplaats.Id="b620ec2a-5596-4c25-b58c-12a7a9dcbb8b"

zoneParkeerplaats.Name="Parkeerplaats"

zoneParkeerplaats.Description=[[Parkeer hier je auto]]

zoneParkeerplaats.Visible=true

zoneParkeerplaats.DistanceRange = Distance(1500, "feet")

zoneParkeerplaats.ShowObjects="OnEnter"

zoneParkeerplaats.ProximityRange = Distance(200, "feet")

zoneParkeerplaats.AllowSetPositionTo=false

zoneParkeerplaats.Active=true

zoneParkeerplaats.Points = {

ZonePoint(51899890,20144,4478828,79856,0),

ZonePoint(51899890,20144,4478759,20144,0),

ZonePoint(51899959,79856,4478759,20144,0),

ZonePoint(51899959,79856,4478828,79856,0)

}

zoneParkeerplaats.OriginalPoint = ZonePoint(51899925,4478794,0)

zoneParkeerplaats.DistanceRangeUOM = "Meters"

zoneParkeerplaats.ProximityRangeUOM = "Meters"

zoneParkeerplaats.OutOfRangeName = ""

zoneParkeerplaats.InRangeName =

 

I know there is something wrong i am doing but cant figure out what

This is also a internationalisation problem, here too you cannot work if you have your decimal-separator set to the comma instead of the point.

 

Go to Settings (configuratiescherm), countrysetting (landinstellingen), choose 'change' (aanpassen) after your country, and set de decimalseparator to '.' (point) and the digitgrouping to ',' comma

 

The problem is that during writing the lua-script is messed up because is writes , as digitseperator instead of .

it should be written like:

zonepplaats.Points = {

ZonePoint(52.75,4.75,0),

ZonePoint(52.76,4.75,0),

ZonePoint(52.76,4.76,0)

}

however, it gets written as:

zonepplaats.Points = {

ZonePoint(52,75,4,75,0),

ZonePoint(52,76,4,75,0),

ZonePoint(52,76,4,76,0)

}

Link to comment
Hello, my first post here.

 

Is the any Cartridge Sample for tutorial (there's one in the GPS) bu is there one to check the Lua code. Learn ir or adjust it to try and learn?

 

Tanks

Unless you're a programmer, the tutorial cartridge will not do you any good. Quite a bit of it is custom programming. Instead, I'd suggest you take a look at another, simpler cartridge. Make sure to play it through either in the field or on the emulator before you open the cartridge in a builder application.

 

I will need to compile a list of open source cartridges for the community.

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