Data application folder
Monkey Forums/Monkey Beginners/Data application folder
| ||
Hi maybe I missed something, but at the end I decided to put my request here in the beginner thread. When I code I usually make several copies of my source code (ie: test1, test2 and so on) for each revision - so I can get back if something goes wrong. I found very annoying (to use a kindly word) renaming each time my test.data folder. Take for example 'MatchUp' in the banana folders: I changed the main file (matchup.monkey) in test_matchup.monkey to make some changes to study the source code. If I run (HTML5) I have only errors in output (FONT fonts/main.txt WAS NOT FOUND!!! Monkey Runtime Error : TypeError: Cannot read property 'p_Width' of null) Of course I know the reason of the error... Monkey can't find the right resource. Monkey-Trans creates a new test_matchup.buildv78h, with HTML5 and inside it a 'data' folder (that contains only fonts.png - the 'default' font): nothing else. Question: is there a solution (a CONFIG parameter, a #COMMAND) that can force Monkey/Trans to use a 'data folder' (IE: #RESDATA="data") so we can have more source code and ONE resources data? (maybe there's already a solution, but I didn't find it). Thanks in advance PS: tested with the latest stable version 78H Ps2: I was thinking to change the source code of Transcc/Builder... |
| ||
The data folder must be named after the main project file, for example test-matchup.monkey must have the data folder test-matchup.data. |
| ||
I just use one main project folder, and take backups by creating RAR archives which I then name for each version/revision. I see having my data folder inside every backup as a good thing, as assets can change with each revision and by using a backup I know everything will work if I have to go back to an older version. It may be different if my assets were large in size though. |
| ||
Well, not a great solution to me. I have 95% of the same resources in different data folders... plus the need to rename or copy the data folder. Thanks anyway. |
| ||
Most of the bananas are minuscule by the standards of modern storage, i.e. they copy in seconds and take little space. |
| ||
If you're looking for version control and backups in the long run, on Windows 7 there's "Shadow Copy" (And 8 if you configure it), and for everything else you could use git. I used to do periodic copies (Manually), but once I started using git, there wasn't really a point where I needed to do such a thing again. I think what you want is basically "*.bak" files for your source code, and possibly even your "*.data" folder. For source files, some IDEs do support these backups, but I don't think 'Ted' (Monkey's default IDE) does right now. But for the data folder, to my knowledge, there's no easy way to do something like that without using a good version control system like: git, SVN, or Mercurial. If I were you, I'd look into git, because it tends to be the preferred platform these days. Even Monkey itself uses git (Via github) for its public source code. For a good free (Private) remote-git service, I think you should check out BitBucket. Backing up on a remote server isn't necessary, but it can be very useful (Especially with how secure they tend to be). And wait a minute, if you're doing copies like that, why not do it the other way? Keep your current version as "test.monkey" (For example), and make all backups something like "test_backup_01.monkey", and keep counting up. That would remove the problem all together, wouldn't it? Your data from there could just be "test.data", and you'd never need to change it. Regardless, your best bet is probably something like git. EDIT: Added links. |
| ||
Ok, thanks But just image this situation: I write a program (main.monkey) that use some resources (music, gfx etc). Then I would like to check a specific thing/routine, so I write another program (test_function.monkey) that use the same resources (ie: I'm testing a GUI, so I need to test frequently if everything is going right). I need to have 2 folders: main.data and test_function.data with the same resources in it. I still don't think this is very flexible (and there is nothing about backup). My idea was/is: allow to use a specific data folder (RESDATA) for any program you write: if no #RESDATA is defined, continue with the 'standard' name_app.data behaviour. |
| ||
If that's the case, though it's not a Monkey based solution, here's an old post I made about this, which should help. |
| ||
My idea was/is: allow to use a specific data folder (RESDATA) for any program you write: if no #RESDATA is defined, continue with the 'standard' name_app.data behaviour. I really like your idea. It adds way more flexibility to the data folder. I hope it gets implemented. |
| ||
I've never been keen on the prefix data folder, but I've leant to live with it... I did hack trans a couple of years ago to do away with the prefix, but I stopped adding it in manually ages ago: http://www.monkey-x.com/Community/posts.php?topic=1020 |
| ||
@therevills Ohhh! three years ago! Probably I'm the only one that think this is a problem :P ! I will try your solution: seems perfect! thanks! (I looked for threads about this... maybe I missed your or searched for other words/combination...) |