Monday, February 20, 2012

CSS empty div collapses

Problem: A div with a width but no content is collapsing (not visible)
Solution: Either put an &nbsp character, or explicitly set a div height

Sunday, February 5, 2012

CS:S map making with Hammer editor

  • Valve's definitive guide is here.
  • A nice set of tutorials here.
  • Entity guide
  • Navigation point helper guide.

CT/T spawn
  1. Insert entities "info_player_counterterrorist" or "info_player_terrorist". 
  2. The number of entities you place is the max number of player spawn
  3. Valve suggests about 20 points per team 128 units apart
Placing lights
  • Do this in the end - debugging is harder with all those fancy lights
  • Make sure they are not recessed into ceilings/walls - use the 3D camera view to place light.
  • Do not name lights (if you do you should know what you are doing).
Buy Zones/Bomb plant zones
  1. Select tools/toolstrigger for texture, make a block with this texture where you want the buy zone. 
  2. Click "toEntity", select "func_buyzone" from the dropdown list. 
  3. Set the appropriate team name from the drop down.
For bomb zones, do the same first step, then select "func_bomb".  

Texture one face of a solid
  1. Press shift + A to bring up texture application tool 
  2. Select your texture and click on the surface you want textured
Making ramps
  1. Select the object
  2. Use the vertex tool to move the sides as needed
  1. Select entity
  2. Select prop_dynamic, prop_static or prop_physics depending on the model you want
  3. When you select the model verify on the "info" tab that it's type is the same as the entity.
  4. Mismatch between the model type and prop type will cause the model not to appear on the map
The way sounds work is that there are triggers (env_soundscape) that start the playing of a sound when a player gets within their radius and has line of sight with them. The sound then keeps playing for ever (for that player) until the player trips a different soundscape. The way to set up soundscapes, then, is to set them at doorways and other entrance/exits. 
  • soundscape descriptions
  • List of CS:S soundscapes 
  1. Only edit the mesh once you are done laying out the map
  2. Load the map in CS:S, go into spectate and bring up the console
  3. sv_cheats 1
  4. nav_edit 1 (to see the mesh)  
  5. Usually upstairs areas only connected by ladders/ramps/stairs will not be connected by the automatically generated mesh
  6. Go to the highest navigable point, point at a spot and type nav_make_walkable. A blue pyramid will appear
  7. Go to each ladder in turn, point to it and type nav_make_ladder
  8. Now type nav_generate to regenerate the mesh. The top walkable should propagate everywhere
  9. Sometimes some ledges may not be included in the jump calculations: you can forcibly join the ledge: point at the top part, type nav_mark, then point at the landing point and then type nav_connect.
  10. Type nav_save to save the mesh  
Follow instructions here.

Type your intro text into a text file. Name the text file as map_name.txt (map_name being your exact map name) and save it in the same directory as the map file.

Debugging tips
  • sv_cheats 1
  • mat_wireframe 1
  • cl_leveloverview 8 (or whatever scale factor works)
  • nav_edit 1 (To see nav meshes, helpful to see jumps etc.)
  • mat_fullbright 1 (To remove lighting and see everything) 
  • compile with "rad" set to "no" - faster compilation with no lightmaps
Misc stuff
  • Night Vision does not amplify red
  • Grouping lights lets you change their properties together

Friday, February 3, 2012

Python : struct.upack format data justification

While reading data from a binary data file, when mixing data formats with different lengths (e.g. 'h' and 'f') python will assume the file has pad bytes that align all the data.

Use the '=' qualifier to prevent weird justification.

Mac OS Lion PPoE bug

  1. In system preferences->Network create a new PPoE connection. Check "show modem status in menu bar"
  2. A symbol "<...>" appears in the menu bar
  3. Delete the PPoE connection
  4. The symbol remains in the menu bar and it is not possible to remove it until ...
  5. ... you create a new PPoE connection, uncheck "show modem status..." and then delete it