Post: View Trigger Radius [CODE]
06-07-2016, 01:41 AM #1
ModdedModder
Gym leader
(adsbygoogle = window.adsbygoogle || []).push({}); I've always wanted a way to view the trigger radius for my triggers in game, and since the line() function only works in singleplayer I decided to make this script. It allows you to view the trigger_radius with carepackages. Just put the MakeRadius() function under the trigger_radius spawn. Fill in the origin and range, and it should work!
You must login or register to view this content.
    MakeTrigger(start, range)
{
trigger = spawn( "trigger_radius", start, 0, range, 50 );
trigger MakeRadius(start,range);
}
MakeRadius(start,range)
{
half_range = range / 2;
for(i=-180;i<0;i+=20)
{
Line[i] = CreateLines((start[0]-half_range,start[1]-half_range,start[2]),(start[0]+half_range,start[1]+half_range,start[2]+1),"com_plasticcase_friendly",start);
Line[i].angles = (0,i,0);
Line[i] EnableLinkTo();
Line[i] LinkTo(self);
}
}
CreateLines(start, end, ggg , Middle)
{
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);
AllBlocks = spawn( "script_origin", Middle );
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(ggg);level.CPcount++;
block.angles = Angle;
//block Solid();
//block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
block EnableLinkTo();
block LinkTo(AllBlocks);
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(ggg);level.CPcount++;
block.angles = Angle;
//block Solid();
//block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
block EnableLinkTo();
block LinkTo(AllBlocks);
wait 0.001;
}
block = spawn("script_model", ((end[0], end[1], start[2]) + (TXA * -1, TYA * -1, 10) + ((0, 0, ZA) * h)));
block setModel(ggg);level.CPcount++;
block.angles = Angle;
//block Solid();
//block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
block EnableLinkTo();
block LinkTo(AllBlocks);
wait 0.001;
}
return AllBlocks;
}

roundUp( floatVal )
{
if ( int( floatVal ) != floatVal )
return int( floatVal+1 );
else
return int( floatVal );
}
06-07-2016, 04:08 AM #2
Nice work, looks really cool, i'll have to mess with it later
06-11-2016, 07:57 AM #3
Blackshadow-000
Bounty hunter
how to call this ? ::MakeTrigger? or MakeTrigger();
or what ?
i really need this
06-14-2016, 06:49 AM #4
ModdedModder
Gym leader
Originally posted by 000 View Post
how to call this ? ::MakeTrigger? or MakeTrigger();
or what ?
i really need this


MakeTrigger(origin,range);

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo