Welcome to the new Diaspora forums, please let us know if you see anything broken! Notice: Some users may need to reupload their avatars due to an issue during forum setup!
Lt.Brandon's E2 Drones
So I was bored and decided to remake my drones for the 4th time in the last couple of years, these are completely E2 and do not do anything but circle the target. I ask that you not criticize it without first using it, as it is actually quite nice. This will probably be the only version of these I release, I want people to use them to learn how to make their own.
Features included in the public release include:
[list][*]Low lag![/*]
[*]Collision avoidance![/*]
[*]Projectile avoidance![/*]
[*]Target tracking![/*]
[*]Pretty sounds![/*][/list]
Video: COMING SOOON
Once again, as with all previous releases, DO NOT GIVE THESE TO ANYONE, DIRECT THEM HERE, AND DO NOT GIVE OUT ANY MODIFIED VERSIONS, EVER, AT ALL, IF YOU DO I WILL KILL YOU.
Features included in the public release include:
[list][*]Low lag![/*]
[*]Collision avoidance![/*]
[*]Projectile avoidance![/*]
[*]Target tracking![/*]
[*]Pretty sounds![/*][/list]
Video: COMING SOOON
Once again, as with all previous releases, DO NOT GIVE THESE TO ANYONE, DIRECT THEM HERE, AND DO NOT GIVE OUT ANY MODIFIED VERSIONS, EVER, AT ALL, IF YOU DO I WILL KILL YOU.
@name E2 Bomber @model models/SmallBridge/Drones/sbdronerecon.mdl @inputs @outputs [HitPos MoveVec]:vector @persist [WarningBox]:ranger [DodgeBox HitPos2]:table [MODE GROUP Sound1 Sound2]:string [TARGET Drone]:entity Speed @trigger TARGET = owner() #Model: models/SmallBridge/Drones/sbdronerecon.mdl #Material: models/props_combine/combinethumper002 if(first()){ entity():setMaterial("models/props_combine/combinethumper002") SizeMax=max(Drone:boxMax():x()*10,Drone:boxMax():y()*10,Drone:boxMax():z()*10) Drone = entity() GROUP = "BA_DRONES" Speed = 1000 Sound1="npc/combine_gunship/dropship_engine_distant_loop1.wav" Sound2="ambient/atmosphere/underground_hall_loop1.wav" entity():soundPlay(1,0,Sound2) dsJoinGroup(GROUP) dsSend("FIGHTER_JOINED", GROUP, entity()) #for(I = 1, 6){ #holoCreate(I) #} entity():unFreeze() timer("Movement", 100) } function void movement(){ #Fuck off gravity Drone:propGravity(0) #Deal with the sound pitch soundPitch(1,Drone:vel():length() / 4 + 70) #Calculate movement and turning if(TARGET:isValid()&Drone:pos():distance(TARGET:boxCenterW()) > 1000){ MoveVec = (Drone:forward()*Speed) + (Drone:vel()*0.5) + $MoveVec Ang = ang(-(Drone:elevation(TARGET:boxCenterW())), -Drone:bearing(TARGET:boxCenterW()), -angnorm(Drone:angles():roll())/2) }elseif(TARGET:isValid()&Drone:pos():distance(TARGET:boxCenterW()) < 1000){ MoveVec = (Drone:forward()*(Speed/2)) + (Drone:right()*(Speed)) Ang = ang(-(Drone:elevation(TARGET:boxCenterW())), -Drone:bearing(TARGET:boxCenterW()), -angnorm(Drone:angles():roll())/2) }else{ MoveVec = Drone:vel()*0.5 Ang = ang(-(Drone:elevation(TARGET:boxCenterW())), -Drone:bearing(TARGET:boxCenterW()), -angnorm(Drone:angles():roll())/2) } #Filter the rangers rangerFilter(entity()) rangerFilter(entity():getConstraints()) rangerHitWater(1) rangerDefaultZero(0) #Is stuff close enough for us to care about? WarningBox = rangerOffsetHull(Drone:toWorld(vec(-Drone:boxSize():x()*3, 0, 0)), Drone:toWorld(vec(Drone:boxSize():x()*3, 0, 0)), Drone:boxSize()*3) if(WarningBox:hit()) { #OMG WE HAVE INCOMING PREPARE TO MOVE OUT THE WAY! if(WarningBox:entity()){ #If its an incoming entity tell the E2 where it is. HitPos = entity():toLocal(-WarningBox:entity():boxCenterW())/2 MoveVec = MoveVec + HitPos } #Detect all the crap around us so we can gtfo the way DodgeBox["UP", ranger] = rangerOffset(150,entity():pos(), Drone:up()) DodgeBox["DOWN", ranger] = rangerOffset(150,entity():pos(), -Drone:up()) DodgeBox["FORWARD", ranger] = rangerOffset(250,entity():pos(), Drone:forward()) DodgeBox["BACK", ranger] = rangerOffset(250,entity():pos(), -Drone:forward()) DodgeBox["RIGHT", ranger] = rangerOffset(350,entity():pos(), Drone:right()) DodgeBox["LEFT", ranger] = rangerOffset(350,entity():pos(), -Drone:right()) if(DodgeBox["UP", ranger]:hit()) { HitPos2[1, vector] = (-Drone:up()*DodgeBox["UP", ranger]:distance())/(DodgeBox["UP", ranger]:distance()/75) }else{ HitPos2[1, vector] = vec(0,0,0) } if(DodgeBox["DOWN", ranger]:hit()) { HitPos2[2, vector] = (Drone:up()*DodgeBox["DOWN", ranger]:distance())/(DodgeBox["DOWN", ranger]:distance()/75) }else{ HitPos2[2, vector] = vec(0,0,0) } if(DodgeBox["FORWARD", ranger]:hit()) { #Stop us from going forward more HitPos2[3, vector] = (-Drone:forward()*DodgeBox["FORWARD", ranger]:distance())/(DodgeBox["FORWARD", ranger]:distance()/125) #Something is in front of us so lets decide a direction to dodge! if(DodgeBox["UP", ranger]:hit()) { UpClear = 1 } if(DodgeBox["DOWN", ranger]:hit()) { DownClear = 1 } if(DodgeBox["RIGHT", ranger]:hit()) { RightClear = 1 } if(DodgeBox["LEFT", ranger]:hit()) { LeftClear = 1 } #Decide which direction to dodge in if(UpClear == 1&RightClear == 1){ HitPos2[3, vector] = (-Drone:forward()*Drone:right()*Drone:up()*DodgeBox["FORWARD", ranger]:distance())/(DodgeBox["FORWARD", ranger]:distance()/125) }elseif(DownClear == 1&LeftClear == 1){ HitPos2[3, vector] = (-Drone:forward()*-Drone:right()*-Drone:up()*DodgeBox["FORWARD", ranger]:distance())/(DodgeBox["FORWARD", ranger]:distance()/125) }elseif(UpClear == 1){ HitPos2[3, vector] = (-Drone:forward()*Drone:up()*DodgeBox["FORWARD", ranger]:distance())/(DodgeBox["FORWARD", ranger]:distance()/125) }elseif(DownClear == 1){ HitPos2[3, vector] = (-Drone:forward()*-Drone:up()*DodgeBox["FORWARD", ranger]:distance())/(DodgeBox["FORWARD", ranger]:distance()/125) }elseif(LeftClear == 1){ HitPos2[3, vector] = (-Drone:forward()*-Drone:right()*DodgeBox["FORWARD", ranger]:distance())/(DodgeBox["FORWARD", ranger]:distance()/125) }elseif(RightClear == 1){ HitPos2[3, vector] = (-Drone:forward()*Drone:right()*DodgeBox["FORWARD", ranger]:distance())/(DodgeBox["FORWARD", ranger]:distance()/125) }else{ for(I = 1, 6){ HitPos2[I, vector] = vec(0,0,0) } MoveVec = vec(0,0,0) } }else{ HitPos2[3, vector] = vec(0,0,0) } if(DodgeBox["BACK", ranger]:hit()) { HitPos2[4, vector] = (Drone:forward()*DodgeBox["BACK", ranger]:distance())/(DodgeBox["BACK", ranger]:distance()/125) }else{ HitPos2[4, vector] = vec(0,0,0) } if(DodgeBox["RIGHT", ranger]:hit()) { HitPos2[5, vector] = (-Drone:right()*DodgeBox["RIGHT", ranger]:distance())/(DodgeBox["RIGHT", ranger]:distance()/175) }else{ HitPos2[5, vector] = vec(0,0,0) } if(DodgeBox["LEFT", ranger]:hit()) { HitPos2[6, vector] = (Drone:right()*DodgeBox["LEFT", ranger]:distance())/(DodgeBox["LEFT", ranger]:distance()/175) }else{ HitPos2[6, vector] = vec(0,0,0) } for(I=1, HitPos2:count()){ if(HitPos2[I, vector] != vec(0,0,0)){ MoveVec = MoveVec + (HitPos2[I, vector]*(Speed/100)) #holoPos(I, HitPos2[I, vector]) } } } Drone:setVel(MoveVec) Drone:setAngVel(shiftR(Ang)*8) } if(clk("Movement")){ movement() timer("Movement", 150) }
This is a block of text that can be added to posts you make. There is a 255 character limit.
Lλmbdλ: donations for coding the space future of diaspora :>
Get your extra long EVE trial here!
Lλmbdλ: donations for coding the space future of diaspora :>
Get your extra long EVE trial here!
Comments
Is Recetium going to get a command that destroys every drone that was spawned after it?
Because that would totally be awesome.
Currently you can't turn the drones off without destroying them, so that is probably going to happen.
Lλmbdλ: donations for coding the space future of diaspora :>
Get your extra long EVE trial here!
Somehow this seems like a flaw. At least they always fight to the last breath- er, hit point.