textures n triggers

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
UZZIEL
Corporal
Posts: 39
Joined: Tue Apr 29, 2003 6:47 pm

textures n triggers

Post by UZZIEL »

HI!

Is ist possible to change textures of brushes by using a trigger?
If it is - then how?

thx

ps.
Sorry if this is a thread for mapping since i dont know how to solve my prob i just decided to post it at "Scripting" :oops:
If you grab in toilets don´t wonder that your hands are brown.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yes it is possible if your shader has the fromEntity keyword. There's even an example here: http://www.ritualistic.com/games/fakk2/ ... anual.html

Look right at the very bottom of the document.
Image
User avatar
UZZIEL
Corporal
Posts: 39
Joined: Tue Apr 29, 2003 6:47 pm

Post by UZZIEL »

thx

i try to look through :P
If you grab in toilets don´t wonder that your hands are brown.
User avatar
UZZIEL
Corporal
Posts: 39
Joined: Tue Apr 29, 2003 6:47 pm

chinese :?:

Post by UZZIEL »

some questions:

1. what is a B-Model
2. whats ment by <fromEntity> -> where/ how to use it
3. if there is fromENTITY then a entity has to be used for this?

Practically:

I build up a brush called "box" - > give it a texture called "face1"
->some values must be set equal with that texture "face1"

i build up a trigger reacting at bullets "boxtrigger"
-> the trigger is informed about that value and changes it at hit to the next one

i hit that trigger -> the texture on the box changes to "face2"
-> the trigger changes the value of "face1" to the value of "face2"

if i hit again it changes to "face3" and so on...

hmh

with that example i didnt understood much - only that there are some commands/keys reacting with shaders. (maybe a language prob)
If you grab in toilets don´t wonder that your hands are brown.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Movie shader

Post by tltrude »

I don't know if this will help, but it is an example of a texture changing brush. Make a shader using the below text and apply the texture it to a worldspawn brush. After you compile, test the map and you will see the movie (slideshow) playing on the brush.


Code: Select all

textures/custom/my_movie
{
	qer_editorimage textures/mohmenu/briefing/briefing3a.tga
	qer_keyword special
	nomipmaps 
	nopicmip 
	cull none 
	surfaceparm carpet
	surfacelight 2000 
	{ 
		animMap .15 textures/mohmenu/briefing/briefing3a.tga textures/mohmenu/briefing/bootcamp.tga textures/mohmenu/briefing/airborne.tga textures/mohmenu/briefing/bombers.tga textures/mohmenu/briefing/portphoto.tga textures/mohmenu/briefing/invasionfleet.tga textures/mohmenu/briefing/shoreguns.tga textures/mohmenu/briefing/convoy.tga textures/mohmenu/briefing/battleship.tga textures/mohmenu/briefing/higginsboat.tga textures/mohmenu/briefing/depot.tga textures/mohmenu/briefing/omahalanding.tga textures/mohmenu/briefing/defeat.tga textures/mohmenu/briefing/mannon.tga
		rgbgen global 
		blendFunc GL_DST_COLOR GL_ZERO 
	}
	{
		animmap .15 textures/mohmenu/briefing/briefing3a.tga textures/mohmenu/briefing/bootcamp.tga textures/mohmenu/briefing/airborne.tga textures/mohmenu/briefing/bombers.tga textures/mohmenu/briefing/portphoto.tga textures/mohmenu/briefing/invasionfleet.tga textures/mohmenu/briefing/shoreguns.tga textures/mohmenu/briefing/convoy.tga textures/mohmenu/briefing/battleship.tga textures/mohmenu/briefing/higginsboat.tga textures/mohmenu/briefing/depot.tga textures/mohmenu/briefing/omahalanding.tga textures/mohmenu/briefing/defeat.tga textures/mohmenu/briefing/mannon.tga
		rgbgen identity
		blendfunc GL_ONE GL_ONE
	}
}
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well you'll need frameFromEntity in this case, but I'm not sure if mohaa actually supports this. The keyword should be placed in the animMap stage.

Example:

Code: Select all

textures/custom/my_movie
{
   {
      animMap .15 textures/mohmenu/briefing/briefing3a.tga textures/mohmenu/briefing/bootcamp.tga 
      frameFromEntity
   }
} 
Then in your script type something like this:

Code: Select all

$trigger waittill trigger
$box shader frame 2 // switch to next frame
Image
User avatar
UZZIEL
Corporal
Posts: 39
Joined: Tue Apr 29, 2003 6:47 pm

hmh

Post by UZZIEL »

I tried it with other textures on a smoll tryout box.
the only thing happenz is a gray square with a yellowgreen frame ?!?

hmh
whats wrong??

thx
If you grab in toilets don´t wonder that your hands are brown.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

it means:

1)there's no texture
2)shader is wrong
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

The console will tell you what's wrong (look just below cm_loadmap).
Image
User avatar
UZZIEL
Corporal
Posts: 39
Joined: Tue Apr 29, 2003 6:47 pm

Post by UZZIEL »

it shows it doesnt know command "framefromentity" i used your example.
Maybe it needs some additions?
when i remove it alls ok but not triggerable anymore :)

hmh

maybe only useable for quake not in mohaa?
If you grab in toilets don´t wonder that your hands are brown.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Only usuable in FAKK2 I think :(

Quake doesn't have a scripting language ;)
Image
User avatar
UZZIEL
Corporal
Posts: 39
Joined: Tue Apr 29, 2003 6:47 pm

Post by UZZIEL »

k thx Dr. JV

- how is it used for flags?

there is a map i think push city hall?!? where the flags at triggerin change their colour/sign -> texture? . Is this only reserved for flags or global usable anywhere ? - when its possible plzzzzz tell me how.

Im standing still at one point with my map its some kinda frustrating.

I could also use multiplesided circle with different textures which turns one side up/down each time the trigger is used - but this seems
a little bit unprofessional i think.
If you grab in toilets don´t wonder that your hands are brown.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Maybe they removed the flag and spawned a different flag model instead?

You could also try a dynamic light :?
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

UZZIEL, u're chinese?
Live to map, not map to live.
-mohaa_rox, .map
moderator
User avatar
UZZIEL
Corporal
Posts: 39
Joined: Tue Apr 29, 2003 6:47 pm

Post by UZZIEL »

ahahahaha
rox
ahahahaha :D

no im german/polish

can speak both perfect - but english abut 50%
so sorry but thats the way to learn it for me
If you grab in toilets don´t wonder that your hands are brown.
Post Reply