Jump to content

cache_in_pocket

+Premium Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by cache_in_pocket

  1. I'm actually doing the same thing. At the beginning, the player is asked if they would like to do the cache or the playanywhere. If they do the cache, then the pre-defined zones are used. if not, then the current position of the player is the Northwest corner of the playing field. I don't think there will be any confusion that way. The program knows to do 1 or 2 things differently based on the initial question. Good luck with the cart. Mine is half ready and has been so for over a month...just too busy to work on it lately.
  2. That was my post about re-typing a numerical variable after setting it to a value; however, that is not the case here; although it is probably related to the same Builder bug. The problem you are having is that Builder is converting your variable's reference to a string. I just ran a quick test of my theory. When comparing variables that are strings, Builder will do this if your input variable is InputAnswer and the variable you want to compare is CorrectAnswer: if Wherigo.NoCaseEquals(InputAnswer,"CorrectAnswer") then If you take the quotes off, it will work when you compile it outside of builder. Otherwise, the condition is only true if the player enters "CorrectAnswer", the name of the variable. The following also works... if InputAnswer == CorrectAnswer then but I think the NoCaseEquals function does some thing else like removing the 'case' sense of the strings...i.e. uppercase and lower case so that you don't have to worry about the 'case' of the player input. WARNING WHEN LOADING these modes into Builder and then saving...(I just ttried loading things back into builder and this is what I get) if you change "if Wherigo.NoCaseEquals(InputAnswer,"CorrectAnswer") then" to "if Wherigo.NoCaseEquals(InputAnswer,CorrectAnswer) then" builder will remove the whole if statement...royally screwing up your lua file. It removes the 'if' line and the associated 'end', but leaves the 'else' If you convert it to if InputAnswer == CorrectAnswer then, builder will covert it back to if Wherigo.NoCaseEquals(InputAnswer,"CorrectAnswer") then So the best thing to do is make your changes AFTER you are all done and ready to publish. While testing, just input the "name" of the variable to get it to work for the time being.
  3. So sorry...I've tried that and it doesn't work. I'm sure there is a way to get lua to do it, but builder won't let you. This is probably another bug in Builder. If you look at the lua code, the comparison variable that you are trying to use will be seen in quotes. For example, if the answer is contained within "CorrectAnswer" you will see "CorrectAnswer" in quotes in the lua code...which means that the comparison is being made against the name of the variable and not the variable contents. If you type in CorrectAnswer as your input, you will see that your program will accept it. If you try to use object variables, like zitemBlaa.Name, it too will get wrapped with quotes and thus the only correct answer can be "zitemBlaa.Name" What you might try, and this will be a pain, is to take the quotes off from around "CorrectAnswer" and make your compile outside builder...because once you load it into builder, it will put the quotes back on. Then run your .gwc file and see if it works. If it does, you'll have to strip the quotes off before you compile each time. Good Luck...and let me know how it goes.
  4. You can create author defined functions, but they are difficult to call in a way that Builder won't complain about it; however, depending on what you are doing, it might be what you need. But, as an easy way to do what you are saying is to create a task. Create an event on 'Status change' (I think that's the one...I don't have builder running at my current location.) Then from within your script, you change the status of the task...complete = true/false. The only thing I haven't tried here is to reset the task within the event of the task. For instance, elsewhere in your program, you activate the task script.. Set ztaskEatBanana equal to true Then in the 'Status change' event of the EatBanana task, you do Set ztaskEatBanana equal to false to get it ready for the next time you call the task. Obviously in your task, you'd do and if then to test if the task.complete is true of false; but the problem is if lua can work recursively...i.e. make a call to the function it is currently in. If so, great...if not, you can check the condition before you set the task true or false or create a second task to clear the first task. Anyway, just an idea. If you don't want to experiment with it, I can do it later...I just don't have the time right now.
  5. Just so you know, there is still a bug in builder 3-7-08 release. Consider the following code where 'Variable' is set to a number type Set Variable equal to 0 if Variable equals 0 Show Message end In this example, the 'Show message will not execute. If you look at the lua code, the 'Set Variable equal to 0' looks like Variable = "0". Builder will put the quotes around the zero which will dynamically 'type' Variable as a string. And since a string 0, "0" isn't the same as a numerical 0, the if condition will be false and not execute. There are 2 ways to fix this. 1) Go into the lua code and remove the quotes. However, if you load this into builder again, it will gladly put them back on for you. So you'd have to do the compile outside builder...and that's a pain. 2) Put an 'Increment Variable by 0' after the set variable. So in your lua code, you will see Variable = "0" Variable = Variable + 0. The second statement will re-type 'Variable' back to a number type. Most people will probably not even notice it because there is probably some other increment or decrement in the code somewhere before they do any checks on it; however, if your code ever checks for a value that is 'set' by other code that you have and you are checking for that 'set' value....beware.
  6. Actually, items, zones, characters, etc are not referenced by their .name. They are referenced by the object itself. Think of the phrase, "A Rose by any other name is still a rose." The object name is zitemBanana. If you move the bananas to a zone or to an object, the lua code will show zitemBanana, and not 'Banana' So change away...it can make for a cart that changes with the program play. For example, if the player holds the bananas too long, you can change the Bananas to 'Bananas with spots" and then eventually to 'Rotten Bananas". Obviously, this is silly, but you get the idea. I'll have a play anywhere cart out at the end of the week or so that uses this principle extensively.
  7. Yes. 'Check off' was also that Russian guy on Star Trek.
  8. When you set up all your zones, check off the box that says 'Visible' and uncheck the box that says 'Active'...except for the zone that you want to see visible at the start of your cart. You will also see in the setup for each zone, an event tab. Click on that and you'll see a bunch of grayed out events. You can also see this by highlighting the zone from the main screen of builder and clicking the 'zone' button and then highlighting your start zone. Now click on "When a player enters a zone" then click new. A box will pop up asking you to give this event a name. Any name will do and then click ok. Now on the lower left, there is a button called "Add an action". Click on that and then click on "Set a zone active or inactive". Now in the window to the right, click on 'zone' and select the zone you want to turn on. Now select the true/false and select true. Remember that you have to uncheck the 'Active' box in the zone setup. After that is set up, do the same thing for the subsequent zones. In otherwords, for the zone you just 'activated', go to the 'When a player enters a zone" for that zone and activate the next zone. Good luck.
  9. Another tip...put as much as you can in the Author functions. It appears that builder doesn't mess with that area. However, Builder still has a problem when referencing string or numerical values and puts quotes where you don't want them to be. So in my lua code, I placed the following line to do the zone re-map... if action == "Button2" then Wherigo.MessageBox{Text=[[You've enable cache mode. This is tied to cache GCxxxx.]],} else x = "ReassignZones()" end end ... -- #Author Functions Go Here# -- function ReassignZones() local dist = Wherigo.Distance(50, 'ft') zoneStart.Points = GetZonePoints(Player.ObjectLocation, dist) ... I pretty much do the same things Trenkle does (got my start in his Vegas Riddle cart), but I put the main block of the zone reassignment code in a function called ReassignZones. You pass no parameters and although I put an 'x=ReassignZones()' in the code, 'x' doesn't do anything other than make Builder happy...why? Cause it can 'parse' it. Having just ReassignZones() sitting there without the 'x=' will work if you do the compile without loading it into builder; otherwise Builder will complain and not load and/or save your .lua file correctly. However, note the quotation marks that Builder puts on x="ReassignZones()" you'll need to change it in the lua file manually outside of Builder to x=ReassignZones() You can't help that...Builder just does it. You'll have to take the quotes off for the function to get called. But the plus side is that you can still do editing and tweaks in Builder without upsetting builder. When you are done, then remove the quotes. Let me reiterate one point in my last message about the timer and Wherigo.INVALID_ZONEPOINT. When you make the cart location equal to Wherigo.INVALID_ZONEPOINT, the emulator pops up a dialog box of where you want to start. This didn't work well, at least for me. I end up in London at 0 lat and 0 lon. If you just leave it alone, it seems to work just fine in the Emulator. Sure it will start you where you originally defined it, but then you just move the virtual player to where ever, and then use the button script to select the original zone or zone based on current location, (Anywhere). So, while you develop you code and make your changes, the worst thing that builder will do is put quotes around "ReassignZones". You can still save and edit in builder, and emulate your changes. When it comes time to re-publish, then remove the quotes and all will be good.
  10. One thing I've done, and it seems to work in the Emulator is not to mess with Wherigo.INVALID_ZONEPOINT nor create a timer. My cart will be both a play anywhere and tied to a physical cache. In this case, the first thing the cart asks is if you want to do a play anywhere. If so, only then does it remap the zones.
  11. So just to clarify. If you have a variable named BananaCount, then your message to the player would be... [[You have ]]..BananaCount..[[ Bananas Left]] Another fun thing you can do is alter the names of Zones, Items, etc. For example: Set zitemBananas.Name equal to [[bananas (]] ..BananaCount..[[)]] Set.zitemBananas.Description equal to [[You have ]] ..BananaCount.. [[ left]] So when you look at Bananas in your inventory, you see Bananas (5) And when you tap on it, Bananas (5) You have 5 left However, setting the name like this does not make it dynamic. If BananaCount changes, the name or description will not update. Whenever you cause BananaCount to change, you have to reapply the action 'Set an object property or variable to a value, variable or object property. Good Luck.
  12. I see what you mean. And I think I can see a way to do it....just not as easy as I hoped I could make it. However, on a somewhat related topic, is there a list somewhere of Wherigo variables that we can exploit? I've read about player name and altitude, and some other undocumented variables. Thanks.
  13. Oh, 'Fred' is a task. Hmmm, I didn't know you could place a task in a zone. Like I said, I don't have the program running right now. However, could you create an item or character and call it Fred? Place it in the zone and specify the coords and that should do the trick. Add some interaction commands to the Fred item/character to enable the player to complete the task.
  14. And I'm sure if you got that wish granted, you'd ask for 3 more wishes, right? But, there is a work around for everything though. What you might want to do is open up the lua file and work from that. Next, use an spread sheet to do the calculations for you and paste the results directly into the lua file. Now all you have to do is break out your high school math books. Another approach might be to have the cartridge itself do all the calculations for you and change the zone location and perimeter on the fly. This would require some Author functions; however, it could easily become a 'Plays Anywhere' and everyone just loves those. Download the 'Vegas Riddle' Cart by Trenkle and look at the Author functions used there. With a little reverse engineering, you'll be able to figure it out.
  15. I don't have my emulator running right now, but since Fred is an object in the zone, you should see the distance and direction by clicking on 'you see' tab. I'm sure there is an internal variable that we don't know about that could do just what you are saying, but perhaps all you need to do is direct the player to look at the 'you see' tab. Just be sure that you don't have too many items or characters where you are giving the player information overload. Hope this helps.
  16. Is there a way to reference the 'current zone'? For instance, the player has an item to drop. Is there a simple way of dropping it in the current zone rather than having to if then else through all the zones in order to hit the zone the player is currently in. This would be outside of builder...I'm pretty sure builder can't do it. Then the next question, how do you check that the player is in 'any zone'? Thanks.
  17. The best advice is to download penguin escape and play it....just a little bit will do. Then open up the source and look at it. This would be the more complex use of items and item commands. For the real basic understanding of items, just use the wizard in builder to make a simple cart and then play it. Doing this will get you going faster than reading a manual or reading the forums.
  18. I have an axim x50v with the vga screen and I get exactly the result above. It is workable though. I did my second trial run this morning and it works, but it would be very cumbersome to do this all the time.
  19. I had/have the same problem. As I had a player enter a zone, I 'show detail screen' of the zone the player entered. I wanted the media associated with the zone displayed, but like you, I wasn't getting anything. So I tried a few experiments and found that if I tried to show detail of a zone while in that zone, I got nothing. But if I were in a different zone or no zone at all, I could see the zone picture just find. So now, I just changed it to a 'show message' with a picture attached. Yeah, there's a bug there, but the work around for me seems to work ok. I've told David about it, but I'm sure other tasks have higher priority than this one I'm sure.
  20. I'll agree that at this stage of this game that it might be more beneficial to keep encryption to a minimum. After all, we want people to enjoy our creations. But, if you do want to hide a few things, there are some really easy ways to hide things and some excellent ideas have been made here. Here are some of mine. -Assign a new variable with the answer. When comparing user input, just check it against the variable instead of a value. So now they'll have to figure out where the variable is assigned...but if you make the variable name something that seems like the right answer, that just might confuse the cartridge hacker. -Then on top of that, you can also use a numerical input. Again, compare the answer to a pre-defined variable. But rather than simply assigning the the number to a variable, do a few "increment variable by 110" in one place and "by 6" in another. And if you think they will hack that, add a few "increment by" operations that will never get called. I'm sure there are plenty of ways to add confustion without having to edit the lua file manually.
  21. I'm not worried about it too much. I guess I'm just accustomed to "ending" a piece of software. I'm sure that once the user is done with the cartridge, that 'X' up in the corner will get depressed faster than you can say "What's the next cache on the list".
  22. What would be nice to have a command that would make it step through the code. Or in other words, wait for user input. For example Show a detail screen <wait for user to click the "ok"> Show a message <wait for user to click the "ok"> Show a screen Otherwise, if you tired to do the "show"s above sequentially, all you'd get is the last one and you'd never see the detail nor the message. And yes, you can make a button script in the show message, but the dialog and the detail screen have no such control.
  23. I have a variable that changes name from MagnifyingGlass to MagnyingGlass in various parts of the lua file. I modify it back to "Magnifying" in notepad and then load it into builder. Once in builder, it changes "Magnifying", in some places, back to "Magnying." if I fix it in builder, it will remain ok and I can compile and run, but when I save it back, it saves it out bad again...and in the same way. So thinking it was reading some other file somewhere else, I copied the lua file to something else and changed all zitemMagnifyingGlass to zitemMagGlass....thinking that maybe a parser somewhere was removing the "if" from Magnifying. I got different results though. Now all the uses of the variable are zitemMagGlass, but the definition of the class was changed back to zitemMagnifyingGlass. So my question is, where is the builder getting this information from. I don't think it is pulling it out of thin air. Anyone have a clue on this one? Thanks.
  24. I couldn't think of a better way to title this, but what I'd like is a more elegant way of performing some sequential actions. For example: In my cart, I'd like to have the player examine an item in inventory; however, I find it a nuisance to have to "back out" to the main menu all the time...or to wherever is necessary. Since an action of "show message" usually ends with a prompt of "ok", I'd think I could put a "show main menu" after the "show message" and everything would be fine, meaning the message would show and then when "ok" is pressed, to would automatically move to the main menu screen. Ok, so for this one, I just added a script within the "show message" with a button title of "ok". So when ok is pressed, it runs a script to go to the main menu. However, now I'd like it to do it for a dialog. If I put the "show main menu" after the dialog, you never see the dialog...it jumps right to the main menu. At this point, I'm assuming this isn't possible and I'm dealing with it, but if there is something I'm missing, I'd appreciate a nudge. Thanks
×
×
  • Create New...