Post: {How To} Create Different Model Walls
02-22-2011, 01:54 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Well I'm back with another tutorial! In this tutorial I will be explaining how to create walls made of different models. For example, my favorite wall is one composed of sentry guns. It looks really cool and acts the same as a carepackage wall.

You must login or register to view this content.


First you will need the building code for a wall:
    
CreateWalls(start, end)
{
D = Distance((start[0], start[1], 0), (end[0], end[1], 0));
H = Distance((0, 0, start[2]), (0, 0, end[2]));
blocks = roundUp(D/55);
height = roundUp(H/30);
CX = end[0] - start[0];
CY = end[1] - start[1];
CZ = end[2] - start[2];
XA = (CX/blocks);
YA = (CY/blocks);
ZA = (CZ/height);
TXA = (XA/4);
TYA = (YA/4);
Temp = VectorToAngles(end - start);
Angle = (0, Temp[1], 90);
for(h = 0; h < height; h++){
block = spawn("script_model", (start + (TXA, TYA, 10) + ((0, 0, ZA) * h)));
block setModel("[COLOR="red"]com_plasticcase_friendly[/COLOR]");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
for(i = 1; i < blocks; i++){
block = spawn("script_model", (start + ((XA, YA, 0) * i) + (0, 0, 10) + ((0, 0, ZA) * h)));
block setModel("[COLOR="red"]com_plasticcase_friendly[/COLOR]");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
block = spawn("script_model", ((end[0], end[1], start[2]) + (TXA * -1, TYA * -1, 10) + ((0, 0, ZA) * h)));
block setModel("[COLOR="Red"]com_plasticcase_friendly[/COLOR]");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
}


roundUp( floatVal )
{
if ( int( floatVal ) != floatVal )
return int( floatVal+1 );
else
return int( floatVal );
}


Now find a model you want(thanks to Derek):You must login or register to view this content.

Now find the code highlighted in red and replace it with your model. Simple!

So for a wall of sentry guns your code should look like this:
    CreateWalls(start, end) 
{
D = Distance((start[0], start[1], 0), (end[0], end[1], 0));
H = Distance((0, 0, start[2]), (0, 0, end[2]));
blocks = roundUp(D/55);
height = roundUp(H/30);
CX = end[0] - start[0];
CY = end[1] - start[1];
CZ = end[2] - start[2];
XA = (CX/blocks);
YA = (CY/blocks);
ZA = (CZ/height);
TXA = (XA/4);
TYA = (YA/4);
Temp = VectorToAngles(end - start);
Angle = (0, Temp[1], 90);
for(h = 0; h < height; h++){
block = spawn("script_model", (start + (TXA, TYA, 10) + ((0, 0, ZA) * h)));
block setModel("[COLOR="red"]sentry_minigun[/COLOR]");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
for(i = 1; i < blocks; i++){
block = spawn("script_model", (start + ((XA, YA, 0) * i) + (0, 0, 10) + ((0, 0, ZA) * h)));
block setModel("[COLOR="red"]sentry_minigun[/COLOR]");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
block = spawn("script_model", ((end[0], end[1], start[2]) + (TXA * -1, TYA * -1, 10) + ((0, 0, ZA) * h)));
block setModel("[COLOR="Red"]sentry_minigun[/COLOR]");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
}


roundUp( floatVal )
{
if ( int( floatVal ) != floatVal )
return int( floatVal+1 );
else
return int( floatVal );
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to FourzerotwoFAILS for this useful post:

EliteMossy, The_Platypus, xQuZe-
02-22-2011, 02:16 PM #11
Originally posted by jkry
haha wall of chickens on rundown xD i guess a junkyard could be made with this so thanks.


lol I actually tried the chickens, unfortunately they don't move around :(
02-22-2011, 03:06 PM #12
xQuZe-
You talkin to me?
Originally posted by FourzerotwoFAILS View Post
,,,


It will work with other Create functions too.
Like Plate or Asc

---------- Post added at 04:06 PM ---------- Previous post was at 04:00 PM ----------

Originally posted by FourzerotwoFAILS View Post
lol I actually tried the chickens, unfortunately they don't move around :(


Lol feel free to post this in your thread ;d
You must login or register to view this content.

The following user thanked xQuZe- for this useful post:

FourzerotwoFAILS
02-22-2011, 08:16 PM #13
!x-MONKEY-BOMB!
League Champion
Originally posted by FourzerotwoFAILS View Post
lol I actually tried the chickens, unfortunately they don't move around :(


you stole my picture man :O

Happy
02-25-2011, 07:03 PM #14
TheWraith--
Gym leader
Originally posted by FourzerotwoFAILS View Post
furniture_blowupdoll01


what map is the blowup doll in where did it come from?
02-25-2011, 07:04 PM #15
Originally posted by TheWraith
what map is the blowup doll in where did it come from?


Terminal and Afghan.
02-26-2011, 01:49 AM #16
jkry_2_1_
Call Me The CodFather
Originally posted by FourzerotwoFAILS View Post
Terminal and Afghan.


estate i dont think on afghan.
02-26-2011, 01:50 AM #17
Originally posted by jkry
estate i dont think on afghan.


It works on afghan. Also, I figured out a way to get it to work on rust and derail.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo