GuestBook

    : Disclaimer :

    * This information will be most beneficial for RTCW mappers... I owe a lot to the people at Tram Design and shaderlab/quake3world. Be sure to check out their sites (links page), they have the real substance. As well, I give reference to many web resources... namely the Tram resource page! Good work guys!!  Most sites listed below usually have even more tutorials to look over... These are, more or less, my scattered notes - as I’ve picked them up.

    ** Many of the tips won’t work with a stock GTK q3map engine. I recommend using a front end compiler like q3map2build, in addition to the latest q3map2 engine (developed by ydnar). As the benefits outwiegh the negatives, you definately should be using q3map2.  www.shaderlab.com

    *** I have done my best to give credit where credit is due. Even beyond that, if there is an error or omission, please let me know.

    **** I won’t be held liable for any damage caused to your machine as a result of following these tutorials.  While that shouldn’t be the case, as in all things, use at your own discretion.

     

 

    :-: ACCUMS :-:

  • From the scripting definitions doc: "Accum is used for 'what if' statements. Accums store integers which are used to trigger scripts."
    There are two things you can do with Accums. One is to give them a numerical value, the other is to use their current value to decide if a script should run.
  • If you don’t understand scripting at all, you will need to read up on some scripting tutorials, which isn't really my bag.  However, I can tell you that accums are commonly used for script_movers and/or objectives that need updating (i.e. to prevent them from firing repeatedly).
  • Generally speaking, set your accum to 1 0 at the beginning of your script; saying it is off.  Then, in the objective, or script_mover part of the script, you set accum 1 1. meaning, its now on.  Accums are also needed to end an objective map - to update the game globally. Something like this:
  • trigger checkgame
    {
    accum 1 abort_if_not_equal 1

    wm_setwinner 1

    wait 1000

    wm_endround
    }

    If accum is not on 1 1, then don't end the match.
    There is a lot more to be aware of when working with accums, especially when you get into complex elevator scripts or scripted movers.  But generally speaking, the accums you'll see in the
    mp_beach, and mp_base scripts, will cover most of what you need. 

    Also, accums are not always needed, so before you go building your script, riddled with hasty calls to the engine, be sure they are needed first. More on that later...  :)~

    :-: return to top :-:
     

     

    :-: AREAPORTALS :-:

    Tutorial By: tunnleram
    Go Here

  • Must go inside func_door and func_door_rotating entities to work.
  • Must not touch the void.
  • Must be used in a contained room.
  • (This means if you have four solid walls; with one door, and that door has an areaportal, then you shouldn't have a problem. However if you add a window to the room then it wouldn't be contained any longer, and the areaportal won't be sealing the room and won't work in the process.)

    * additional notes *
    I'm sure you're wondering whether or not they can be using in entities other than func_door and func_door_rotating. As far as I know they can't. It seems that other entities such as func_explosive and script_movers aren't able to turn the areaportal off.

  • Containing an areaportal means that it must be contained within a building, usually through a series of hallways.  A contained room is a room that is not drawn from an “outside,” or common area of your map.
  • Areaportal’s can only be used in a few scenarios. In the end I haven’t used them often for the same reasons Tunnleram sited... Multiplayer is typically better without func_doors to begin with. The few real doors that you might have in a map, probably aren’t contained anyways...
  • oh well.

    :-: return to top :-:

    :-: Bumpmapping, How to :-:

    Posted By: Ydnar, Omnix, demonspawn, chavo one & shadowspawn

    “All you have to do is take an image (TGA works best) that is a "standard" RGB encoded normalmap, and add the following to your shader:
    q3map_normalimage path/to/image.tga
    It will be spread across the surface with the same mapping as the surface's texture. For high-resolution lightmaps, I'd recommend using a fine-detail normalmap, and for lightmapped terrain, use a large, blurry normalmap.
    The normalmap is currently just point-sampled. I may add bilinear filtering to it later on. First I have to make it work correctly (the bumpmap orientation is usually wrong, giving false lighting direction).  This grayscale heightmap:

    Generates:

    Example shader:
    textures/rad/conc_1
    {
          q3map_normalimage textures/rad/normal1.tga
         
          {
                map $lightmap
          }
          {
                map textures/rad/conc_1.tga
                blendFunc GL_DST_COLOR GL_ZERO
          }
    }

    * This requires a Photoshop plug-in called normalmapfilter. Your shader is going to be a q3map_normalimage used to display the texture properly. You can get the plug in here.

    Omnix test shader:

    textures/omnix_bump/testbump
    {
    q3map_normalimage textures/omnix_bump/testbump.tga
    {
    map $lightmap
    }
    {
    map textures/omnix_bump/testbump2.tga
    blendFunc GL_DST_COLOR GL_ZERO
    }
    }

    ** You will need this Photoshop 7 Targa fix - Download here. (Note: The Photoshop 7.0.1 update contains all functionality included in this revised Targa plug-in)

    This will allow you to create alpha channels which are needed for bumpmaps as well as almost every really cool texture you want to create....Now that you can create the correct alpha channels, you’re set.

  • Step #1
    Make your texture and name it brick_wall_base.tga
    save it, no alpha channel is need for this pass and this image can be a jpg but I wouldn't.
  • Step #2
    Take brick_wall_base and use the filter "photocopy" to make is a stark grayscale image...photocopy gives very few shades of gray so you get a well defined grayscale image. Select the black portions of the image and make that your alpha channel.
  • Step #3
    Select all 4 channels (RGB and alpha) make sure they are all selected and open the NVIDIA bumpmap filter. You should receive no errors...if your alpha isn't there it will give an error stating that.
  • In the NVIDIA filter play with the different settings but these are best:
    Height generation of 5X5 with a scale of 15...the higher the scale the deeper the bump.
    Height source of either depending on how the image/alpha was created but both works.
    Alpha field of height

  • Step #4
    save the image as brick_wall_bump.tga with 32 bit. Image size is important so make sure it is large enough to get a well defined image.
  • Step #5
    The shader has to be told to use the bump. it should look like this

    textures/mymap/brick_wall
    {
    qer_editorimage textures/mymap/brick_wall.tga
    q3map_lightmapsamplesize 1x1
    q3map_normalimage textures/mymap/brick_wall_bump.tga
    {
    map $lightmap
    }
  • :-: return to top :-:

     

    :-: Compiling Breakdown :-:

    Posted By: TiCal / modified by me.

    * The following descriptions are written largely for q3map2.

  • BSP Stage- necessary obviously - Using q3map2 you can add -meta and -patchmeta. It will generally speed up your Bsp and Vis stage.
  • VIS Stage- this is what you need to use on a final compile - it effectively blocks areas that the player can't see when in game according to how you have set up structural brushes and hints
  • Using q3map2, Vis switches aren't needed or even recommended besides  -saveprt.

    Vis -Fast - this option does a vis of your map - basically all it does it make some lightmaps so you could compile light. It will not process all your areas correctly so you will have higher r_Speeds than normal, Vis already compiles fairly fast, using -vis -fast is not recommended.

    Vis -Vlight - this is a bogus option with q3map 2.0+ it really just does a -light -fast

    Vis -Saveprt - saves the .prt file generated; you can view this portal file in gtk's portal viewer.

  • Light Stage-  is a full light compile and shows you how things will look when you are done but it will have rough edged shadows, depending on the switches you use..
  • -light - fast - Using q3map2 enables -fastbound -fastgrid and -fast, on some maps it can speed up light calculations by 50 times.

    -light -super 2 - Replaces -extra and -extrawide. From what i hear Super is even being phased out with the newer q3map2 engines as the code gets better..

    -light -filter - gives you Gaussian blur for 3x3 shadows and box filtering, in some cases can cause errors with terrain shadowing..

    -light -patchshadows - enables the casting of light by patches..

    -light -bounce x - This enables radiosity calculation, effective with terrain lightmapping. this will significantly add to your compile time and is recommended for final compiles.

    -light -thresh 1 - Sets the recursive triangle subdivision. default is 1, from what I understand its used with alpha textures..

  • For fast compiles, I typically use:
  • bsp -meta -patchmeta -vis -saveprt -light -fast -patchshadows

  • For full Compiles, I use:
  • bsp -meta -patchmeta -vis -saveprt -light -fast -super 2 -patchshadows -bounce 8

    :-: return to top :-:

     

    :-: Coronas, Multiple uses :-:

    Posted By: shLep & Demonspawn

  • First of all, coronas like most entities can be triggered on and off via script. This needless to say is neat for any effects you may want to trigger.
  • An example; a factory is blown up, triggering a few coronas to be turned on near some light textures I have in place (the textures themselves have no light property).  And when the light is triggered, the light gives a new glowing effect. Furthermore, using func_static, you can swap out “off” textures with “on” textures, to further enhance the effect.

    Example:

    trigger objective2

              {

                       //  -factory mainframe blown up

                       wm_set_objective_status              2        1

                       wm_announce "The Factory Mainframe Has Been Destroyed!!!"

                       // turn on the emergency light coronas. Red

                       alertentity obj2_corona_lights

                       trigger game_manager checkgame

              }

    Also, though I don’t have the exact writing, demonspawn posted that coronas can also move like any other script_mover. Treat it exactly like one.  Assign the targetname to the corona, and make some path_corner's, script it, and your good to go! Lights for moving vehicles! Yay!

    Dlights are also mobile, but personally; I stay away from them as they act very strangely. In someone else’s words - they work like a vampire; without any light to draw from they produce no light! Weak!  Additionally, any surrounding (normal) lights will take on the same properties as the dlight, be it flashing or whatever... So, I am not a fan of them.

    :-: return to top :-:

     

    :-: Elevators, Multi-Floor :-:

    Posted By: Paposo

    To create a multi floor elevator, you can set a single variable such as accum 1. You use bitset with accum 1. Each bit is a floor. So bit 1 of accum 1 is equal to floor 1. Bit 2 is floor 2 etc. That way you can determine which floor the elevator is on.

    So if the elevator is on floor 3 say "accum 1 bitset 3". This sets the bit at position 3 to "true" for the variable accum 1. When the elevator leaves floor 3 you say "accum 1 bitreset 3" This now clears the bit at position 3 so it is now "false". Using this 1 variable you are now able to determine which floor an elevator is on.

    Now to determine what floor the door should open on, for instance, you would write a series of functions: trigger floor1 open, trigger floor2 open, etc. At each trigger the first line is now "accum 1 abort_if_not_bitset x" where x is equal to the floor the function is set for. So, if your function is for the doors opening on the 9th floor you would write as the first line "accum 1 abort_if_not_bitset 9".

    This allows you to create a single variable which controls all the elevator functions without writing a bunch of scripts for each button. It also avoids scripting conflicts where people are pushing the same buttons simultaneously or such.
    Very cool huh...

    * I’ve read many a tutorial on this, and many people have different ways of going about this. This is simply one of the easier explanations I’ve come across to help me explain it, and that is the ultimate goal here...

    :-: return to top :-:

     

    :-: Fog Maps, max VIS, no HOM :-:

  • Posted By: ydnar

F

    “Added _foghull worldspawn key. Use in conjunction with "_farplanedist" to set up fogged maps with max visibility distance and no HOM.
    The last screenshot demonstrates a normal skybox as the foghull.
    Also in is q3map_normalmap support for bumpmapping of lightmaps. Use with lightmapped terrain or high-res lightmaps for best results.
    Note this version will generate larger visdata on certain maps. This is because the BSP is split on BLOCKSIZE in Z as well as X and Y. This is to make the far plane culling more effective.”

    textures/shaderlab_foghull/fog_black
    {
           qer_trans 0.75
          
           surfaceparm nolightmap
           surfaceparm nonsolid
           surfaceparm noimpact
           surfaceparm trans
           surfaceparm fog        // !!FOG!!
          
           fogparms ( 0.0 0.0
    }

     

    :-: Heightmap In, Terrain Out :-:

    By: TanyaCheex
    I have nothing further too add, on what is already a great tutorial, so just go
    here.

    :-: return to top :-:

     

    :-: Lightning Bolts :-:

    By: Demoneye
    And the same goes for this tutorial, a great example using scripts and textures for dynamic effect.  Enjoy!
    Tutorial

    :-: return to top :-:

 

    :-: Models, Useful Tips :-:

  • Posted by: demonspawn
    “To Fully Clip your Models, Highlight the model and set the following;
    •        key: spawnflags
    •        value: 2
    This makes the model fully clipped, so you don’t have to spend all that time with clip brushes, clipping off models. However, I wouldn’t use this on overly-complicated models...” as it’s clipping it within the engine the same way brushes would, but more precise. So don’t bog it down with intense geometry.
  • Posted by: ydnar
    “Entities do not cast shadows. Entities with "model2" models will never receive shadows because they are only referenced in-game, hence "rgbGen lightingDiffuse." This means they use the lightgrid to determine their coarse ambient + directed illumination.
  • You should also remove the lightmap stage from the first shader. Lightmaps do not apply to MD3 models, especially dynamic (model2) models.
  • Also, add "surfaceparm pointlight" or "nolightmap" to all of your shaders.”
  • More updated tidbits soon..
     

    :-: return to top :-:

     

    :-: Pitch Yaw and Angle :-:

    In scripting, mainly with script_movers, you need to know the faceangles... Which are, you guessed it?
    Yaw effect Z axis
    Pitch affects the X axis
    Roll affects the Y axis
     

    :-: return to top :-:

     

    :-: Player Dimensions :-:

    Player Dimensions
    Player height = 73 map units.
    Player width = 37 map units.
    Min crawl height = 49 map units.
    Also the doors in beach are 112h x 64w x 4d, might be an idea to stick to these to get the correct sense of scale.
    Max jump height = 62 units
    Max step height = 17 units

    :-: return to top :-:

     

    :-: Portals and Blocksize :-:

    Tutorial By: BoltyBoy

    Read This.
     

    :-: return to top :-:

     

    :-: Removing Hints from Entities :-:

    Posted By: Tunnleram
    In most entities you can set this:
    key: cursorhint
    value: hint_none
    You can also set the cursorhint to whatever you want. You can find the listing of them all in the func_invisible_user entity.
    I like to use the hint_none on things like windows and boards that I want to be breakable, but I don't want the player to realize it. It makes things a lot more realistic.

    :-: return to top :-:

     

    :-: Roq Video and In Game Videos :-:

    By: Hewster
    Go
    Here.

    By far the easiest explanation I’ve come across, I’ve even used programs that are supposed to whip these files out! Never worked. Thx a lot Hews!
    Additionally, I picked this up somewhere, not sure where...
    Make a texture within the game & play your .roq movie!
    textures/mytextures/my_roq
    {
    qer_editorimage textures/mytextures/mytexture.tga
    {
    videomap video/my_roq.roq
    First you make a texture; I used black (64x64)
    Stick it in textures/my_textures
    Then make a shader for it, stick it in scripts...
    Get or make a .roq. Put it in the video folder in your .pk3.
    Apply your texture to a brush face.
    Compile, and test her out!
    Be sure to include the texture folder for the final .pk3
    ~~~~
    and, philby added this...
    I would have used a flickering texture for the effect.
    Like this animation:
    textures/philby/tv1
    {
    qer_editorimage textures/philby/tv1.tga
    {
    animap 4 textures/philby/tv1.tga textures/philby/tv2.tga textures/philby/tv3.tga
    blendFunc Gl_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
    rgbgen identify
    ]
    ]

    2 methods for having a video in your map! Although I think you can do more with the .roq
    As a final note, you can only have 1 .roq per map. You CAN play 1 .roq video both in the objective overview screen, and “in-game” at the same time, but indeed through my own tests, only 1 given .roq to a map regardless of their subsequent name /folder convention.
     

    :-: return to top :-:

     

    :-: Script Mover Events/ Scripting :-:

    This very much is contributed by tram, namely when I was on my search for flying planes that could randomly spawn, fly, assault and explode into buildings causing further flamed, smoky structural carnage. And yes, complete with sound time lined out.
    Yea all that good stuff. But all from a script_mover? I thought they were limited. Boy was I wrong!
    Indeed, a large portion of any action you want to happen can be controlled within the script, i.e. you don’t have to somehow link everything up within the editor on funky timers ... well at least not for the purpose of this next brief tutorial.
    As it turns out, demonspawn or was it demoneye? Anyways, his version is just very clean and to the point, so i’ll show that one. Now it really depends on what you want out of your script_mover, do you want similar to what I listed? explosions and events to happen while your said vehicle is in motion? Or is it more of a drawn out timeline with various seemingly unrelated entities to be fired? Things to think about...
    Anyways, the ideas are simple
    Basic script_mover script;
    ///Moving scripted stuff goes here...............................
    flying   //script_mover **flying plane
    {
             spawn
             {
             wait 800
             trigger flying fly
             }
     
             trigger fly
             {
             gotomarker patha 300 wait  // flying
             faceangles 0 200 0 gototime
             gotomarker pathb 300 wait  // impact area -final
             faceangles 0 200 0 gototime
             trigger
    crashed debris
             }
    }
    crashed // spawns script_mover crashed plane
    {
             spawn
             {
             }
             trigger debris
             {
             alertentity crashed  // triggers smoke
             alertentity kill_flying  // remove original script_mover plane, via target_kill
             faceangles 110 150 120 1000  //final position/angle of crashed script_mover
             }
    }
    Crashed is highlighted because it is worth note. The crashed plane script_mover is labeled crashed within gtk, in addition, so are the effects entities, such as smoke and debris. This is one of the main things demoneye impressed on me... Entities can have the same targetname or scriptname if they are indeed to be fired simultaneously. Helps cut down on some confusion... Play around with it; you’ll see what I mean.
    script_movers can trigger more script_movers within its own script. And since it is then put on a timeline, events and other things can be arranged through uses of func_static’s, target_smoke and target_effects, etc... They can be triggered from a func_explosive in game, or from another part of the script, or simply on a timer as the one above is.  To sum it up, it’s left to your imagination...
     

    :-: return to top :-:

     

    :-: Sparklies Bad :-:

    Posted By: Hummer
    Now, I thought that to get rid of Sparklies around a square mesh, you have must have only one brush one each side of the mesh, that takes up the whole side of the mesh exactly.

    Apparently, this is wrong. So, I cut the brush into triangles. Each triangle's vertex meets a vertex of the mesh. That didn't work either.

    Basically, my problem is, I have something like a crater in the ground that is a mesh. Except the edges are Sparklies....ARGH!

    And some sidewalks have Sparklies, and some don't, although their construction is identical...
    Other things I've tried:
    q3map_nonplanar in the shader... someone suggested this to me that didn't work...
    making the entire mesh + brushes surrounding a func_group... that didn't work either :/
    However, I know why there are errors... they're just T-junction errors. Like, the edge of a mesh triangle meets with a vertex of a brush... which forms a T. That's what causes the Sparklies.
    Just flip on r_showtris around offending Sparklies to see what I mean.
    The triangles that meet will form what is called a T-Junction...
    Like: |- instead of |_

    EDIT: Here we go... got it working;

  • This is where we start. Basically, a mesh, with caulk brushes on all sides that run the length of the mesh. Get your clipper ready! Time to make some triangles...
     


    Basically, you're going to be cutting triangles from the corner of your caulk boxes, to the mesh lines of the mesh. Above is an example of what it should look like.

     

    :-: Staff Car Model Fix :-:

    Posted By: Demoneye
    All you've got to do is copy mercedes_1.tga to mercedes_1v.tga and use staff_car_v.md3, and put a nice repeating glass texture into glass2.tga to get a working windscreen.  All in models/mapobjects/vehicles...

    :-: return to top :-:

     

    :-: Tags on Models :-:

    By: nib & demoneye
    The models have "tags" built into them and you attach the secondary models to these "tags". For example, in a truck you might have 4 tags, one for each wheel (left_front, right_front, left_rear, right_rear). Then, with your tire model, you would use the targetname of "left front" and when the game ran, it would "attach" the tire model's origin to the truck model where the "left_front" tag was.

    Basically, you have to just know what the tags are and, moreover, unless you make your own model, you have no control over where the tags are located. A good example I've got is putting some small lantern models (models/mapobjects/light/lantern.md3) that I want to sit on a rotating railway turntable script_mover.

    I have a "target" of "turntable" on the misc_model entity, and a "targetname" of "turntable" on the script_mover. The models are now attached to the script_mover. They will stay on the script_mover in the same position as you place them relative to the origin of the script_mover.                                                        -d

     

    :-: return to top :-:

     

    :-: Useful Console Commands :-:

    Some Content Taken From Tram Resource Page
    r_lightmap 0/1 (strips shader layers and only draws lightmap - can be useful for seeing where you have lighting errors or just not enough light being cast)
    r_showtris 0/1 (draws a wireframe version of all visible brushes - very useful for finding T Junctions and other brush errors)
    r_speeds 0/1 (repeatedly echoes a few performance related stats to the console until you turn it off - the most important one being the Tris value at the end)
    r_lockpvs 0/1 (locks your visibility at your current location, enabling you to /noclip around the map to get a better idea of what you can actually see from that position)
    r_drawworld 0/1 (can be useful if you have entity problems - turns off the world, leaving the game entities (doors, func_explosive, etc))
    r_drawentities 0/1 (opposite of above - may help finding vis problems)
    r_novis 0/1 (turns off vising, letting you see the entire map)
    r_clear 0/1 (setting this to 1 clears the frame buffer each frame, leaving a pink background which can be useful for finding brush errors or cracks in surfaces)
    g_synchronousClients 1
    cl_avidemo 15 (or 30)
    demo demoname (including the .dm_60 extension)
    cl_wavefilerecord 1

    :-: return to top :-:

     

    :-: Waterfalls :-:

    Posted by: demonspawn
    The downwards water flow is created by adjusting the "tcmod scroll" and the foam is adjusted by a combination of the lake shaders chop and the foam shaders chop or "deformVertexes" the texture for the foam has a wave displacement built into it.
    **my comments**
    It is apparent, to make a waterfall as part of the background, it’s much easier to manage as opposed to one a player can interact with. Especially if you want to make it look really nice. I was interested in this subject, but never got around to making one.. but they certainly can be done.. I recommend using a patch mesh if its to be a waterfall in the background.

    :-: return to top :-:

     

    :-: Waterfogvars, Fogvar and Skyfogvars :-:

    Waterfogvars, Fogvar and Skyfogvars
    Posted By: demonspawn, omnix and rummie
    fogvars ( .16 .15 .15 ) .0005
    skyfogvars ( .23 .23 .24 ) .2
     

    -demonspawn
    The numbers in brackets are the RGB values of the fog or the color.
    I believe that the different types of fog represent the different styles of fog.

  • Waterfog is more conducive to how a fog could add to the underwater fogging effect. More of an area fog.
  • Skyfogvar would allow for patches of fog to move through the scene.
  • Fogvar represents a fog that you would walk through; it just covers the ground and can/will disperse when walked through.
    Remember that fogs are calculated by a single direction, or the direction which it is entered.
    Some of this may be fact...then again maybe my guess is a bit off.
    The skyfogvars seem to be RTCW related and seems to not work like the waterfogvars.... I am guessing this is because the q3map does not support it. You can change it. Here is a sample fog I did that will fog the whole level.
    textures/omnix_fogsky/awsome_fog
    {
    qer_editorimage textures/skies/sky_m01dmcmp
    surfaceparm noimpact
    surfaceparm nolightmap
    surfaceparm sky
    q3map_globaltexture
    q3map_lightsubdivide 1024
    q3map_sun 0.274632 0.274632 0.358662 25 325 35
    q3map_surfacelight 90
    skyparms full 200 -
    fogvars ( .30 .31 .39 ) 1500
    {
    map textures/skies/sky_m01dmcmp.tga
    blendfunc GL_ONE GL_ONE
    tcMod scale 12.0 12.0
    }
    }
    fogvars..... (Color of fog) distance fog is culled.
    -omnix32w
    ---
    RGB values - Red Green Blue. Any color can be defined by these channels. Normally in every application but the Quake 3 engines, these are represented by a number from 0 to 255. In Quake 3 games they are 0 to 1, with 1 being equivalent to 255. The lowest number 0,0,0 is black. The highest number 255,255,255 is white.
    So let’s say you make a nice color in Photoshop that you want your fog to be tinted. Simply get the RGB color numbers and divide each one by 255 to get your Quake 3 equivalent color.
    So if I wanted some freaky green fog based on RGB (112, 239, 118) I would do this:
    112/255 = .4392
    239/255 = .9372
    118/255 = .4627
    So the value for my fog is:
    fogvars (0.4392, 0.9372, 0.4627) 2500
    And that will get you some nasty looking soupy green fog.
    -Rummie
     

    :-: return to top :-: