Is there an easy way to shift all the textures and sprites in a map by 6000 tiles.
What I mean is like if a wall is using tile 3000 then it will be changed too 9000.Or if a sprite was tile 144 then it would be 6144.
I need it to do that for all the textures and sprites for some maps except the SE and other effect sprites.
Page 1 of 1
Shifting textures and sprites to different tiles "Is there an easy way to shift all the textures and sprites in a map by"
#1 Posted 15 December 2017 - 12:21 PM
This post has been edited by -=SomeThingEviL=-: 15 December 2017 - 12:23 PM
#3 Posted 15 December 2017 - 12:41 PM
Put this in a file called "mycode.m32":
Open the console in Mapster32 and enter:
This doesn't cover any more complicated effects like RESPAWN sprites but hopefully this gives you the framework to write any additional code you need.
gamevar i 0 0 gamevar offset 6000 0 defstate movetiles for i allsprites { add sprite[i].picnum offset } for i allsectors { add sector[i].floorpicnum offset add sector[i].ceilingpicnum offset } for i allwalls { add wall[i].picnum offset add wall[i].overpicnum offset } ends
Open the console in Mapster32 and enter:
include mycode do state movetiles
This doesn't cover any more complicated effects like RESPAWN sprites but hopefully this gives you the framework to write any additional code you need.
#5 Posted 15 December 2017 - 01:47 PM
Am I getting senile or am I remembering correctly that I read some years ago about tiles 6100-6200 said reserved for something and not to use them?
Maybe it was for a custom project I helped with and the author marked them as reserved. Either way, I have never tried using that range since.
Maybe it was for a custom project I helped with and the author marked them as reserved. Either way, I have never tried using that range since.
#6 Posted 15 December 2017 - 01:59 PM
That worked and every tile is moved by 6000. But now I need to make it so the few I did not want to move are fixed.
So I need code to just move the few I need moved back.
If I replace allsprites with just the tile number I want to effect it dose not work.I tried that first hopping it was just that easy,Nope.
So then I went to http://wiki.eduke32....ds#var_commands and looked and tried to figure it out.But its all over my head, I don't know what i'm looking at or for (it looks too much like real programming,I can figure out con coding and other stuff like that but not real programming)
So I started beating my head against my desk, that did not help.
I suck at programming and can't even figure out how to make it only effect one sprite at a time.
how would I do that?
So I need code to just move the few I need moved back.
If I replace allsprites with just the tile number I want to effect it dose not work.I tried that first hopping it was just that easy,Nope.
So then I went to http://wiki.eduke32....ds#var_commands and looked and tried to figure it out.But its all over my head, I don't know what i'm looking at or for (it looks too much like real programming,I can figure out con coding and other stuff like that but not real programming)
So I started beating my head against my desk, that did not help.
I suck at programming and can't even figure out how to make it only effect one sprite at a time.
how would I do that?
#7 Posted 15 December 2017 - 02:01 PM
You may be right mark, but I just needed to know how to batch move tiles, where there at does not really matter.I too remember reading something like that.I'll make sure not to use any reserved tiles.Thanks for the info/reminder.
#8 Posted 15 December 2017 - 02:07 PM
I took a break from looking through all the projects I worked on. It seems they started back up at 6300. Except for the Decay project that started at 6100. So I guess it may be OK after all. But I know I saw that message about 6100-6200 somewhere. Maybe it was 6000-6100 reserved. I'm confused.
This post has been edited by Mark.: 15 December 2017 - 02:08 PM
#9 Posted 15 December 2017 - 02:14 PM
I'll just skip right too 7000 and not worry about it. But I still need help with making this code only effect one sprite.
I think its this line I need to edit "for i allsprites" but what do I change it too.
gamevar i 0 0
gamevar offset -6000 0
defstate movetiles
for i allsprites
{
add sprite[i].picnum offset
}
ends
I think its this line I need to edit "for i allsprites" but what do I change it too.
gamevar i 0 0
gamevar offset -6000 0
defstate movetiles
for i allsprites
{
add sprite[i].picnum offset
}
ends
This post has been edited by -=SomeThingEviL=-: 15 December 2017 - 02:31 PM
#10 Posted 15 December 2017 - 03:57 PM
I would put conditions in to check before moving.
eg.
here is the list of script commands like ifvarg which is simply "if variable > #"
eg.
for i allsprites { ifvarg sprite[i].picnum 10 { add sprite[i].picnum offset } }
here is the list of script commands like ifvarg which is simply "if variable > #"
#12 Posted 16 December 2017 - 03:32 AM
You can copy a texture to the clipboard with tab.
Then "enter" on each wall to change it to that, or alt-C to change all walls with the similar texture on that wall to the texture in the clipboard.
Usually, that would do the trick, but since you want to move everything in a fixed increment, I suppose you have a fixed tileset that has been offset or something, in which case the script would work better.
But in most circumstances, I the alt-C method is very fast to quickly change the aesthetic of the entire map.
Then "enter" on each wall to change it to that, or alt-C to change all walls with the similar texture on that wall to the texture in the clipboard.
Usually, that would do the trick, but since you want to move everything in a fixed increment, I suppose you have a fixed tileset that has been offset or something, in which case the script would work better.
But in most circumstances, I the alt-C method is very fast to quickly change the aesthetic of the entire map.
Share this topic:
Page 1 of 1