Post new topic    
Liquid Metal Slime
Send private message
A code I made for everyone to use! And a question.... 
 PostSat Mar 15, 2014 5:49 pm
Send private message Reply with quote
In a prior thread some time ago, I had discussed whether I could draw my map really large in photoshop, break it down in to 320x240 backgrounds, import those backgrounds, and then use "put slice" to arrange them on my map as maplayer0. Finally, I did just that. Here's the code if anyone want to use it. It can be easily scaled up to any map size by simply adjusting the values in the "for loops"

Code:
Code:
plotscript, Map Auto Run 4, begin

variable(collection, sl, slparent, i, j, slicenum)
collection := load slice collection(0)
slparent := lookup slice(sl:map layer0)
slicenum := 1

for(j, 1, 2) do(
  for(i, 1, 2) do(

     sl := lookup slice(slicenum, collection)
     put slice (sl, ((i--1)*320), ((j--1)*200))
     set parent (sl, slparent)
     slicenum := (slicenum + 1)
  )
)


And here's a screen shot to show off the result. (Note: Resolution has been changed for viewing purposes) Four separate backgrounds can be seen: A, B, C, and D.



Also, I figure a second similar code could be applied to a layer which is above the characters, that way the map could have an overlay. Not only that, but the code could also be changed such that the background layer has no parent, thus the background layer would follow the character as the screen moves. This would be perfect for something like a fog or clouds which are overlaying the map. Something like this could also be animated pretty easily too.

My question: Does anyone think drawing my maps like this will cause me to run in to any problems later in development? I can't foresee any problem thus far. If anything, I find that drawing outside the program would really speed up my process. Drawing unique background layers will also make my maps non-repetitive, which I like.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Metal King Slime
Send private message
Re: A code I made for everyone to use! And a question.... 
 PostSun Mar 16, 2014 1:15 am
Send private message Reply with quote
sheamkennedy wrote:
Not only that, but the code could also be changed such that the background layer has no parent, thus the background layer would follow the character as the screen moves.


A slice always has a parent (unless it's the root slice). The easiest thing to do would be to place the backdrops before the map root slice, so that's it drawn underneath it and isn't affected by the camera. You also would need to make the map layer 0 slice invisible, because it's always opaque. I feel a bit uncomfortable suggesting this though; I think that at one point we wanted to prevent people from doing such things.

Alternatively, use http://rpg.hamsterrepublic.com/ohrrpgce/Scripts:Fake_Parallax (but unfortunately that method will cause the background to jump every time the hero moves).

Quote:
My question: Does anyone think drawing my maps like this will cause me to run in to any problems later in development?


The only problem would be that you can't see what you're doing in the map editor when you try to place NPCs, walls, etc. My solution would be to also import the backdrops as tilesets, and plaster them over the map in the same pattern. To get around the 8 layer/tileset limit, just switch all the tilesets to the correct ones in the Layers menu for the section of the map that you want to edit (that is, just repeat the whole tileset in every 16x10 block, so each 16x10 piece of the map looks identical).
Liquid Metal Slime
Send private message
Re: A code I made for everyone to use! And a question.... 
 PostSun Mar 16, 2014 5:25 pm
Send private message Reply with quote
Thanks. I think I understand everything you said but this:

TMC wrote:
The easiest thing to do would be to place the backdrops before the map root slice, so that's it drawn underneath it and isn't affected by the camera. You also would need to make the map layer 0 slice invisible, because it's always opaque. I feel a bit uncomfortable suggesting this though; I think that at one point we wanted to prevent people from doing such things.


As far as I can tell, the way I have my code currently set up makes the backdrop slices stay in position as the screen moves along with my character. Are you saying that it would be easier to draw the background before the map root slice, and make the map layer 0 slice invisible? I'm not too sure how to do that off hand. If the way I'm currently doing things has no issues, I'd rather stick with that since I have a decent understanding of how the code works and how to manipulate it.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Metal King Slime
Send private message
 
 PostMon Mar 17, 2014 4:47 am
Send private message Reply with quote
Oh, opps, I was thinking of putting parallax layers behind the map layers, but you were taling about putting them on top of the map layers. Putting them on top is very easy: as you said, you don't need to change the parent from the default one ("script layer").
Liquid Metal Slime
Send private message
 
 PostMon Mar 17, 2014 5:08 am
Send private message Reply with quote
Alrighty
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Display posts from previous: