home *** CD-ROM | disk | FTP | other *** search
/ Action Ware 12: Heretic & Hexen / actionware12.iso / acware12 / utility / wauthor / default.acs < prev    next >
Text File  |  1995-12-18  |  2KB  |  62 lines

  1.  
  2. // When WadAuthor finds no script code, it reads this 
  3. // default script code from the DEFAULT.ACS file in 
  4. // the WadAuthor directory.  For information about 
  5. // programming scripts, please refer to the official 
  6. // Hexen specifications.
  7.  
  8. #include "common.acs"
  9.  
  10. // This script supplies the glass-shattering effect
  11. // used throughout Hexen.  To use it, perform the
  12. // following steps.
  13.  
  14. // 1) Create a sector on the map adjacent to another
  15. //    sector but with a higher floor.  Make sure the
  16. //    linedef below textures look like stained glass,
  17. //    and make sure the main textures look like
  18. //    broken glass.
  19. //
  20. // 2) Create four map spots just in front of the sector.
  21. //    Give two one tag number, and give the others another
  22. //    tag number.  Make their height halfway between
  23. //    floor and ceiling.
  24. //
  25. // 3) Set the stained-glass linedef type to ACS_Execute
  26. //    this script, passing it the tag of the sector you
  27. //    created in step one along with the tag numbers of
  28. //    the things you created.  Make sure the activation
  29. //    code is set to trigger when hit by a projectile.
  30.  
  31. script 1 ( int iSector, int iThingTag1, int iThingTag2 )
  32. {
  33.     int i;    // local loop control variable
  34.  
  35.     // Lower the sector's floor; this exposes a
  36.     // different texture to the player, making it
  37.     // appear the glass has shattered.  Play the
  38.     // shattering sound at the thing locations
  39.     // given by the first tag.
  40.  
  41.     Floor_LowerInstant( iSector, 0, 16 );
  42.     Thingsound( iThingTag1, "GlassShatter", 127 );
  43.     delay(const: 1);
  44.  
  45.     // Create twenty shards of glass at the thing
  46.     // locations given by the thing tags, heading in
  47.     // different directions at different rates.
  48.  
  49.     i = 10;
  50.     while ( i-- > 0 )
  51.     {
  52.         Thing_ProjectileGravity( iThingTag1,
  53.         random( T_STAINEDGLASS1, T_STAINEDGLASS0 ),
  54.             random( 0, 255 ), random( 10, 40 ),
  55.             random( 5,20 ) );
  56.         Thing_ProjectileGravity( iThingTag2,
  57.             random( T_STAINEDGLASS1, T_STAINEDGLASS0 ),
  58.             random( 0, 255 ), random( 10, 40 ),
  59.             random( 5,20 ) );
  60.     }
  61. }
  62.