+MountainRacer Posted February 23, 2008 Share Posted February 23, 2008 Is there any way to copy any parts of the script in the Builder? Here's my situation: inspired by J2B2's Russian Hill tour cartridge, I set about constructing my own in a similar style. The key part of the program is a series of nested scripts for each zone that display a message about the zone and increase a variable by one; once the variable equals the total number of zones, it will trigger a congratulatory message with the location of a special cache and log. The design of the script allows the tour to be taken in any order as long as all areas are visited, which I liked, but the problem is that it took me a while to piece the code together for one location, and I have a good deal more to go. Is there a source code screen that I could copy-and-paste on, and then simply change the display text as needed, or should I get to work on the Builder? Quote Link to comment
Ranger Fox Posted February 24, 2008 Share Posted February 24, 2008 You can open the source code's .lua file directly in any text editor, such as notepad. You can do the copy and pasting from them. Just look for your object names or what you put in message boxes. That'll tell you where the code you want is. Quote Link to comment
+Morgue Posted February 25, 2008 Share Posted February 25, 2008 Learned about editting the lua file from Jeremy at the Wherigo / Colorado event at the Chicago Garmin store on Saturday. That technique makes development so much FASTER! Cool event! Thanks to Garmin and Groundspeak! Just wanted to add that editting the file works great, but make a backup before starting.... EACH CHANGE. I added a lot of modifications and then could not figure out what I did wrong, so I had to go back to a much earlier version and start over. Good lesson, but a bit painful. With that said, editting the lua is definitely the way to go! Quote Link to comment
+MountainRacer Posted February 25, 2008 Author Share Posted February 25, 2008 Learned about editting the lua file from Jeremy at the Wherigo / Colorado event at the Chicago Garmin store on Saturday. That technique makes development so much FASTER! Cool event! Thanks to Garmin and Groundspeak! Just wanted to add that editting the file works great, but make a backup before starting.... EACH CHANGE. I added a lot of modifications and then could not figure out what I did wrong, so I had to go back to a much earlier version and start over. Good lesson, but a bit painful. With that said, editting the lua is definitely the way to go! Thanks! You do mean editing the code directly, like in Notepad as suggested by RF, right? I took a look at it and chickened out, and finished my first cartridge in the Builder, but I guess I'll have to get comfortable coding LUA sooner or later if Wherigo is the Groundspeak wave of the future. Even in the Builder, though, as soon as I finished setting the actions and variables for each zone event, I saved the file and then backed it up to a flash drive in case the one on my C:\ drive got corrupted again. It only takes one lost project to make you really paranoid. Quote Link to comment
+frigschneck Posted February 25, 2008 Share Posted February 25, 2008 I regard the builder rather as a tool for creating and editing objects, while the actual coding imho is much more efficiently done in the editor. The builder teaches you how to do what, though. Looking at it this way, it would seem to me a good idea to include the possibility for manual editing of the code in the builder (without the need to switch to an external application like notepad). This would help a lot to keep your code version consistent. Currently this is only offered when a parse error occurs. Usually, these parse errors happen when you manually added stuff which is "too fancy" for the builder. It shouldn't show up as an error. Quote Link to comment
Ranger Fox Posted February 25, 2008 Share Posted February 25, 2008 Here's another technique I use when experimenting with code: I have the lua file open in both notepad and the builder at the same time. I do a little editing in notepad, save the file, then Alt+tab to the builder. From there, I Alt+F and 1 to reload the file. If it reads, my changes were syntactically correct. If I need to go further, I can elect to compile the cartridge. Constantly saving and opening the code file is a good way to check your code and guard against syntax errors. Quote Link to comment
+benh57 Posted February 26, 2008 Share Posted February 26, 2008 Here's another technique I use when experimenting with code: I have the lua file open in both notepad and the builder at the same time. I do a little editing in notepad, save the file, then Alt+tab to the builder. From there, I Alt+F and 1 to reload the file. If it reads, my changes were syntactically correct. If I need to go further, I can elect to compile the cartridge. Constantly saving and opening the code file is a good way to check your code and guard against syntax errors. If you are dorectly editing lua, then you should do it using a programmer's editor which supports syntax highlighting, rather than notepad. That will automatically tell you when you have a syntax error. (you notice when all the syntax highlighting messes up A wide selection of lua editors are available: http://www.wowwiki.com/Lua_editors -Ben Quote Link to comment
+frigschneck Posted February 26, 2008 Share Posted February 26, 2008 A wide selection of lua editors are available: http://www.wowwiki.com/Lua_editors Thanks for this info! So, why not integrate such an editor in the builder ?!? Quote Link to comment
Recommended Posts
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.