baca85 0 Posted February 7, 2004 Hey guys i have designed a script for placing fences from the baracken base pack. Dont you find placing the of fences is rather tire some? Well this early script should sort the problem. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _max = _this select 0 _marker = _this select 1 _fence = _this select 2 _pos = markerpos _marker _i = 0 #loop _i = _i + 1 _fen = _fence camcreate [(_pos select 0),(_pos select 1)+6,1] _fen setdir 90 _pos = getpos _fen ?(_max < _i): goto "next1" _i2 = 3 goto "loop" #next1 _i = 0 _i2 = 3 #loop2 _i = _i + 1 _fen = _fence camcreate [(_pos select 0)+6 - _i2,(_pos select 1)+_i2,1] _fen setdir 180 _pos = getpos _fen ?(_i == 1): _i2 = 0 ?(_max < _i): goto "next2" goto "loop2" #next2 _i = 0 _i2 = 3 #loop3 _i = _i + 1 _fen = _fence camcreate [(_pos select 0) + _i2,(_pos select 1)-6 + _i2,1] _fen setdir 270 _pos = getpos _fen ?(_i == 1): _i2 = 0 ?(_max < _i):goto "next3" goto "loop3" #next3 _i = 0 _i2 = 3 _max2 = _max - 1 _i3 = 0 #loop4 _i = _i + 1 _fen = _fence camcreate [(_pos select 0) - 6 + _i2 - _i3,(_pos select 1) - _i2,1] _fen setdir 360 _pos = getpos _fen ?(_i == 10 ): _i3 = 6 ?(_i == 11 ): _i3 = 0 ?(_i == 1): _i2 = 0 ?(_max2 < _i):exit goto "loop4" To use this script you need to enter [num,"markername","fencename"] exec "namescript.sqs" num = number of fence pieces you want per side markername = name of marker you have placed on map for the base fence name = maybe any of the following "Zaun1", "Zaun2", Â "Zaun3" , " Zaun4", "Zaun5", "Zaun6" comments are welcome for improvements edit So far i have only place one entrance and it appears to the south of the fence always, also i have not built this to work in diagonals yet maybe in the future. Share this post Link to post Share on other sites
baca85 0 Posted February 7, 2004 Has any one tried it. Id like feedback so i can add features for you to use. Share this post Link to post Share on other sites
iNeo 0 Posted February 8, 2004 This is really handy, easy way to get a perfectly aligned fence Nice job. Unfortunately you don't see them in the editor so adding the rest of the camp isn't as easy as it is when you place the fence the original way. Share this post Link to post Share on other sites
baca85 0 Posted February 10, 2004 I was working on a version to build the buildings inside the fences but the animation took a while to initilise i may try again after tomorrow. Share this post Link to post Share on other sites