Author Topic: htf_struct  (Read 3904 times)

0 Members and 1 Guest are viewing this topic.

Offline rainrider

  • Soldier
  • **
  • Posts: 145
    • rrhp
htf_struct
« on: August 14, 2006, 08:00:17 am »

Offline realdeal

  • Major
  • *
  • Posts: 54
  • TEH HAXYEST HAX0RZ EVER TO HAX
Re: htf_struct
« Reply #1 on: August 14, 2006, 08:12:56 am »
Very awsome indeed
looks 3D :D
This is not a sig.

Offline PANZERCATWAGON

  • Camper
  • ***
  • Posts: 261
  • oh god: blowjobs
Re: htf_struct
« Reply #2 on: August 14, 2006, 08:13:13 am »
Oh my god, that must have taken you ages.

Nice work on making it look so spherical, I'm guessing that's what you are going for. Downloading now. Inform you of it's gameplay later. It might be hard for people to tell where they can walk and where they fall down and stuff, but looks good.

[EDIT] This map isn't waypointed, you might wanna put that in your first post. The map certainly looks graphically unique, but it's not a map I would choose to have a htf match on. The only walkable ground is the circle around the outside, which is made up of hurt polygons.

You might want to consider adding some more custom scenery as at the moment it does look quite bland.
« Last Edit: August 14, 2006, 08:20:50 am by PANZERCATWAGON »

Offline rainrider

  • Soldier
  • **
  • Posts: 145
    • rrhp
Re: htf_struct
« Reply #3 on: August 14, 2006, 08:18:59 am »
It taken me only today's morning (it's a php script).

Hope that explains everything.
@realdeal: no.
« Last Edit: August 14, 2006, 08:21:23 am by rainrider »

Offline realdeal

  • Major
  • *
  • Posts: 54
  • TEH HAXYEST HAX0RZ EVER TO HAX
Re: htf_struct
« Reply #4 on: August 14, 2006, 08:20:11 am »
is it waypointed?
This is not a sig.

Offline SadistAtHeart

  • Global Moderator
  • Flagrunner
  • *****
  • Posts: 636
  • golevka
Re: htf_struct
« Reply #5 on: August 14, 2006, 08:38:24 am »
is it waypointed?

Nope.

This map is sexy, rainrider. Psuedo3D-2D <3

Offline Eagles_Arrows

  • Veteran
  • *****
  • Posts: 1889
  • The Thread Killer
    • My Webcomic
Re: htf_struct
« Reply #6 on: August 14, 2006, 08:53:08 am »
lol polygon art.

"Sometimes it's a good day to die, sometimes it's a good day to have breakfast." - Smoke Signals

Offline Bgretydews

  • Flagrunner
  • ****
  • Posts: 805
  • y halo thar rabbit
Re: htf_struct
« Reply #7 on: August 14, 2006, 02:46:08 pm »
Lol i like, I think i'll put this on my server just for choas ;0
http://yossi.jrgp.org/?action=maps&sa=user_maps&u=10
Image (and link) is broken. Feel free to fix it.

Offline rainrider

  • Soldier
  • **
  • Posts: 145
    • rrhp
Re: htf_struct
« Reply #8 on: August 14, 2006, 04:30:01 pm »
It was designed for DM.

Offline The Geologist

  • Inactive Staff
  • Flagrunner
  • *****
  • Posts: 909
Re: htf_struct
« Reply #9 on: August 14, 2006, 04:47:08 pm »
8/10 for design and visual appeal, 0/10 for effort.
With all its sham, drudgery, and broken dreams it is
still a beautiful world.  Strive to be happy.

Offline Bgretydews

  • Flagrunner
  • ****
  • Posts: 805
  • y halo thar rabbit
Re: htf_struct
« Reply #10 on: August 15, 2006, 03:06:56 am »
It was designed for DM.

Lawl, Why is it htf_ then?
http://yossi.jrgp.org/?action=maps&sa=user_maps&u=10
Image (and link) is broken. Feel free to fix it.

Offline Bgretydews

  • Flagrunner
  • ****
  • Posts: 805
  • y halo thar rabbit
Re: htf_struct
« Reply #11 on: August 15, 2006, 06:23:20 am »
Still can be used for htf then :D
http://yossi.jrgp.org/?action=maps&sa=user_maps&u=10
Image (and link) is broken. Feel free to fix it.

Offline numgun

  • Veteran
  • *****
  • Posts: 1032
Re: htf_struct
« Reply #12 on: August 15, 2006, 12:32:07 pm »
Php script? can someone explain me that?

artistic map btw.

Offline Bgretydews

  • Flagrunner
  • ****
  • Posts: 805
  • y halo thar rabbit
Re: htf_struct
« Reply #13 on: August 15, 2006, 01:08:04 pm »
Just be a script that generats the map for him.
http://yossi.jrgp.org/?action=maps&sa=user_maps&u=10
Image (and link) is broken. Feel free to fix it.

Offline numgun

  • Veteran
  • *****
  • Posts: 1032
Re: htf_struct
« Reply #14 on: August 16, 2006, 08:15:27 am »
Huh? how do you do that?
What do I script and where? : X

Offline rainrider

  • Soldier
  • **
  • Posts: 145
    • rrhp
Re: htf_struct
« Reply #15 on: August 16, 2006, 12:36:41 pm »
Code: [Select]
<?
 error_reporting ( E_ALL );
 $poly_types = array (
   "POLY_NORMAL",
   "POLY_ONLY_BULLET_COLLIDES",
   "POLY_ONLY_PLAYER_COLLIDES",
   "POLY_DOES_NOT_COLLIDE",
   "POLY_ICE",
   "POLY_DEADLY",
   "POLY_BLOODY_DEADLY",
   "POLY_HURTS",
   "POLY_REGENERATES",
   "POLY_LAVA" );
 $spawn_types = array (
   "SP_PLAYER",
   "SP_ALPHA",
   "SP_BRAVO",
   "SP_CHARLIE",
   "SP_DELTA",
   "SP_RED_FLAG",
   "SP_BLUE_FLAG",
   "SP_NADEPACK",
   "SP_MEDIKIT",
   "SP_CLUSTERS",
   "SP_VEST",
   "SP_FLAMEGOD",
   "SP_BERSERKER",
   "SP_PREDATOR",
   "SP_YELLOW_FLAG",
   "SP_RAMBO_BOW",
   "SP_STATIONARY_GUN" );
 for ( $i = 0; $i < count ( $poly_types ); $i ++ ) define ( $poly_types [ $i ], $i );
 for ( $i = 0; $i < count ( $spawn_types ); $i ++ ) define ( $spawn_types [ $i ], $i );
 class vertex {
   var $r; var $g; var $b;
   var $x; var $y;
   function vertex ( $_x, $_y, $_r = 0, $_g = 0 , $_b = 0 ) {
     $this -> r = $_r; $this -> g = $_g; $this -> b = $_b;
     $this -> x = $_x; $this -> y = $_y; } }
 class poly {
   var $vertex;
   var $transparent;
   var $type;
   function poly ( $v1, $v2, $v3, $t ) {
     $this -> vertex [ 0 ] = $v1;
     $this -> vertex [ 1 ] = $v2;
     $this -> vertex [ 2 ] = $v3;
     $this -> type = $t; } }
 class spawn {
   var $x;
   var $y;
   var $type;
   function spawn ( $_x, $_y, $_t ) {
     $this -> x = $_x;
     $this -> y = $_y;
     $this -> type = $_t; } }

 $polycount = 0;
 $spawncount = 0;

 function fputc ( $char, $file ) { fwrite ( $file, chr ( $char ), 1 ); }
 function writevertex ( $file, $vertex, $transparent ) {
   fwrite ( $file, pack ( 'f', $vertex -> x ), 4 );
   fwrite ( $file, pack ( 'f', $vertex -> y ), 4 );
   if ( $transparent ) {
     fwrite ( $file, pack ( 'f', 1.0 ), 4 );
     fwrite ( $file, pack ( 'f', 6.861987458251e-7 ), 4 ); }
   else {
     fwrite ( $file, pack ( 'f', 0 ), 4 );
     fwrite ( $file, pack ( 'f', 1 ), 4 ); }
   fputc ( $vertex -> b, $file ); fputc ( $vertex -> g, $file ); fputc ( $vertex -> r, $file ); fputc ( 0xff, $file );
   fwrite ( $file, pack ( 'f', 1.0 ), 4 );
   fwrite ( $file, pack ( 'f', - 1.0 ), 4 ); }

 function writepoly ( $file, $poly ) {
   writevertex ( $file, $poly -> vertex [ 0 ], $poly -> transparent );
   writevertex ( $file, $poly -> vertex [ 1 ], $poly -> transparent );
   writevertex ( $file, $poly -> vertex [ 2 ], $poly -> transparent );
   for ( $i = 0; $i < 36; $i ++ ) fputc ( 0, $file );
   fputc ( $poly -> type, $file ); }

 function makepoly ( $v1, $v2, $v3, $t = POLY_NORMAL ) {
   global $polycount;
   global $polys;
   $polys [ $polycount ++ ] = new poly ( $v1, $v2, $v3, $t ); }

 function writespawn ( $file, $spawn ) {
  fwrite ( $file, pack ( 'i', 0 ), 4 );
  fwrite ( $file, pack ( 'i', $spawn -> x ), 4 );
  fwrite ( $file, pack ( 'i', $spawn -> y ), 4 );
  fwrite ( $file, pack ( 'i', $spawn -> type ), 4 ); }

 function makespawn ( $x, $y, $t ) {
   global $spawncount;
   global $spawns;
   $spawns [ $spawncount ++ ] = new spawn ( $x, $y, $t ); }

 /*
   MAKE POLYGONS, MAP SETTINGS
 */
 $filename = "map.PMS";
 $mapname = "by rr-";
 $texturename = "alpha.png";
 $bkcolor1 = array ( 16, 24, 32 );
 $bkcolor2 = array ( 128, 196, 255 );
 $nades = 2;
 $medikits = 2;
 $weather = 0;
 $steps = 0;
 $mapid = mt_rand ( ) % 1000000;
 $jets = 32766;
 $write = true;
 $image = true;

 $ca = 5.0;
 $xw = 2000.0;
 $xh = 2000.0;
 $bh = $xw / 25.0;
 $s = $xw / 2.0 - ( 2.0 * $bh );
 $x1 = $s;
 $y1 = 0;
 $ch = $cw = 0.2; //shouldnt be modified
 $cx = $cw * 5;
 $cy = $ch * 5;
 for ( $cx = $cw; $cx <= $cw * 5; $cx += $cw )
 for ( $a = - 180.0; $a <= 180.0; $a += $ca ) {
   $l = ( 1.0 - $cx ) * 255 * 2.0 * ( 1.0 - ( abs ( $y1 ) / abs ( $s * sin ( 0.5 * M_PI ) ) ) );
   $d = $l * 0.6;
   $t = $cx == $cw * 5 ? POLY_LAVA : POLY_DOES_NOT_COLLIDE;
   $x2 = $x1; $y2 = $y1;
   $x3 = ( $s + $bh ) * cos ( $a / 180.0 * M_PI ); $y3 = ( $s + $bh ) * sin ( $a / 180.0 * M_PI );
   $x1 = $s * cos ( $a / 180.0 * M_PI ); $y1 = $s * sin ( $a / 180.0 * M_PI );
   makepoly ( new vertex ( $cx * $x1, $cy * $y1, $l, $l, $l ), new vertex ( $cx * $x2, $cy * $y2, $l, $l, $l ), new vertex ( $cx * $x3, $cy * $y3, $d, $d, $d ), $t );
   $sx2 = $s * cos ( $a / 180.0 * M_PI ); $sy2 = $s * sin ( $a / 180.0 * M_PI );
   $sx3 = ( $s + $bh ) * cos ( $a / 180.0 * M_PI ); $sy3 = ( $s + $bh ) * sin ( $a / 180.0 * M_PI );
   $sx1 = ( $s + $bh ) * cos ( ( $a - $ca ) / 180.0 * M_PI ); $sy1 = ( $s + $bh ) * sin ( ( $a - $ca ) / 180.0 * M_PI );
   makepoly ( new vertex ( $cx * $sx1, $cy * $sy1, $d, $d, $d ), new vertex ( $cx * $sx2, $cy * $sy2, $d, $d, $d ), new vertex ( $cx * $sx3, $cy * $sy3, $d, $d, $d ), $t );
   $sx2 = ( $s + $bh ) * cos ( $a / 180.0 * M_PI ); $sy2 = ( $s + $bh ) * sin ( $a / 180.0 * M_PI );
   $sx3 = ( $s + $bh ) * cos ( ( $a - $ca ) / 180.0 * M_PI ); $sy3 = ( $s + $bh ) * sin ( ( $a - $ca ) / 180.0 * M_PI );
   if ( $cx >= $cw * 5 && $a >= - 180 && $a <= - 90  ) makepoly ( new vertex ( - $xw / 2.0, - $xh / 2.0 ), new vertex ( $cx * $sx2, $cy * $sy2 ), new vertex ( $cx * $sx3, $cy * $sy3 ), $t );
   if ( $cx >= $cw * 5 && $a >= - 90  && $a <= - 0   ) makepoly ( new vertex (   $xw / 2.0, - $xh / 2.0 ), new vertex ( $cx * $sx2, $cy * $sy2 ), new vertex ( $cx * $sx3, $cy * $sy3 ), $t );
   if ( $cx >= $cw * 5 && $a >=   0   && $a <=   90  ) makepoly ( new vertex (   $xw / 2.0,   $xh / 2.0 ), new vertex ( $cx * $sx2, $cy * $sy2 ), new vertex ( $cx * $sx3, $cy * $sy3 ), $t );
   if ( $cx >= $cw * 5 && $a >=   90  && $a <=   180 ) makepoly ( new vertex ( - $xw / 2.0,   $xh / 2.0 ), new vertex ( $cx * $sx2, $cy * $sy2 ), new vertex ( $cx * $sx3, $cy * $sy3 ), $t ); }
 $cx = $cw * 5;
 $cy = $ch * 5;
 for ( $cy = $ch; $cy < $ch * 5; $cy += $ch )
 for ( $a = - 180.0; $a <= 180.0; $a += $ca ) {
   $l = ( 1.0 - $cy ) * 255 * 2.0 * ( 1.0 - ( abs ( $x1 ) / abs ( $s * cos ( M_PI ) ) ) );
   $d = $l * 0.6;
   $x2 = $x1; $y2 = $y1;
   $x3 = ( $s + $bh ) * cos ( $a / 180.0 * M_PI ); $y3 = ( $s + $bh ) * sin ( $a / 180.0 * M_PI );
   $x1 = $s * cos ( $a / 180.0 * M_PI ); $y1 = $s * sin ( $a / 180.0 * M_PI );
   makepoly ( new vertex ( $cx * $x1, $cy * $y1, $l, $l, $l ), new vertex ( $cx * $x2, $cy * $y2, $l, $l, $l ), new vertex ( $cx * $x3, $cy * $y3, $d, $d, $d ), POLY_DOES_NOT_COLLIDE );
   $sx2 = $s * cos ( $a / 180.0 * M_PI ); $sy2 = $s * sin ( $a / 180.0 * M_PI );
   $sx3 = ( $s + $bh ) * cos ( $a / 180.0 * M_PI ); $sy3 = ( $s + $bh ) * sin ( $a / 180.0 * M_PI );
   $sx1 = ( $s + $bh ) * cos ( ( $a - $ca ) / 180.0 * M_PI ); $sy1 = ( $s + $bh ) * sin ( ( $a - $ca ) / 180.0 * M_PI );
   makepoly ( new vertex ( $cx * $sx1, $cy * $sy1, $d, $d, $d ), new vertex ( $cx * $sx2, $cy * $sy2, $d, $d, $d ), new vertex ( $cx * $sx3, $cy * $sy3, $d, $d, $d ), POLY_DOES_NOT_COLLIDE ); }
 makepoly ( new vertex ( - $xw / 2.0, - $xh / 2.0 ), new vertex ( - $xw / 2.0,   $xh / 2.0 ), new vertex ( ( $s + $bh ) * cos ( - M_PI ), 0 ) );
 makepoly ( new vertex (   $xw / 2.0, - $xh / 2.0 ), new vertex ( - $xw / 2.0, - $xh / 2.0 ), new vertex ( 0, ( $s + $bh ) * sin ( - 0.5 * M_PI ) ) );
 makepoly ( new vertex (   $xw / 2.0,   $xh / 2.0 ), new vertex ( - $xw / 2.0,   $xh / 2.0 ), new vertex ( 0, ( $s + $bh ) * sin ( 0.5 * M_PI ) ) );
 makepoly ( new vertex (   $xw / 2.0,   $xh / 2.0 ), new vertex (   $xw / 2.0, - $xh / 2.0 ), new vertex ( ( $s + $bh ) * cos ( 2 * M_PI ), 0 ) );

 /*
   OUTPUT POLYGONS
 */
 if ( $image ) {
   $w = 1000.0; $h = 1000.0;
   $img = imagecreatetruecolor ( $w, $h );
   $color = imagecolorallocate ( $img, 255, 255, 255 );
   imagefilledrectangle ( $img, 0, 0, $w - 1, $h - 1, $color );
   $color = imagecolorallocate ( $img, 255, 196, 128 );
   for ( $i = 0; $i < $polycount; $i ++ ) {
     $points = array ( );
     $points [ ] = $w / 2 + $polys [ $i ] -> vertex [ 0 ] -> x * $w / $xw;
     $points [ ] = $h / 2 + $polys [ $i ] -> vertex [ 0 ] -> y * $h / $xh;
     $points [ ] = $w / 2 + $polys [ $i ] -> vertex [ 1 ] -> x * $w / $xw;
     $points [ ] = $h / 2 + $polys [ $i ] -> vertex [ 1 ] -> y * $h / $xh;
     $points [ ] = $w / 2 + $polys [ $i ] -> vertex [ 2 ] -> x * $w / $xw;
     $points [ ] = $h / 2 + $polys [ $i ] -> vertex [ 2 ] -> y * $h / $xh;
     imagepolygon ( $img, $points, 3, $color ); }
   $color = imagecolorallocate ( $img, 0, 0, 0 );
   imagestring ( $img, 5, 2, 2, "polys: " . $polycount . ", spawns: " . $spawncount, $color );
   header ( "content-type: image/png" );
   imagepng ( $img );
   imagedestroy ( $img ); }
 else
   echo "polys: " . $polycount . "<br>spawns: " . $spawncount;

 /*
   WRITE POLYGONS
 */
 if ( ! $write )
   return;

 $file = fopen ( $filename, "wb" );
 fwrite ( $file, pack ( 'i', 11 ), 4 );
 fputc ( strlen ( $mapname ), $file );
 for ( $i = 0; $i < 38; $i ++ )
   if ( $i >= strlen ( $mapname ) )
     fputc ( 0, $file );
   else
     fputc ( ord ( $mapname [ $i ] ), $file );
 fputc ( strlen ( $texturename ), $file );
 for ( $i = 0; $i < 24; $i ++ )
   if ( $i >= strlen ( $texturename ) )
     fputc ( 0, $file );
   else
     fputc ( ord ( $texturename [ $i ] ), $file );
 fputc ( $bkcolor1 [ 2 ], $file ); fputc ( $bkcolor1 [ 1 ], $file ); fputc ( $bkcolor1 [ 0 ], $file ); fputc ( 0xff, $file );
 fputc ( $bkcolor2 [ 2 ], $file ); fputc ( $bkcolor2 [ 1 ], $file ); fputc ( $bkcolor2 [ 0 ], $file ); fputc ( 0xff, $file );
 fwrite ( $file, pack ( 'i', $jets ), 4 );
 fputc ( $nades, $file );
 fputc ( $medikits, $file );
 fputc ( $weather, $file );
 fputc ( $steps, $file );
 fwrite ( $file, pack ( 'i', $mapid ), 4 );
 fwrite ( $file, pack ( 'i', $polycount ), 4 );
 for ( $i = 0; $i < $polycount; $i ++ )
   writepoly ( $file, $polys [ $i ] );
 fputc ( 25, $file );
 for ( $i = 0; $i < 5221; $i ++ )
   fputc ( 0, $file );
 fwrite ( $file, pack ( 'i', $spawncount ), 4 );
 for ( $i = 0; $i < $spawncount; $i ++ )
   writespawn ( $file, $spawns [ $i ] );
 for ( $i = 0; $i < 8; $i ++ )
   fputc ( 0, $file );
 fclose ( $file ); ?>

...

Offline Bgretydews

  • Flagrunner
  • ****
  • Posts: 805
  • y halo thar rabbit
Re: htf_struct
« Reply #16 on: August 16, 2006, 12:50:17 pm »
Nice, How long did it take you to learn PHP
http://yossi.jrgp.org/?action=maps&sa=user_maps&u=10
Image (and link) is broken. Feel free to fix it.

Offline rainrider

  • Soldier
  • **
  • Posts: 145
    • rrhp
Re: htf_struct
« Reply #17 on: August 16, 2006, 01:20:11 pm »
One week for basics, one week for expanded basics, the rest - aren't we always learning something?

Offline numgun

  • Veteran
  • *****
  • Posts: 1032
Re: htf_struct
« Reply #18 on: August 17, 2006, 04:19:36 pm »
*looks at the code*

Ok, im outta here... o_o