Jump to content

charlenni

+Premium Members
  • Posts

    377
  • Joined

  • Last visited

Everything posted by charlenni

  1. Sorry, browser has an error while writing the message. If have problems with the io library on the colorado. I have wrote a small program to show the problem. It is reading a text from a media text file, which is included in the gwc file. On the emulator it works perfect ;-) On the colorado I get a "Unexpected error / Cartridge closed". Did someone have used the io library on the colorado? Best regards Dirk IOTest.zip
  2. Now I have a solution for one of my two problems: the input of the language. Also I have added the translation of text for EmptyYouSeeListText, EmptyTasksListText and EmptyInventoryListText. So you could choose your language at the begining of the cartridge. So the translate modul works fine except it would not run on colorados (and on oregons as well) because of the io problem. If this is solved, it is ready to use. DialogTest.zip
  3. Thanks a lot for your help. Forgot to create a function ;-) I learnd, that you need no buildvar for an input. You need only the zinput and the OnGetInput method. So, if you want create an input by code, all you need is zinputLang = Wherigo.ZInput(parCartridge) zinputLang.Id="89a0db31-3ec5-43e3-9845-831bc451a86c" zinputLang.Name="Translate" zinputLang.Description=[[]] zinputLang.Visible=true zinputLang.Choices = {"Choice1","Choice2"} zinputLang.InputType="MultipleChoice" zinputLang.Text=[[]] zinputLang.OnGetInput = function(self,input) translateLang = input end Wherigo.GetInput(zinputLang)
  4. Hello, I use the following code to create an input by code. It works perfect, all choices will be shown on the screen, but I didn't get the result. The varaible is allways nil. translateInput = "" parCartridge.ZVariables.translateInput = "" buildervar.translateInput = {} buildervar.translateInput.Id ="9cb725df-376d-4334-a46b-cae1d4eff1fc" buildervar.translateInput.Name = "translateInput" buildervar.translateInput.Type = "String" buildervar.translateInput.Data=[[]] buildervar.translateInput.Description=[[]] zinputLang = Wherigo.ZInput(parCartridge) zinputLang.Id="89a0db31-3ec5-43e3-9845-831bc451a86c" zinputLang.Name="Translate" zinputLang.Description=[[]] zinputLang.Visible=true zinputLang.Choices = {"Choice1","Choice2"} zinputLang.InputType="MultipleChoice" zinputLang.InputVariableId="9cb725df-376d-4334-a46b-cae1d4eff1fc" zinputLang.Text=[[]] Wherigo.GetInput(zinputLang) if translateInput ~= nil then print(translateInput) end Any ideas? Best regards. Dirk
  5. I have made a small Lua-file for testing. It has only one media (txt-file). If you start the cartridge with the emulator, you should see the abc in a MessageBox and in the Lua debug of the emulator. If you start it on the garmin, you will get an "Unexpected error / Closing cartridge". IOTest.zip
  6. so, if you put your object library as a lua file inside the cartridge and "require" it, that does work on colorado? No, it didn't work. I get an "memorycard reading error". With the emulator extern *.lua-files work. If I put the modul in the author script section, I get an error, if I try an io-operation. And the problem with the selfmade input are further exists.
  7. The disadvantage of my approch is: it didn't work. The advantage is: you could select with the frist screen of the cartridge which language you want. And, if it's work (io on colorado), you could also make images on the fly (assumed you have a Lua jpg-library). Also in larger projects sometimes it is better, if you could give all text to someone, who could translate it. You could name your builder "WherIBuild" as against "WherISwear" for the original one ;-)
  8. Here is the code. It works all fine except the io functions on the colorado and the input of the first screen (selection of the language). It is hardwired to "english.txt". If you want to change it to "deutsch.txt" you hade to change line 181. It works also in the emulator without the text-files in the same directory. You only need the gwc-file. I think, garmin "forgot" to implement the io functions ;-) DialogTest.zip
  9. You are right! We couldn't use extern files. It's terrible. You couldn't work with extern files. Now I have rewriten the code, so the files with the translations are medias. You have to medias with name say langEnglish and langDeutsch. Each of that medias contain one resource which ist a textfile in the format"Ident=Text" for all text you want translate. At each point you would be translated you write "{Ident}" (works for all objects defined in builder and all Dialog and MessageBoxes). At start you call a function which looks for all languages in the medias and than show a input, which will to be used. Now this media will be read which you choose. After that, all text in objects will be transfered. Dialogs and MessageBoxes will be transfered on the fly. All text is embedded in the gwc file. Now the problemes: 1. Normal input problem (should be the last call in Cartridge:OnStart()) 2. I didn't get the choice of the input. The variable is empty. I need help in programaticaly create an input. 3. On the Colorado the access to the textfile didn't work (I get a memorycard error) I think, Garmin didn't have implemented the io-library I will only need io.open, io.lines and io.close. But if they implement it, we can also make a library for making images on the fly ;-) If you like to see the code, I could send it to you. But there are no comments in the code ;-)
  10. matejcik, you are right. You could use each variable or function you want in the builder if you use [[]].. ..[[]]. I didn't know this. Thanks. But couldn't we use it for a translation on the fly? You could have for each language an own textfile wie the translations. In the builder you use only say "[text01]" and the functions read the text for "text01" from the textfile? For Dialogs and so one it is no problem, but for Names and Descriptions. I try this in the next days. Best regards.
  11. I have another idea for this functions: if you have all text of Dialogs, MessageBox and Input you could replace text. I expanded the function, so you can write for exapmle "Hello [Player.Name], how are you?" will expanded on screen to "Hello Builder, how are you?". All varaibles which are standing between "[" and "]" are expanded. Even all functions. You could write "The result is [25*2]." and it will expanded to "The result is 50." Or if you have timer ztimerTest you could show a dialog with text "You have [ztimerTest.Remaining] seconds left. Hurry up". Or you can even call your one functions if the result is a string. And the best: you must not leave the builder, all could be done inside normal Dialogs, MessageBoxes and Inputs. I didn't test the input function (time is to short ;-). Here is the code function Wherigo.Dialog (tbl) for k,v in ipairs(tbl) do table.insert(dialogStrings, v) end if dialogStrings ~= nil and #dialogStrings > 0 and dialogStrings[#dialogStrings].Text == nil then table.remove(dialogStrings) if #dialogStrings > 0 then tbl = {Text = table.remove(dialogStrings).Text,Buttons = {"Ok",}} Wherigo.MessageBox(tbl) end end end function Wherigo.MessageBox(tbl) local ds = dialogStrings dialogStrings = {} local cb = {} cb = function(thing) if thing ~= [[Button1]] then if tbl.Callback ~= nil then tbl.Callback(thing) end else local item = table.remove(ds,1) if item == nil then tbl = MessageBoxReplace(tbl) originalFns.MessageBox(tbl) else item.Callback = cb item = MessageBoxReplace(item) originalFns.MessageBox(item) end end end cb([[Button1]]) end function Wherigo.GetInput (input) local item = table.remove(dialogStrings) input = MessageBoxReplace(input) item.Callback = function(thing) originalFns.GetInput(input) end item = MessageBoxReplace(item) Wherigo.MessageBox(item) end function MessageBoxReplace(tbl) if tbl.Text ~= nil then tbl.Text = string.gsub(tbl.Text, "(%b[])", function (x) x = "return " .. string.sub(x, 2, -2) local f = loadstring(x) return f() end) end return tbl end
  12. After a night of sleep I found a better way for my problem. If you want only make a series of dialogs this wouldn't work with your aproach. You should make a MessageBox at the end. If you would us the following code function Wherigo.Dialog (tbl) for k,v in ipairs(tbl) do table.insert(dialogStrings, v) end if dialogStrings ~= nil and #dialogStrings > 0 and dialogStrings[#dialogStrings].Text == nil then table.remove(dialogStrings) if #dialogStrings > 0 then tbl = {Text = table.remove(dialogStrings).Text,Buttons = {"Ok",}} Wherigo.MessageBox(tbl) end end end You could make a series of dialogs with the builder and the last line leave empty. In the builder you would see [[No Text]] and in the cartridge the dialogs want be shown. There is no need of an extra MessageBox. Better?
  13. I found the function a few days before and I like it. I looked at the code and think, if you could change the Dialog function, you need not a MessageBox. function Wherigo.Dialog (tbl) if tbl ~= nil and tbl[1] ~= nil and tbl[1].Text ~= nil then for k,v in ipairs(tbl) do table.insert(dialogStrings, v) end else if dialogStrings ~= nil and #dialogStrings > 0 then tbl = {Text = table.remove(dialogStrings).Text,Buttons = {"Ok",}} Wherigo.MessageBox(tbl) end end end You could start displaying the messages with an empty Dialog (No Text). In code it would be Wherigo.Dialog{{},} . Best regards. Dirk
  14. Hello, now I will start with a contribution to the author script library. For a new project I need functions for containers (chest, box, house ...). You could put item(s) or character(s) in this container and remove them. You could lock (automaticaly closed), unlock, open (only if unlocked) and close the container. You could check if an item belongs to the container, if it is visible and how much item(s) belongs to the container. If you move the container, all item(s) will be moved with the container. The item(s) in the container could be visible or not, but if the container is closed, than all item(s) belonging to the container are unvisible. If the container opens than the items will be visible if they was visible before (unvisible items are further unvisible even if the container is open) If there are any changes to the container you can get a messages: OnChanged(What), OnAddItem(Item), OnRemoveItem(Item), OnItemVisible(Item). The code is a module. I have tested it with the emulator (I didn't have my Colorado in the moment). You could save the file "container.lua" to your project-directory and add a 'require "container"' to your author script. To see, how it works, I have made a small Wherigo. It's the first version, so there is not guarantee for perfection. Best regards Dirk container.zip
  15. Hello, if "in the current zone" means is visible to the player than you can check, if the player sees the object: function isItemVisible(parItem) local retValue = false for k,v in pairs(Player.GetVisibleObjects(Player)) do if v == parItem then retValue = true end end return retValue end Hope this helps Best regards Dirk
  16. Isn't it yours? I thougth, I see your name in the wiki. PS: I searched now: it was created by twolpert
  17. When matejcik is posting here: couldn't we use his wiki at wherigobuilder.wikispaces.com? There are much of the objects used by a Wherigo listet and we could create a section for functions. So we can discuss the source here and if it's stable the author could transfer it to the wiki. Best regards Dirk
  18. Hello, anyway it would be very nice, if someone from Groundspeak would issue a statement on the future of Wherigo. I can bear a lot of things: a faulty builder, different players. But I am NOT willing to invest in a dying product. I suppose we all would be grateful (and patient) if there is a simple and short announcement like: "YES, we have plans, YES we are working seriously on it, YES there will be something new/modified and YES, Groundspeak backs that project. Do I ask for the impossible? Best regards, Dirk (who loved creating his first Wherigo and would like to start a second one , if...)
  19. Hello, I released in the last few days my first cartridge and now I get the first feedbacks. The cartridge works on Colorados but didn't on Oregons. It was tested on two different Oregons. If the error occure, the display of the Oregon "fade away" and the Oregon power off. It's not allways the same position in the game. They said, if they resart the device, go to the beginning and tried it again, they could go further on and ended up at another stage. The team with the Colorado (I myself have one) didn't have any problems. Any ideas? Best regards Dirk
  20. Hello, I made in my first cartridge (http://www.Wherigo.com/cartridge/details.aspx?CGUID=256907ea-9e3d-4038-a6b2-19b37697c814) an animation. I used a timer with a 2 second countdown and each tick I changed the media from the item and show it again. It works great. Best regards Dirk
  21. Sorry, I tested the zones on my colorado today. The colorado could work with zones greater than a point. It was my mistake. The problem is the accuracy of the coordiantes. The zone shouldn't be to small. Now I have used the OnProximity on my first cartridge (http://www.Wherigo.com/cartridge/details.aspx?CGUID=256907ea-9e3d-4038-a6b2-19b37697c814) and it works good enough for me. Next time (if there is a next time) I would try zones. Best regards for every help. Dirk (Charlenni)
  22. Zones work on the Colorado (version 2.9), but not with a shape. Each zone is a point and you should hit it with a distance of 0. This is the problem. The solution with proximity works, but there is no event for leaving zone btw. you sould do it yourself. If I had a choice, I would prefer a solution with zones. Best regards Dirk
  23. Hello MikeEMT, thank you very much. I will test it. Are we the first one with this problem? Best regards Dirk
  24. Thanks a lot for your answer. I am very frustrated of making carts. The builder is bugy, last version from may 2008, for each player you have to know which function works and which not. A workaround here, a workaround there. But no list, which function works on which player at which version. Didn't Groundspeak like there 'child'? To reach a position with distance 0 ist difficulty. Did you test the workaround with proximity? Best regards Dirk
  25. Hello, I'm new and try to make a new cartridge. After a week of work (it works perfect with the emulator), I transfered the cart to my colorado and got out. Now I must realize that zones on the colorado are only points. Is this right? Is there a workaround? Best regards Dirk
×
×
  • Create New...