Garry's Mod

Garry's Mod

Precision Alignment
RaspYat1e 29 Jul, 2022 @ 5:13am
Is there way to mirror radius?
I'm building really ♥♥♥♥♥♥♥ big thing, and i need mirroring it, but you know, it a little bit hard to mirror around 2.000 props. Is there some way to mirror whole radius?
< >
Showing 1-8 of 8 comments
niko 12 Nov, 2022 @ 4:28am 
I would write an E2 for this, if you haven't already figured out a solution in the last four months :P
RaspYat1e 12 Nov, 2022 @ 6:22am 
Originally posted by niko:
I would write an E2 for this, if you haven't already figured out a solution in the last four months :P
An e2 chip would definitely be useful, but unfortunately I'm not an e2 expert.
niko 25 Nov, 2022 @ 7:48pm 
This is what I came up with this evening. It's not the best, but it could help you get started mirroring a bunch of props at once.

Instructions:
  • Spawn the E2 which will be a small cube with a green wireframe surface plane attached to it (similar to the one for Precision Alignment) and an arrow indicating which side it will copy from.
  • Position the E2 next to the props you want to mirror with the arrow pointing in their direction.
  • Aim your crosshair at the E2 cube, press R to refresh the E2 and it will highlight all of the props within its range a yellow color.
  • Change the variable "Radius" in the "User config" section to change the distance the E2 will scan for props.
  • You can reposition and refresh the E2 until you have it just right. You can use PA tool to position the E2 exactly how you want.
  • Aim your crosshair at the E2 cube and press T while holding your left Shift key and it will begin spawning props mirrored on the other side of the green wireframe surface plane.
  • Refresh or remove the E2 to remove all of the spawned props. You can do this while the props are spawning.
  • After the props are mirrored and you like it, don't delete the E2 yet and save a dupe of the entire build. Then delete everything and start building from that new dupe so the props don't disappear. You can then delete the E2 if you want.

This just copies props, their user defined colors and materials, and the rest of their default property values. It doesn't copy user defined masses, surface properties, etc. It doesn't copy constraints. It might not get the angles right for certain entities and it could do any number of strange things I didn't consider when writing the code. So use at your own risk. ;)

@model models/jaanus/wiretool/wiretool_pixel_sml.mdl @persist Radius DUPE [ENTS RGBS MATS]:array if( first() ){ #[ User config ________________________________________________________]# Radius = 2000 #[ The rest... ________________________________________________________]# DUPE = 0 ENTS = array() RGBS = array() MATS = array() runOnLast( 1 ) runOnKeys( owner(), 1 ) propSpawnEffect( 0 ) propSpawnUndo( 0 ) holoCreate( 1 ) holoParent( 1, entity() ) holoModel( 1, "cube" ) holoScaleUnits( 1, vec( 24, 0.01, 24 )) holoDisableShading( 1, 1 ) holoColor( 1, vec( 0, 255, 0 )) holoMaterial( 1, "models/wireframe" ) holoCreate( 2 ) holoParent( 2, entity() ) holoModel( 2, "hq_cone" ) holoScaleUnits( 2, vec( 3 )) holoPos( 2, entity():toWorld( vec( 0, -3, 0 ))) holoAng( 2, entity():toWorld( ang( 0, 0, 90 ))) holoColor( 2, vec4( 0, 255, 0, 200 )) holoMaterial( 2, "models/ihvtest/eyeball_l" ) findIncludePlayerProps( owner() ) findExcludeEntities( owner():weapons() ) findExcludeClass( "wire_hologram" ) findInCone( entity():pos(), entity():right(), Radius, 90 ) ENTS = findToArray() for( A = 1, ENTS:count()){ local ENT = ENTS[A, entity] RGBS[A, vector4] = ENT:getColor4() MATS[A, string] = ENT:getMaterial() ENT:setColor( vec4( 255, 200, 0, 200 )) ENT:setMaterial( "models/ihvtest/eyeball_l" ) }} if( changed( owner():keyPressed( "t" ))){ if( owner():keyPressed( "t" )){ if( owner():keyPressed( "lshift" )){ if( owner():aimEntity() == entity() ){ DUPE = 1 runOnTick( 1 ) }}}} if( DUPE ){ if( ENTS:exists( 1 )){ if( propCanCreate() ){ local ENT = ENTS[1, entity] local POS = entity():toWorld( entity():toLocal( ENT:pos() ) * vec( 1, -1, 1 )) local ANG = entity():toWorld( entity():toLocal( ENT:angles() ) * ang( 1, -1, -1 )) local NEW = propSpawn( ENT, POS, ANG, 1 ) ENT:setColor( RGBS[1, vector4]) NEW:setColor( RGBS[1, vector4]) ENT:setMaterial( MATS[1, string]) NEW:setMaterial( MATS[1, string]) RGBS:remove( 1 ) MATS:remove( 1 ) ENTS:remove( 1 ) }} else{ DUPE = 0 runOnTick( 0 ) }} if( last() ){ for( A = 1, ENTS:count() ){ local ENT = ENTS[A, entity] ENT:setColor( RGBS[A, vector4]) ENT:setMaterial( MATS[A, string]) }}
Last edited by niko; 25 Nov, 2022 @ 7:50pm
RaspYat1e 26 Nov, 2022 @ 8:59am 
Originally posted by niko:
This is what I came up with this evening. It's not the best, but it could help you get started mirroring a bunch of props at once.

Instructions:
  • Spawn the E2 which will be a small cube with a green wireframe surface plane attached to it (similar to the one for Precision Alignment) and an arrow indicating which side it will copy from.
  • Position the E2 next to the props you want to mirror with the arrow pointing in their direction.
  • Aim your crosshair at the E2 cube, press R to refresh the E2 and it will highlight all of the props within its range a yellow color.
  • Change the variable "Radius" in the "User config" section to change the distance the E2 will scan for props.
  • You can reposition and refresh the E2 until you have it just right. You can use PA tool to position the E2 exactly how you want.
  • Aim your crosshair at the E2 cube and press T while holding your left Shift key and it will begin spawning props mirrored on the other side of the green wireframe surface plane.
  • Refresh or remove the E2 to remove all of the spawned props. You can do this while the props are spawning.
  • After the props are mirrored and you like it, don't delete the E2 yet and save a dupe of the entire build. Then delete everything and start building from that new dupe so the props don't disappear. You can then delete the E2 if you want.

This just copies props, their user defined colors and materials, and the rest of their default property values. It doesn't copy user defined masses, surface properties, etc. It doesn't copy constraints. It might not get the angles right for certain entities and it could do any number of strange things I didn't consider when writing the code. So use at your own risk. ;)

@model models/jaanus/wiretool/wiretool_pixel_sml.mdl @persist Radius DUPE [ENTS RGBS MATS]:array if( first() ){ #[ User config ________________________________________________________]# Radius = 2000 #[ The rest... ________________________________________________________]# DUPE = 0 ENTS = array() RGBS = array() MATS = array() runOnLast( 1 ) runOnKeys( owner(), 1 ) propSpawnEffect( 0 ) propSpawnUndo( 0 ) holoCreate( 1 ) holoParent( 1, entity() ) holoModel( 1, "cube" ) holoScaleUnits( 1, vec( 24, 0.01, 24 )) holoDisableShading( 1, 1 ) holoColor( 1, vec( 0, 255, 0 )) holoMaterial( 1, "models/wireframe" ) holoCreate( 2 ) holoParent( 2, entity() ) holoModel( 2, "hq_cone" ) holoScaleUnits( 2, vec( 3 )) holoPos( 2, entity():toWorld( vec( 0, -3, 0 ))) holoAng( 2, entity():toWorld( ang( 0, 0, 90 ))) holoColor( 2, vec4( 0, 255, 0, 200 )) holoMaterial( 2, "models/ihvtest/eyeball_l" ) findIncludePlayerProps( owner() ) findExcludeEntities( owner():weapons() ) findExcludeClass( "wire_hologram" ) findInCone( entity():pos(), entity():right(), Radius, 90 ) ENTS = findToArray() for( A = 1, ENTS:count()){ local ENT = ENTS[A, entity] RGBS[A, vector4] = ENT:getColor4() MATS[A, string] = ENT:getMaterial() ENT:setColor( vec4( 255, 200, 0, 200 )) ENT:setMaterial( "models/ihvtest/eyeball_l" ) }} if( changed( owner():keyPressed( "t" ))){ if( owner():keyPressed( "t" )){ if( owner():keyPressed( "lshift" )){ if( owner():aimEntity() == entity() ){ DUPE = 1 runOnTick( 1 ) }}}} if( DUPE ){ if( ENTS:exists( 1 )){ if( propCanCreate() ){ local ENT = ENTS[1, entity] local POS = entity():toWorld( entity():toLocal( ENT:pos() ) * vec( 1, -1, 1 )) local ANG = entity():toWorld( entity():toLocal( ENT:angles() ) * ang( 1, -1, -1 )) local NEW = propSpawn( ENT, POS, ANG, 1 ) ENT:setColor( RGBS[1, vector4]) NEW:setColor( RGBS[1, vector4]) ENT:setMaterial( MATS[1, string]) NEW:setMaterial( MATS[1, string]) RGBS:remove( 1 ) MATS:remove( 1 ) ENTS:remove( 1 ) }} else{ DUPE = 0 runOnTick( 0 ) }} if( last() ){ for( A = 1, ENTS:count() ){ local ENT = ENTS[A, entity] ENT:setColor( RGBS[A, vector4]) ENT:setMaterial( MATS[A, string]) }}
Thank you so much for taking the time and effort to help me.
niko 26 Nov, 2022 @ 9:36am 
No problem, I enjoy this sort of thing. Let me know how it goes.
RaspYat1e 12 Dec, 2022 @ 7:10am 
Originally posted by niko:
This is what I came up with this evening. It's not the best, but it could help you get started mirroring a bunch of props at once.

Instructions:
  • Spawn the E2 which will be a small cube with a green wireframe surface plane attached to it (similar to the one for Precision Alignment) and an arrow indicating which side it will copy from.
  • Position the E2 next to the props you want to mirror with the arrow pointing in their direction.
  • Aim your crosshair at the E2 cube, press R to refresh the E2 and it will highlight all of the props within its range a yellow color.
  • Change the variable "Radius" in the "User config" section to change the distance the E2 will scan for props.
  • You can reposition and refresh the E2 until you have it just right. You can use PA tool to position the E2 exactly how you want.
  • Aim your crosshair at the E2 cube and press T while holding your left Shift key and it will begin spawning props mirrored on the other side of the green wireframe surface plane.
  • Refresh or remove the E2 to remove all of the spawned props. You can do this while the props are spawning.
  • After the props are mirrored and you like it, don't delete the E2 yet and save a dupe of the entire build. Then delete everything and start building from that new dupe so the props don't disappear. You can then delete the E2 if you want.

This just copies props, their user defined colors and materials, and the rest of their default property values. It doesn't copy user defined masses, surface properties, etc. It doesn't copy constraints. It might not get the angles right for certain entities and it could do any number of strange things I didn't consider when writing the code. So use at your own risk. ;)

@model models/jaanus/wiretool/wiretool_pixel_sml.mdl @persist Radius DUPE [ENTS RGBS MATS]:array if( first() ){ #[ User config ________________________________________________________]# Radius = 2000 #[ The rest... ________________________________________________________]# DUPE = 0 ENTS = array() RGBS = array() MATS = array() runOnLast( 1 ) runOnKeys( owner(), 1 ) propSpawnEffect( 0 ) propSpawnUndo( 0 ) holoCreate( 1 ) holoParent( 1, entity() ) holoModel( 1, "cube" ) holoScaleUnits( 1, vec( 24, 0.01, 24 )) holoDisableShading( 1, 1 ) holoColor( 1, vec( 0, 255, 0 )) holoMaterial( 1, "models/wireframe" ) holoCreate( 2 ) holoParent( 2, entity() ) holoModel( 2, "hq_cone" ) holoScaleUnits( 2, vec( 3 )) holoPos( 2, entity():toWorld( vec( 0, -3, 0 ))) holoAng( 2, entity():toWorld( ang( 0, 0, 90 ))) holoColor( 2, vec4( 0, 255, 0, 200 )) holoMaterial( 2, "models/ihvtest/eyeball_l" ) findIncludePlayerProps( owner() ) findExcludeEntities( owner():weapons() ) findExcludeClass( "wire_hologram" ) findInCone( entity():pos(), entity():right(), Radius, 90 ) ENTS = findToArray() for( A = 1, ENTS:count()){ local ENT = ENTS[A, entity] RGBS[A, vector4] = ENT:getColor4() MATS[A, string] = ENT:getMaterial() ENT:setColor( vec4( 255, 200, 0, 200 )) ENT:setMaterial( "models/ihvtest/eyeball_l" ) }} if( changed( owner():keyPressed( "t" ))){ if( owner():keyPressed( "t" )){ if( owner():keyPressed( "lshift" )){ if( owner():aimEntity() == entity() ){ DUPE = 1 runOnTick( 1 ) }}}} if( DUPE ){ if( ENTS:exists( 1 )){ if( propCanCreate() ){ local ENT = ENTS[1, entity] local POS = entity():toWorld( entity():toLocal( ENT:pos() ) * vec( 1, -1, 1 )) local ANG = entity():toWorld( entity():toLocal( ENT:angles() ) * ang( 1, -1, -1 )) local NEW = propSpawn( ENT, POS, ANG, 1 ) ENT:setColor( RGBS[1, vector4]) NEW:setColor( RGBS[1, vector4]) ENT:setMaterial( MATS[1, string]) NEW:setMaterial( MATS[1, string]) RGBS:remove( 1 ) MATS:remove( 1 ) ENTS:remove( 1 ) }} else{ DUPE = 0 runOnTick( 0 ) }} if( last() ){ for( A = 1, ENTS:count() ){ local ENT = ENTS[A, entity] ENT:setColor( RGBS[A, vector4]) ENT:setMaterial( MATS[A, string]) }}
No such function: propSpawnUndo(number) at line 24, char 5

Seems like i need to install something for wiremod..
RaspYat1e 13 Dec, 2022 @ 1:15pm 
Originally posted by niko:
No problem, I enjoy this sort of thing. Let me know how it goes.
i enabled prop core, and tried to use this e2, but i have errors. Tick quote exceed and attempt to call field 'WithinPropcoreLimits'
niko 25 Dec, 2022 @ 7:36am 
Damn, sorry to hear that. Did you happen to try it in single player mode? In the mean time I can try to edit the chip to have less aggressive timing. Also, if you feel like hopping on the same server one of these days to figure it out together feel free to add me!
< >
Showing 1-8 of 8 comments
Per page: 1530 50