Texture Spawning ?

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
Kalti
Major
Posts: 325
Joined: Sun Mar 16, 2003 11:46 am
Contact:

Texture Spawning ?

Post 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 ?
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

You cannot spawn a texture :cry: , but you can spawn a brush with a texture and make it hide while another brush w/ a different texture appear :wink: ! If you know how to spawn brushes, you're on the way :D !
Image
User avatar
Kalti
Major
Posts: 325
Joined: Sun Mar 16, 2003 11:46 am
Contact:

Post 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 ?
Image
User avatar
Kalti
Major
Posts: 325
Joined: Sun Mar 16, 2003 11:46 am
Contact:

Post 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 ?
Image
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post 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? :wink:
Image
User avatar
Kalti
Major
Posts: 325
Joined: Sun Mar 16, 2003 11:46 am
Contact:

Post 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" ?
Image
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post 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.
Image
User avatar
Kalti
Major
Posts: 325
Joined: Sun Mar 16, 2003 11:46 am
Contact:

Post 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...
Image
User avatar
Kalti
Major
Posts: 325
Joined: Sun Mar 16, 2003 11:46 am
Contact:

Post by Kalti »

Just a thought... how does a 'blood-mod' spawn it's textures...
Image
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

it re-does the white "pft thing" if u will whne a player gets hit.
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post 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.
Image
User avatar
Kalti
Major
Posts: 325
Joined: Sun Mar 16, 2003 11:46 am
Contact:

Post 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...
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post 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 :idea:
Image
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post 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.
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

since models can be spawned via script u dont u make one with the required texture then spawn it?
Image
Post Reply