Okay, so as you may know, I created a super awesome lighting engine.
As you may not know, I have no idea how to handle tiles with code.My current way to put a background and foreground into the room is create them both with tiles separately and save them as a huge image and put it in the game. As you can imagine, this is retarded.The reason for this is, the view isn't actually a view. Instead of the view looking at different parts of an image, the image just draws itself at different parts depending on where the view is. Poly taught me that crazy technique, but I don't think he uses tiles.I don't know if I can use tiles with this system, though, which sucks.I want to just place tiles by hand in the room editor. But in order to do this I'll have to alter my drawing script to: 1. Hide all tiles (because otherwise they'll draw weirdly on top of the surface.) 2. Draw all tiles at depth 1 onto a surface, with an offset of -view_xview, -view_yview. *My current script goes here 3. Draw all tiles at depth -1 onto the surface with the same offset.Basically, I'm asking if anyone knows how to draw all tiles at a certain depth onto a surface like a background.Plox, guys, I really need help here.
For loops are not elitism. Either way, I wasn't being elitist in the slightest. If anything, I have to hand it to GM for allowing people to make games without first understanding these concepts.
I said nothing about not using GM, too. My most recent blog post, though a bit hard on GML, gave some tips for using GML in a way focused on creating abstractions, which is important in large projects.Nah, sorry man. I've just seen a lot of people move on up the ladder and that's great for them. But when they sit there and bash the gateway tools and software, it feels a bit odd. That's great that you have a knowledge of programming, but there's no need to shove it in peoples' faces when most people really don't care as much as you do.
I wasn't talking about the for loops, really, mostly your (and many other peoples') constant attitude that GM sucks (not saying it doesn't, but I don't rant about every reason it's a terrible tool). It works great for what it does, and while it may not be the most optimized program, it's still capable of some impressive things. But you're not the only person I'm talking about on this subject.I wouldn't have developed an interest in game design if I hadn't used GM. I owe it that much and I think fondly of it for that reason.You're not really my target so much as all the incessant people I've seen complaining about GM. You just reminded me of it. Also, programmers in general are elitist. Just saying.GM does what I want it to, usually, fairly well.
I don't really need a better tool, considering I just make shitty freeware as a hobby; GM is essentially perfect for my ends.I'm not too too interested in coding, but I figure picking up knowledge of it won't hurt.Hokay, let's get this back on topic.
Okay total necro post but I'm back on this again. I have kind of a plan to use for loops at the beginning of room creation to find the tiles on each depth. The thing is, I'd need two for loops to get the x and y for one or more function. I'm not sure this is possible though. Is there any way to structure a for loop to give me two results at once?
I think this is what you are asking for?
You can do that? Put for statements in for statements? I didn't know if that'd like… blow something up or not.
I'll give it a try.EDIT: It didn't work at all, but I blame the tile_add function. I did find a way to do this however, it involves making an object at a draw depth 1 more than the tiles and having it set the surface target. A clever idea I found while Googling the problem. So this problem has been solved, thank god.For for loops, having one loop inside another loop is called NESTING them. It's vital to do anything complex (like cycling thru a 2-D grid of values). You can also have multiple with(){} loops in each other, as long as you keep track of what you're doing and who is OTHER from the perspective of the current loop. And of course you can mix for/with nesting.
As for Pirate-Rob's code, I'd do this instead of save some CPU: