Jump to content

Script Copying


MountainRacer

Recommended Posts

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?

Link to comment

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!

Link to comment

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

Link to comment

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.

Link to comment

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.

Link to comment

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

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