Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

is there some way to view and move assets inside a codea project?

ipad Files app can't look inside a codea project. (i vaguely recall this is because codea projects aren't quite folders?) anyway, is there some way to view and move them with Files that i've missed?

thanks!

Comments

  • dave1707dave1707 Mod
    Posts: 8,781

    Are you asking if you can view a Codea project from the Files app or looking at Codea files, png, mtl, obj, etc. In the Files app, if you long press on something you get a popup with several options.

  • Posts: 825

    i have found no way in Files, to drill into a Codea project and see its assets. Nor any other way to see the assets of a Codea project, in Files.

  • dave1707dave1707 Mod
    Posts: 8,781

    Are you looking for something that will give you a list of all the assets in all of your projects.

  • Posts: 825

    no, i want to browse them with Files app, and do all the stuff Files app is good for. i know how to write a file browser and here in the 21st century don't think i should have to.

  • dave1707dave1707 Mod
    edited January 16 Posts: 8,781

    If you want the Files app to do all those things, this sure isn’t the place to ask for it. You can try sending your Files requests to Apple, but don’t hold your breath. Apple does what they want, with no regards to anything you want. You could probably write your own before you get any changes like that from Apple.

    PS. I’m not saying Apple will never do what you request. A long time ago, I sent a request to Apple to put the day and date at the top of the screen next to the time. I explained why I wanted it and why I thought it would be a good idea. An iOS release or two later, there it was.

  • Posts: 825

    my point is, codea is set up so that files can't see inside projects, despite that projects are basically folders. or, there might be some way to look in that i'm not aware of.

  • dave1707dave1707 Mod
    edited January 16 Posts: 8,781

    @RonJeffries I’m not sure if this explains anything, but from the Files app Codea folder, I can share a Codea project with the app I have called iZip. From iZip I can look at the contents of the files for that project. Depending on the project, there’s multiple tab files and plist. There might be other files depending on what’s in a more complex Codea project. So if the Files app can share those files, they’re contents are available. Maybe Files doesn’t know how to open them by their file type extensions.

    PS. It let me look a png files, and obj files. Trying to find other projects that have other files in it.

  • edited January 17 Posts: 1,958

    Hi Guys - just another idea - I think you can export a Codea zip file to a PC or Mac, then extract that and edit the files within it. Then re-zip and transfer to downloads on the iPad. From there I think you can reinstall into Codea by selecting and sharing with Codea. Messy but could get the job done. Seem to remember doing something similar to add graphics to Codea projects in the ‘Old Days’.

  • Posts: 23

    @RonJeffries The way I open files within a Codea file is by first downloading an app called Documents which you can download by using this link here: https://apps.apple.com/us/app/documents-by-readdle/id364901807

    After downloading and setting up the app, all you need to do is open the files app, allow it to see the documents app files, look for the .Codea file that you want to open, and move it to documents. Once it’s in documents just rename the file and remove the .Codea file extension, when that’s done you should see it as a folder which you can open and see all the lua, sound, image, and music files you have in that project.

    When you are done dragging and dropping files, just rename it again and add the .Codea file extension, long tap it, and share it back to Codea.

    Hope it helps!

  • Posts: 825

    @joaquin thanks ... not what i'd call safe or convenient.

  • Posts: 825

    folks, i understand all these around the horn ways of doing it. i want codea to make its projects legal folders so it can work natively.

  • JohnJohn Admin Mod
    Posts: 643

    @RonJeffries I can understand the frustration involved with managing assets within a project as I run into this problem a bit too when making my own projects.

    One of the main problems is that we adopted Apple's document model for projects, making our .codea format a bundle. A bundle in iOS is simply a folder with an extension, however this also means that it becomes opaque to the Files app which then treats it as a single file for all intents and purposes. This means we have to hand code all file management UI in some way that lets you copy/paste, insert/delete, rearrange, rename, drag/drop, etc. I think the actual solution to this problem is to add support for folders as projects or something similar so that we get all the functionality of the Files app without reinventing the wheel.

    There is also the asset browser which you can access whenever tapping on an asset bubble in function that takes an asset, which lets you delete and move assets, but only supports adding images I think. This is a bit of a holdover from when there wasn't anything like the Files app or drag and drop, so most people just used dropbox or made a custom project to transfer stuff.

    @simeon is working on a much improved UI for managing assets, which will have a sidebar allowing for much more control

  • Posts: 825

    thanks ... i look forward to the new stuff. just spent like four hours renaming and moving a tile set.

  • Posts: 1,958
    @RonJeffries - two things - don't you use any Cloud storage? and have you thought of using a Sprite sheet?
  • Posts: 1,958
    @RonJeffries - another thought, I have used tables for assets in a project save purely to link for dependencies. If done properly you can reduce the number of edits, for instance you can set up a path to a folder then move or rename the folder but have just one edit in the path.
  • Posts: 825

    Don't use cloud storage for this. How might it help?

    A sprite sheet could be a good idea, but in fact the stuff I have is separate tiles.

    I don't understand the tables, link for dependencies, etc. A few more words, or an example, would get it across.

    Thanks,

    R

  • edited January 23 Posts: 1,958

    @RonJeffries - simple little demo here with a list of sprites (if used often could be in a dependency). A mapped sprite list by number pointed to by path. I tend to use Dropbox to hold the sprites just to minimise my memory usage on the iPad - plus it’s backed up and, at the level I use it, free.

    A sprite sheet is ideal for this as you strip them out and put them in array - so can be accessed by an index. Also an a sprite array makes displaying subsets easier, further changing a sprite in the array amounts to just replacing the sprite number in the array and doesn’t need further management to maintain it’ state.

    -- listing sprites demo
    
    function setup()
        —
        gridX,gridY = 20,20
        spSize = 32
        top =gridY*spSize+250
        map = {
                1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,2,2,2,3,3,3,3,3,3,3,2,3,3,3,3,3,3,1,
                1,3,2,2,3,3,3,3,2,2,2,3,3,2,2,2,2,3,3,1,
                1,3,2,2,2,2,3,2,3,3,3,2,3,2,3,3,3,2,3,1,
                1,3,2,2,3,2,3,2,3,3,3,2,3,2,3,3,3,2,3,1,
                1,3,2,2,3,2,3,2,3,3,3,2,3,2,3,3,3,2,3,1,
                1,3,2,2,3,2,3,2,3,3,3,2,3,2,3,3,3,2,3,1,
                1,3,2,2,3,2,3,3,2,2,2,3,3,2,3,3,3,2,3,1,
                1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
                1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
                }
    
        path = asset.builtin.UI
        tile = {
                "Blue_Button_08",
                "Blue_Button_01",
                "Blue_Button_06"
                }
    end
    
    function draw()
        background(40, 40, 50)
        for y = gridY,1,-1 do
            for x = 1, gridX do
                z = map[(y-1)*gridX+x]
                tl = map[z]
                sprite(path[tile[z]],48+x*spSize,top-y*spSize,spSize,spSize)
            end
        end
    end
    
  • Posts: 825

    i think of a sprite sheet as a single graphics file with lots of images in it. i don't see a decent way in codea to display a chunk of an image. could copy them but wha??

  • Posts: 1,958
    @RonJeffries - you need to know the location of each of the images on a Sprite sheet and the size. Can be found by trial and error.
    Then you use image:copy() to copy a section of the sheet. Check it out in the reference.
    I have a sheet with about 140 sprites on it with a large map to build up a viewing window so you can scroll it.

    Have you looked at any of the free Sprite sheets on the net. They may be better than the in-house Codea graphics. They also provide animation capabilities.
  • Posts: 825

    yes, i get the image copy idea. don't see any advantage over separate sprites if you have them. and yes, i'm checking out avail sprite stuff.

  • Posts: 1,958
    @RonJeffries - I just prefer to load a single file, not multiple files which give you the mess in the filing system and the pain of going through the asset load system for each one. Once setup for a Sprite sheet you can forget it.
  • Posts: 825

    yes, i can see it would cut down the asset pile. i'll try a sprite sheet if i get a chance.

  • Posts: 1,958

    @RonJeffries - on another front I have been following your Dungeon programming and noticed you have introduced new sprites. They really lift the appearance of the project. Can I make a suggestion - the new sprites highlight exits/entrances much better. I find that displaying a rectangle of sprites could save room beyond the central area - extending the passages complicates the screen. Filling in the ‘external areas’ with soil/Earth/stone I find presents a better effect. Something like a 11/7 width to height. Worth a look.

  • Posts: 825

    The passages extend when your view allows you to see part way down them. I've seen games where you just see the room or hallway you're in. I'm trying going another way, to see what happens.

    I'm glad you're following along. That makes maybe five people. :)

    Thanks!

  • Posts: 825

    Mind you, I'm not totally sure quite what your suggestion is. Have you a screen shot of a game that does as you suggest?

  • Posts: 1,958

    @RonJeffries - this is an old game I remember from my Amiga days. The central screen holds the game position, surrounded by controls and artwork. In this case it’s just a room but movement of the character scrolls the background leaving the main character in the centre, viewed in this case from above. So you see corridors, doors and objects as the character ‘moves’.

  • Posts: 825

    so as applied to my game, are you saying you'd prefer a simple rectangle all the time?

  • Posts: 1,958
    @RonJeffries - hmmm, in a word yes. But, that is my vision of where you are going. Not yours or that of your Zoom Crowd. I'm just an observer trying to learn and throw in the occasional crumb.

    I was on your wavelength when you were working on Space Invaders and Asteroids - Classics. But I am not that familiar with the early adventure style games - I don't know what the 'remit' is for your group here so I fire in ideas taken from my own Classic adventures.

    I think a simple rectangle with graphics of the sort you have introduced together with a small rectangular map (including just the surrounding area not the whole map) would be more interesting. But, as I say, just my own view from what I have seen.
  • edited January 25 Posts: 1,958
    @RonJeffries - Oh, another thought. In your approach there is only one level. Each time you run the game it is new. So one element of adventures is not included - that of progress. Putting levels behind you that you have satisfactorily completed. Half of the enjoyment in these kind of games is dialog with other users on how you got past a particular stage - ever played Tomb Raider. In cases like that the levels are fixed, the obstacles may differ slightly and each level is scattered with foes, energy boost, keys and puzzles. The whole package is what makes it buzz!!!
  • Posts: 825

    Hi ... somewhere deep in the 74 articles so far, I mention that we need to do levels. I doubt that I'd ever do fixed ones, those are mostly just work with little learning, from a programming viewpoint.

    As for the remit ... I'm just having fun, following my nose and showing what programming is like for me, someone who has done it for years, hoping to draw a few lessons.

    Today, I'm going to create some new loot. And I think I'll discuss an interesting problem for a game being built like this one. But I never know for sure what I'll do on a given day. :)

    Thanks for following along and I sincerely appreciate your comments. They will guide me even if I don't do exactly what you—or anyone—says.

    :)

    R

  • Posts: 1,958
    @RonJeffries - Picking up on your thoughts on where to place entrance and exit positions - you could introduce doors/gates. You could conceivably place the hero in the next room to the exit/end bad guy. To get there the hero has to find the appropriate key. Which means tramping thought the maze to find keys (for other doors) power ups and loot. But this could be a major issue in programming - where to place all the objects. Glad I'm not programming this - your expertise needed there I think!
  • Posts: 825

    yes, those are issues, and one of the oddities is that my maze can have double width or wider hallways, making doors ... interesting.

  • Posts: 1,958

    @RonJeffries - yes, I’ve noticed many of your rooms have multiple entrances/exits. So you would probably need coloured gates and colour coded keys.

    This all adds to the complexity of the maze and challenges other than bash the baddies - also making it more addictive.

    Also, after expiring, it means the enthusiastic hero has to go back to the beginning of the level and start again. So you need to consider saved game/level with points other things to consider are boosting the hero with enhanced weapons, health and invulnerability spells/elixirs etc. But that’s a long way yet. Are these in your overall plan?

  • Posts: 825

    Yes, we'll want to do something about the permadeath thing, although in the original rogue like games permadeath is a thing. I don't care for it though.

    In the past couple of articles I started some simple loot, providing strength, health, and speed. Playing with those today, I was too powerful, could kick any monster's tail. So I think some power-ups need to decline fairly rapidly.

    The possibilities are endless. I'm not here to build a game, but to explore what happens when you build a game, so I'm sure to skip over some boring bits. :)

Sign In or Register to comment.