Jump to content

URWIGO builder


yourself
Followers 61

Recommended Posts

Hi! Thanks for the update of urwigo :)

 

Im trying to dig deep into lua :)(Building my cartridge with Urwigo) For the moment ive building an cartridge for to be played anywhere. Ive got 8 zones and the cartridge work well. But i would like to build something like a memory game. So in these 8 zones I need to get 4x2 pictures (one picture in each zone). And then you have to pair the pictures..You get it? I know how to get them there by adding a picture for each zone in the inventory or in the zoneImage.

 

But is there a way to add the pictures randomly? When starting the cartridge!

 

Update: Im answering my own question :)

Yes you can get a random picture

 

function RandomPicture()

local images={apple1,apple2,bananas3,bananas4}

local r=math.random(table.getn(images))

Wherigo.MessageBox{Text="The fruit", Media=images[r]}

end

 

But how to get them into random zone ?

Edited by Gormare
Link to comment

local zones = {zone1, zone2, zone3, zone4 }
local images = {image1, image2, image3, image4}

for i = 1,#zones do
 local r = math.random(#zones)
 while images[r] == false do
   r = math.random(#zones)
 end
 zones[i].Media = images[r]
 images[r] = false
end

Don't use table.getn(), because not all systems has this implemented. It is a deprecated function in Lua 5.1.

Edited by charlenni
Link to comment

local zones = {zone1, zone2, zone3, zone4 }
local images = {image1, image2, image3, image4}

for i = 1,#zones do
 local r = math.random(#zones)
 while images[r] == false do
   r = math.random(#zones)
 end
 zones[i].Media = images[r]
 images[r] = false
end

Don't use table.getn(), because not all systems has this implemented. It is a deprecated function in Lua 5.1.

 

Ty Charlenni :)works lika a charm :)I take the chance and ask one more question!

Is there a way to do something similar and transferer items and images to the same zone? for ex I like the dragon to be seen in the zone and the player would have to option to pick it up!!

Link to comment

local zones = {zone1, zone2, zone3, zone4 }
local images = {image1, image2, image3, image4}
local items = {item1, item2, item3, item4}

for i = 1,#zones do
 local r = math.random(#zones)
 while images[r] == false do
   r = math.random(#zones)
 end
 zones[i].Media = images[r]
 items[r]:MoveTo(zones[i])
 images[r] = false
end

You shouldn't ask this all in this thread. It has nothing to do with Urwigo :)

Edited by charlenni
Link to comment

How do I change the on proximity events in a zone in urwigo?

 

Here's what I am trying to do: in zone "A" when the player enters they are given a message. They then leave this zone and re-enter. The second time around I do not want to show the same message again.

 

How do I do this in Urwigo?

 

You could use a variable to store the status of the zone, i.e. if status == 0, show message and set status = 1; if status == 1, do nothing

Link to comment

Hi! I have a function like this below that takes a players input.

Depending on input the variabel animal gets a new value and a new function are called.

It works nice! But!

 

here is a lot of animals around :) so insteed of doing theese if's I was thinking is it possible

to do the same with a table/ arrays?

 

function check_animal(input)

local animal = input

local key = string.sub(animal, 1, 3)

if key == "dog"

then animal = " You like the dog."

dog()

else

if key == "cat"

then animal = "You like the cat."

cat()

end

end

end

Link to comment

Hi Tikkanen,

 

I sometimes store the coordinates as an item in the characters inventory. Another option is to put the coordinates in the zone description for the final zone and leave that zone active at the end of the Wherigo so that the player can always see that area. Here is a

tutorial on how to add it as an item.
Link to comment

I developed a cartridge in Urwigo but after the initial success I want to translate it from my local / native language into other languages. What is the best way to do that in Urwigo? (When I now start a new cartridge and know that I want to translate it (from the beginning or later), I develop it in Earwigo as this has a built-in support for multi-language cartridges). Does anyone have an experience with this in Urwigo (and esp. with adding the multi-language support after the first single language version)? Options that come in mind:

  • make copy cartridges (and thus multiple Wherigo.com listings) for the translations
    • what about maintaining multiple versions and keeping them in sync?

    [*]keep one cartridge and introduce multiple languages

    • techniques?

Edited by Dani+Iris
Link to comment

I created for the second case a quick and dirty solution for you. It is a module called Language, which has the following capabilities:

- Translate all objects (name and descriptions)

- Translate commands

- Translate MessageBoxes and Dialogs with their buttons

- Translate inputs

- Translate multiple choice entries of inputs and convert it back before call of OnGetInput

 

Who to use? Copy the code of the Lua Author Script (see attachment) to your project. The first in OnStart should be an input, where the user could select his/her language. Than init the language module with a call of "Language.Init(language_number, language_separator)". All texts should be set as "text in language 1##Text in language 2##Text in language 3" (in this example, language_separator is "##"). Than you could select with language_number of Init function, if you want the first, second or third part of the string (e.g. when language_number was 2, you get "Text in language 2" for the string. That's it.

 

Tested it only on Emulator, so be carefull. If you encounter any problems, send a short message and I look into it.

 

Best regards,

Charlenni

 

PS: It could be possible to use the UTF-8 GWZ file to have special characters on Garmins, but I didn't tested this.

Link to comment

I am hoping I can find a way to make my Urwigo work. I have created the zones, items, characters.

 

I have tested it in the field twice. Once myself on my smartphone and once a friend tested it on a Garmin after I modified it. Both times it had faults.

 

I really want it so that when you collect all the items you get the answer, the coordinates.

 

I got the maps, zones and tasks and managed to collect some items but others didn't work.

 

(I used the move to player option)

 

But I couldn't make it dependant on actions.

 

So I tried a different method. The map did not show on the Garmin. So it was impossible to test as the map didn't show.

 

Please help

Nellie

Link to comment
So I tried a different method. The map did not show on the Garmin. So it was impossible to test as the map didn't show.

The Garmin Wherigo Player does not plot things out on a map. It would have been nice, but none of the original Wherigo Player applications use maps.

 

 

I really want it so that when you collect all the items you get the answer, the coordinates. (I used the move to player option)

When you write the actions to give the player an item, you'll have to write a test to see if each item exists in the player's inventory. That might be a pain. I'd suggest, instead, to have a counter variable. Every time an item is added to the player's inventory, increment the counter. That makes it easier for you to write the subsequent test and also allows you to vary the number of items the cartridge uses while you're testing it (because you can also compare that counter against a variable containing the total number of items in the game. (If you were okay with writing author script, I'd just make a call to a function that would determine whether the player accomplished collecting all the items. That way your code isn't duplicated.)

Link to comment

I have finally learned enough to make my first Wherigo using urwigo builder.

 

I have a battle scene code written which resembles the RPG style, i.e. "player hits wolf, -7hp".

But in both the emulator and in android the messages don't show up long enough to see, it just goes back to the attack menu. I tried using a dialog call which should require a click to continue, it didn't work. I thought the recursive input call I was using was at fault. Now I have a separate function call to handle the message, which calls up the attack input again. Yet the messages don't wait for a click to continue.

How can I fix this?

 

Also in a shop menu I have an if player contains item, message "you already have one" and no purchase is made. The message is skipped here also.

 

What is going on?

Link to comment

I created for the second case a quick and dirty solution for you. It is a module called Language, which has the following capabilities:

(...)

Copy the code of the Lua Author Script (see attachment) to your project.

 

Sorry for the late reply, but is it possible that I don't see the attachment?

Link to comment

Another Newbie with a problem!

 

Does anyone know why using 'CurrentZone.InventoryCount' causes a Lua runtime error? It reports "Attempt to get length of field 'inventory' (a nil value)".

 

As I move into a zone I simply want to display the zone's name and the number of items in that zone's inventory. There is no problem if I display just the name. There are no errors detected in the Urwigo builder.

 

Any help would be appreciated

Regards

Robert

Link to comment

I would say, that you should use "Inventory" instead of "inventory". Perhaps your version of Urwigo has a problem in this function. To check this, save your cartridge as GWZ file and open it with a ZIP tool. Extract the Lua file and open it with a text edito. Search for the mentioned "inventory" and post this line of code.

Link to comment

Hi Charlenni:

 

Many thanks for your prompt assistance. I had managed to get the lua file into an editor but frankly it didn't mean too much to me particularly as all the strings need decoding.

 

I have created a tiny cartridge in Urwigo with a single zone and a single On Entry event. I used the Urwigo builder to display three dialogs. The first displayed CurrentZone.Name, the second CurrentZone.Description and finally CurrentZone.Inventory Count. The event code is:

 

function Zone1:OnEnter()

_bnqDm = _DUs("\040\059\003\117\071")

_Urwigo.OldDialog{

{

Text = _G[_bnqDm].Name

},

{

Text = _G[_bnqDm].Description

},

{

Text = tostring(#_bnqDm.Inventory)

}

}

end

 

This will produce the runtime error. However if I remove the final InventoryCount dialog then the other two work perfectly. I tried removing the 'tostring' function and '#' sign but I couldn't re-load the lua into Urwigo to test it out.

 

Kind regards

Robert

Link to comment

Thank you for the code.

 

It seems, that this is a Urwigo bug. _bnqDm is a string, which hold the variable name of an object. _G[_bnqDm] is the object itself. Because of this, the first two dialogs work. But than _bnqDm.Inventory is called, but the string _bnqDm doesn't have such a field. That's way the cartridges crashes. Correct would be #_G[_bnqDm].Inventory for the number of items in the inventory.

 

But be carefull, if you made this by yourself, because the variable name _bnqDm looks next time different. It's part of the obfuscation system of Urwigo.

 

@Yourself: I assume, that this is a bug.

Link to comment

Hi,

 

Recently we have updated from Windows 7 to Windows 10, and since then we have a problem with urwigo, we can build cartdrige, but we can not run the cartdrige to test it. Someone else have this problem?

 

We have already solved, the problem was the Windows 10 permits, putting the folder on the desktop the problem has been solved.

Link to comment

Hi,

 

Could some one explain how the "current objects" feature in urwigo works? If possible, a couple examples would be really helpful too. I have tried to use it a couple times but I realize now that I don't really understand what "current objects" is used for and I could not find any documentation on it.

 

I was hoping to setup a command on an item that only effects the characters in the current zone the player is located in.

Edited by Forest-Ghost
Link to comment

I am trying to build my first cartridge. what I want to know is how to do the following:

 

1. I want to give the player a option of two or more choices, each option will have it's own consequence and action. How do I go about creating this?

2. Also I want a character in the game to be able to speak at different stages and say different things during these stages. How do I set this up?

 

Thanks

Link to comment

I am trying to build my first cartridge. what I want to know is how to do the following:

 

1. I want to give the player a option of two or more choices, each option will have it's own consequence and action. How do I go about creating this?

2. Also I want a character in the game to be able to speak at different stages and say different things during these stages. How do I set this up?

 

Thanks

 

Download this simple sample cartridge: http://www.urwigo.cz/vzorove-projekty/58-adventura-honzik-na-prazdninach

Link to comment

Hi,

 

Could some one explain how the "current objects" feature in urwigo works? If possible, a couple examples would be really helpful too. I have tried to use it a couple times but I realize now that I don't really understand what "current objects" is used for and I could not find any documentation on it.

 

I was hoping to setup a command on an item that only effects the characters in the current zone the player is located in.

 

Hello,

 

documentation is here: http://www.urwigo.cz/navod/39-jdeme-na-to-s-urwigem-10-prace-s-objekty

Link to comment

I am trying to build my first cartridge. what I want to know is how to do the following:

 

1. I want to give the player a option of two or more choices, each option will have it's own consequence and action. How do I go about creating this?

2. Also I want a character in the game to be able to speak at different stages and say different things during these stages. How do I set this up?

 

Thanks

 

Download this simple sample cartridge: http://www.urwigo.cz/vzorove-projekty/58-adventura-honzik-na-prazdninach

 

Thanks for the link you don't by any chance have a English version?

Link to comment

I am trying to build my first cartridge. what I want to know is how to do the following:

 

1. I want to give the player a option of two or more choices, each option will have it's own consequence and action. How do I go about creating this?

2. Also I want a character in the game to be able to speak at different stages and say different things during these stages. How do I set this up?

 

Thanks

 

Download this simple sample cartridge: http://www.urwigo.cz/vzorove-projekty/58-adventura-honzik-na-prazdninach

 

Thanks for the link you don't by any chance have a English version?

 

I've used Google translate, the translation is not perfect but it is helping me to get a better understanding of creating a cartridge. tHanks

Edited by Bremar Josrut
Link to comment

Check out

tutorials for urwigo too. There are a whole series of them. I first learned urwigo through copying his code.

 

A good way to learn is by practicing by looking at other urwigo cartridges. Another idea is to build a cartridge in Wherigo kit and then important into uriwgo. Kit makes it really easy to design a Wherigo and then after you important it in uriwgo you can see more of what is going on inside the cartridge. Also try practicing by building several of the tutorial cartridges (Groundspeak, Earwigo and of course the urwigo cartridges).

Link to comment

Here is one example that has both. I created a nested zone that is only visible after entering the first zone. The item is moved to the character after exiting the nested zone. There is probably another way to do this but I could not figure it out. The Wherigo player tutorial has a function similar where you have to find an item 30 meters from your current location.

 

For the timer I just created an interval timer that displays the game run time in seconds after entering the final zone. I don't know how to make it display in minutes.

 

Here is the cartridge. I don't know why but Groundspeak doesn't let me upload attachments. Download the source file, rename it to .zip and you will find the urwigo file inside.

Edited by Forest-Ghost
Link to comment

The main changes are the support of UTF-8. With this, it is possible to have special characters on all devices (including the emulator) except Garmins. With the (Garmin-UTF8 library, you can have them on Garmins too (not all, but all belonging to ISO 8859-1. So this release is mostly for Europeans :D .

 

To use UTF-8, start or compile cartridges with the UTF-8 option and to upload the cartridge to www.Wherigo.com or www.wherigofoundation.com use the UTF-8 option too.

 

I don't know, if there any additionally changes.

Edited by charlenni
Link to comment
OSM = http://c.tile.openstreetmap.org/{z}/{x}/{y}.png
MTB = http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png
Google Map = http://mt1.google.com/vt/x={x}&y={y}&z={z}
Google SAT s názvy = http://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}
Google SAT = http://khms0.google.com/kh/v=187&src=app&x={x}&y={y}&z={z}
MAPY.CZ Základní = http://m1.mapserver.mapy.cz/base-m/{z}-{x}-{y}
MAPY.CZ Foto = http://m1.mapserver.mapy.cz/ophoto-m/{z}-{x}-{y}
MAPY.CZ Turist = http://m1.mapserver.mapy.cz/wturist-m/{z}-{x}-{y}
MAPY.CZ CykloTur = http://m1.mapserver.mapy.cz/turist_trail_bike-m/{z}-{x}-{y}
MAPY.CZ 2.VM = http://m1.mapserver.mapy.cz/army2-m/{z}-{x}-{y}

Link to comment

I have an issue with the Urwigo emulator (or the Groundspeak emulator in Urwigo -- don't know what the relationship is).

 

On my Windows 7 desktop it seems to work OK, but on my new Windows 10 laptop, the "tasks" on the main menu does not appear.

 

Anybody else seen that issue?

Link to comment

@ZenGuru: Did you check, if you could scroll down? Perhaps the window is to small, so that the tasks aren't fit on the screen.

 

@Team Weening: It would be great to have a small demo cartridge to see, what you are doing. With no further information I have to guess. Perhaps you forgot to set the task and the zone active?

Link to comment

I had a similar problem with the tasks not showing up for me awhile back. In the display settings there is an option to change text and or other items to larger or smaller. Make sure that this is set on "smaller 100%" and not 125% or anything higher. This will make the tasks disappear in urwigo.

Edited by Forest-Ghost
Link to comment

I had a similar problem with the tasks not showing up for me awhile back. In the display settings there is an option to change text and or other items to larger or smaller. Make sure that this is set on "smaller 100%" and not 125% or anything higher. This will make the tasks disappear in urwigo.

 

You nailed it! Found the setting in Windows Display and changed it from what Bill Gates recommends (125%) to 100%. Now it looks the way it should. :D

Link to comment

Is there a good instructional site on using the URWIGO builder? I tried following the tutorial on the download site for the program, but it seems like a lot of stuff I would like to be able to do is not covered.

 

Have you tried looking on You Tube for Landon Smith. He has some great tutorials for Urwigo.

Link to comment

Is there a good instructional site on using the URWIGO builder? I tried following the tutorial on the download site for the program, but it seems like a lot of stuff I would like to be able to do is not covered.

 

Have you tried looking on You Tube for Landon Smith. He has some great tutorials for Urwigo.

I think that's the one I found. After watching one of the video's everything made a lot more sense.

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...
Followers 61
×
×
  • Create New...