+charlenni Posted February 11, 2009 Share Posted February 11, 2009 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 Quote Link to comment
Ranger Fox Posted February 17, 2009 Share Posted February 17, 2009 When testing one of my scripts, I decided to try including it with the "require" keyword. While it worked in the emulator, it caused the cartridge to crash in the Garmin (Colorado) Player. I'd warn against using "require" based on that experience. Quote Link to comment
+charlenni Posted February 17, 2009 Author Share Posted February 17, 2009 When testing one of my scripts, I decided to try including it with the "require" keyword. While it worked in the emulator, it caused the cartridge to crash in the Garmin (Colorado) Player. I'd warn against using "require" based on that experience. That's right. I have made the same experience. But if you use "require" while creating the cartridge you get fast and clear code. If you are ready, you could copy the code from required files to your cartridge. Quote Link to comment
+SecretSquirrel-BJC Posted May 29, 2009 Share Posted May 29, 2009 That's right. I have made the same experience. But if you use "require" while creating the cartridge you get fast and clear code. If you are ready, you could copy the code from required files to your cartridge. I agree - next time I will go this route for development - less time looking for the typo bugs I just introduced and then put it all in one big file when ready to publish to public. 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.