Duke4.net Forums: Shifting textures and sprites to different tiles - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Shifting textures and sprites to different tiles  "Is there an easy way to shift all the textures and sprites in a map by"

#1

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.

This post has been edited by -=SomeThingEviL=-: 15 December 2017 - 12:23 PM

0

User is offline   Kyanos 

#2

Yes, Mapsters m32 script will do this easily.

Look at the wiki for help or read a.m32 in the samples folder.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #3

Put this in a file called "mycode.m32":

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.
2

#4

THANKS!!!!!!!!!!
0

User is offline   Mark 

#5

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.
0

#6

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?
0

#7

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.
0

User is offline   Mark 

#8

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. :D

This post has been edited by Mark.: 15 December 2017 - 02:08 PM

0

#9

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

This post has been edited by -=SomeThingEviL=-: 15 December 2017 - 02:31 PM

0

User is offline   Kyanos 

#10

I would put conditions in to check before moving.

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 > #"
0

#11

Yes thank you. That will do.
0

User is offline   BestViking 

#12

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options