Mindustry

Mindustry

View Stats:
Possibility of controlling more than one turret at once?
Hey, not sure if I can do this already but I'm a total dunce or not, but having control over a few of the same type of turret in close vicinity would be appreciated.
Originally posted by Circuitbreaker08:
If you want to posses a turret and other shoot at the same spot copy and import this into a processor:

getlink master 0
sensor x master @shootX
sensor y master @shootY
sensor shoot master @shooting
set turretnum 1
getlink turret turretnum
op add turretnum turretnum 1
control shoot turret x y shoot 0
jump 5 lessThan turretnum @links

Bind the turret that you posses to control all of them first, then the ones that copy afterwards.

If you want all selected turrets to copy a player within range of the turret with the longest range use this:

getlink master 0
radar ally player any distance master 1 player
sensor x player @shootX
sensor y player @shootY
sensor shoot player @shooting
control shoot master x y shoot 0
set turretnum 1
getlink turret turretnum
op add turretnum turretnum 1
control shoot turret x y shoot 0
jump 7 lessThan turretnum @links

Bind the turret that has the most desireable range first, then all others second.

If you want each turret to copy the nearest detectable player independantly from others use this:

getlink turret 0
radar ally player any distance turret1 1 player
sensor x player @shootX
sensor y player @shootY
sensor shoot player @shooting
control shoot turret x y shoot 0
Simply bind the turret you wish to copy you.
< >
Showing 1-1 of 1 comments
The author of this thread has indicated that this post answers the original topic.
Circuitbreaker08 Dec 4, 2020 @ 1:13pm 
If you want to posses a turret and other shoot at the same spot copy and import this into a processor:

getlink master 0
sensor x master @shootX
sensor y master @shootY
sensor shoot master @shooting
set turretnum 1
getlink turret turretnum
op add turretnum turretnum 1
control shoot turret x y shoot 0
jump 5 lessThan turretnum @links

Bind the turret that you posses to control all of them first, then the ones that copy afterwards.

If you want all selected turrets to copy a player within range of the turret with the longest range use this:

getlink master 0
radar ally player any distance master 1 player
sensor x player @shootX
sensor y player @shootY
sensor shoot player @shooting
control shoot master x y shoot 0
set turretnum 1
getlink turret turretnum
op add turretnum turretnum 1
control shoot turret x y shoot 0
jump 7 lessThan turretnum @links

Bind the turret that has the most desireable range first, then all others second.

If you want each turret to copy the nearest detectable player independantly from others use this:

getlink turret 0
radar ally player any distance turret1 1 player
sensor x player @shootX
sensor y player @shootY
sensor shoot player @shooting
control shoot turret x y shoot 0
Simply bind the turret you wish to copy you.
< >
Showing 1-1 of 1 comments
Per page: 1530 50

Date Posted: Dec 4, 2020 @ 12:45pm
Posts: 1