Page 1 of 1
How to reposition textures?
Posted: March 19th, 2011, 11:56 pm
by Skaggz
Hi there. I've been playing around with PAS for about two weeks now and I am really enjoying it. I do have a couple of questions though.
1.
How can I reposition a texture? I found the following command:
Code: Select all
texoffset X Y
Offsets the current texture slot by X and Y texels along the X and Y axes of the texture respectively.
It is possible to enter this on the command line during editing, or do I have to enter it into the .cfg file (if so, where)? Exactly how big is a "texel"? Could someone please give me an example.
Figured it out.
2. Every time I add new custom textures do I always have to add "exec packages/mytextures/packages.cfg" to my
mapname-art.cfg file?
3. I was able to get animated textures working correctly, well sort of. I have the script written in my
mapname.cfg file, but it seems that my
mapname-art.cfg file gets rewritten after I do some editing that is not associated with the animated texture. It seems to duplicate some of the "texanimadd" lines. This is causing the animation to jump around. How can I stop this from happening? Hope that was clear enough.
4. I can hold R and rotate a map model on its Y-axis. Is there a way to rotate it on its X-axis?
Thanks in advance.
Re: How to reposition textures?
Posted: March 24th, 2011, 8:00 pm
by CyberxNeku
2. No, you can add in a new texture straight to your mapname-art.cfg, just write its required code below the last texture slot
Code: Select all
setshader bumpspecmapparallaxworld
setshaderparam "specscale" 1.000000 1.000000 1.000000 0.000000
texture 0 "torley\glass\semutta.png" 0 0 0 1.000000 // 459
texture n "torley\glass\semutta_n.png"
texture s "torley\glass\semutta_s.png"
texture z "torley\glass\semutta_z.png"
setshader bumpspecmapparallaxworld
texture 0 "mytex\cheese_d.jpg"
texture n "mytex\cheese_n.jpg"
texture s "mytex\cheese_s.jpg"
texture z "mytex\cheese_z.jpg"
I think the torley\glass\semutta texture is the last texture listed in a default new map. The cheese texture was added below that. The 4 numbers after the diffuse layer of the texture (texture 0) and its slot is written after saving your map with the new texture. So you don't have to add in all that yourself.
3. You can add in texture animations either in your mapname-art.cfg or the mapname.cfg. When you first put in the textureanim codes in the mapname.cfg file it writes it in your mapname-art.cfg after saving. I had the same problem where it kept adding in texture slots every time i saved. To fix this, delete all the
extra frames in your art.cfg then delete all the "texanimadd X Y", "texanimdelay X Z", and "texaniminit X" but keep the "texanimstart X" in your mapname.cfg.
4. I really wish you could rotate a mapmodel on its X-axis in game, but i don't think you can o.o There is a way you can do it though. Find the models folder in packages/models/ect.. and open up its md2 cfg file (may also be md3 or md5) at the bottom of the code add in "mdlpitch X" where X is the rotation on the X-axis in degrees. Heres an example of the switch mapmodel turned 90 degres
Code: Select all
md2anim trigger 0 35 35
mdlcollide 0
mdlspec 100
mdlpitch 90
even though the model was exported as an md2, it can use mdl commands. A good reference for these types of commands are here
http://sauerbraten.org/docs/models.html
Hope i was able to answer your questions ^-^
Re: How to reposition textures?
Posted: March 24th, 2011, 8:07 pm
by CyberxNeku
Oh yah, I forgot to ask O.O I havent played around with texoffset yet. So what are texels? are they like pixels? Do u have to write the code after every texture layer? (ie. texture 0, texture n, texture s, texture z) or does it go at the bottom of the all of that?
Re: How to reposition textures?
Posted: March 25th, 2011, 10:35 am
by arcones
4. To answer your question, you can't rotate mapmodels on the x-axis unless it has been specifically modeled that way. You can import it to Blender to change it, and then re-import it to Sandbox. But you'd most likely not be able to use the y-axis then.
@Cyberx, please refrain from double-posting as this is considered minor spamming. If you'd like to add something please edit your previous post.
Re: How to reposition textures?
Posted: March 28th, 2011, 8:14 pm
by Skaggz
Hi, thanks for the responses.
Cyberx,
I didn't actually use the texoffset command. I just edited the modifiers where the texture is declared in the mapname-art.cfg file. Say you have:
The first zero is the rotation.
The second and third zeros are the X and Y offset, respectively
And the fourth modifier is the scale.
And yes, it appears that is texel can be considered to be a pixel for all intensive purposes. So any multiple of 16 can be used (if you want the texture to be able to start on the smallest size box). It took some playing around with to get it right, but since you can edit the .cfg file on the fly using F6 it wasn't really a hassle. By the way, it works for anytime you used a texture on that slot. So if you are using that particular texture anywhere else and you don't want it modified, make a new slot for it.
Here is where I figured it out at.
Re: How to reposition textures?
Posted: March 29th, 2011, 12:55 am
by CyberxNeku
You're welcome Skaggs XD and thanks for the info on texoffset. I always thought that a grid 0 square was equal to an 8x8 pixel image O.O
and sorry about that arcones, I'm new to the forums and actually didn't know I could edit a post after submitting ^^'