Page 1 of 2
Texture Spawning ?
Posted: Wed Feb 25, 2004 6:10 pm
by Kalti
I would like to spawn a texture, as far as I know it should be possible to spawn a brush with the texture applied... now I know how to spawn a brush but have no clue as to how I should spawn a texture on it...
Anyone ?
Posted: Wed Feb 25, 2004 6:15 pm
by Krane
You cannot spawn a texture

, but you can spawn a brush with a texture and make it hide while another brush w/ a different texture appear

! If you know how to spawn brushes, you're on the way

!
Posted: Wed Feb 25, 2004 6:25 pm
by Kalti
Aha... yeah I know how to spawn a brush', although I'm using "clipbrush"
I was told the brush with texture is probably spawned with one and the same spawn command ?
Posted: Wed Feb 25, 2004 10:43 pm
by Kalti
Btw. I found this:
jv_map wrote:Hmm you can spawn a brush via spawn script_object and then use the setsize command to set its dimensions. Note you can only make axial brushes this way.
I don't know if it's possible but maybe you can assign a texture with the shader or surface commands

(Out of
this thread)
But how do I go about and use these "shader" and/or "surface" commands in conjunction with the brush spawn ?
Posted: Thu Feb 26, 2004 11:50 am
by crunch
Don't quote me on this, I'll deny it....
I'm at work, just getting ready to start the day, so I don't have any reference with me, just going off the top of my head, but perhaps it is possible.
I don't know if the script will load properly, but perhaps you could try
the .map file format.
After
local.yourbrush setsize () ()
you could try to add the texture info.
texturename 0 0 0.00 1 1 0 0 0
Off the top of my head, I think the numbers are h-shift, v-shift, rotation, h-scale, v-scale
But again, I am not sure.
(I guess I should wait until I am home and try it myself.....then come back with a better answer.)
But what is there to lose by trying it? 5 minutes?

Posted: Thu Feb 26, 2004 11:55 am
by Kalti
Thanks Crunch... I tried various script setup's earlier and will fiddle around with your tips...
But what exactly do you mean with ".map file format" ?
Posted: Thu Feb 26, 2004 12:04 pm
by crunch
I meant the .map format for the brush texturing.
So my experiment would be:
local.yourbrush setsize () () texturename 0 0 0.00 1 1 0 0 0
in your script for the brush you are spawning.
Agian, I don't know that it will work, but it's worth a try.
Posted: Thu Feb 26, 2004 2:41 pm
by Kalti
Aha... however I can't get it to work...
I wouldn't call it scripting but i'm using 'standard' spawn commands:
Code: Select all
// Object Spawn Testing
// The Added Models
// Example Clip Brush
//local.clipbrush = spawn script_object
//local.clipbrush.origin = ( -2173.06 927.02 144.13 )
//local.clipbrush setsize ( 0000 0000 0000 ) ( 0000 0000 0000 )
//local.clipbrush.angles = ( 0.0 0.0 0.0 )
//local.clipbrush solid
// Brush & Texture Test
local.clipbrush = spawn script_object
local.clipbrush.origin = ( -453.87 -193.67 432.13 )
local.clipbrush setsize ( -100.00 -100.00 0.00 ) ( 100.00 100.00 50.00 ) misc_outside/nu_grass_set2_sp 0 0 0.00 1 1 0 0 0
local.clipbrush.angles = ( 0.0 86.15 0.0 )
local.clipbrush solid
// BMW Bike
local.model1 = spawn script_model
local.model1 model "vehicles/bmwbike.tik"
local.model1.origin = ( -453.87 -193.67 832.13 )
local.model1.angles = ( 0.0 86.15 0.0 )
local.model1.scale = 1.0
local.model1 solid
The BMW Bike is there to check wether the script loaded properly, it is placed above the clipbrush but not on top of it.
I've also tried:
misc_outside/nu_grass_set2_sp
.tga 0 0 0.00 1 1 0 0 0
texture/misc_outside/nu_grass_set2_sp 0 0 0.00 1 1 0 0 0
texture/misc_outside/nu_grass_set2_sp
.tga 0 0 0.00 1 1 0 0 0
And I've tried it with values entered...
Posted: Thu Feb 26, 2004 11:31 pm
by Kalti
Just a thought... how does a 'blood-mod' spawn it's textures...
Posted: Fri Feb 27, 2004 12:16 am
by omniscient
it re-does the white "pft thing" if u will whne a player gets hit.
Posted: Fri Feb 27, 2004 4:01 am
by Krane
My tip is to create a brush, texture w/ texture1. Copy this brush and place it in the exact same position of brush1, but this brush will have texture2.
Now select only brush1 and right-click on the 2D window and choose script>object. Give it a targetname. Do the same with brush2. Give a different targetname. Now on your script you can use $brush1 hide/show and $brush2 hide/show.
I think the blood mods spawn a little model...When I replace the textures, I can see a "textureless plaque" in the floor where the blood suppose to be.
Posted: Fri Feb 27, 2004 10:57 am
by Kalti
Thanks...
But I'd like to solve this by script.
I noticed the bloodtextures being spawned on a model... but perhaps it's possible to spawn & scale that model onto my spawned brush and apply a texture to the model...
Posted: Sat Feb 28, 2004 1:24 pm
by M&M
i might be wrong but i think krane was talking about doing it by script,he just told u 2 make the texture u want by radient then insert it by script ,at least thats what i understood.anyways,y dont u look at the blood mods script 2 c how they do it

Posted: Sat Feb 28, 2004 5:56 pm
by crunch
Well, Kalti, I tried some experiments of my own, and they failed......
Just when I thought I might have gotten it, it was a no go.
I added these lines to the spawn script, and surprisingly got no script errors, but the texture did not show up:
Code: Select all
local.brush shader vcsp surface textures/vcsp/vc_fog 0 0 0.00 1 1 0 0 0
and
Code: Select all
local.brush shader vcsp
local.brush surface textures/vcsp/vc_fog 0 0 0.00 1 1 0 0 0
The first yielded no script errors at all, but the surface did not render, although the brush spawned.
The second also spawned the brush, but I received a console message:
Code: Select all
script_object::SurfaceCommand : group textures/vcsp/vc_fog not found.
I tried different variations of these with no luck....but at least the absence of errors leads me to believe that it may be possible to get a texture to show up.
Although in all likelihood it's lighting will not match the rest of the map.
If I come up with anything, I'll let you know.
Posted: Sat Feb 28, 2004 6:08 pm
by M&M
since models can be spawned via script u dont u make one with the required texture then spawn it?