e2 spacebuild beam weapon

right now im trying to make a e2 beamweapon for my ship. but the one im currently using will shoot THROUGH my ship and insta-blow me if something goes wrong. so right not im trying to add THIS

              findInCone(E:pos(), E:forward(), 20000,20)
E = findClosest(V) 

bit of code to THIS.

    @name beamweapon

@inputs Fire Target:entity
@outputs
@persist [EE Owner]:entity
@persist [StartPos TargetPos]:vector
@trigger

if(dupefinished()){reset()}
if(first())
{

runOnTick(1)



EE = entity()


Owner = owner()

}

Fire = Owner:keyAttack2()

if(Fire)
{

anyone know how i could add it?
thanks in adv, krazi

[editline]09:59PM[/editline]

i will give anyone that helps me enough my entire ship :stuck_out_tongue:

I would have to know what you are firing and how you are firing it. The system would be dependant on that.

The second bit of code shows what it’s firing. It’s a shootbeamto.

[editline]12:05AM[/editline]

Oh, lol I feel like a fucking moron. I clipped it out.

I’ll update the code tomorrow, I feel like a tard

A custom function. I’ve never used it and therefore dont know how to check for it.

I’ll go see you on SAS. I think you’ll need to do a ranger check for your own entities.

That might work^^

shootBeamTo is a custom function on the SAS servers created by PT Daedalus. Since you can’t find it anywhere else, it’d be hard for anyone else to help.

oh, shit its a coustom func?..

anyone have a idea for a better func that i could use? im pretty new to e2 and want to be able to get support.

[editline]09:20AM[/editline]

@name beamweapon
@inputs Fire Target:entity
@outputs
@persist [EE Owner]:entity
@persist [StartPos TargetPos]:vector
@trigger

if(dupefinished()){reset()}
if(first())
{

runOnTick(1)



EE = entity()


Owner = owner()

}

Fire = Owner:keyAttack2()

if(Fire)
{

if(Target){TargetPos = Target:pos()}

else{TargetPos = Owner:aimPos()}

StartPos = EE:pos()

fx("pd_ray",TargetPos,1000,ang(),StartPos)

Direction = (TargetPos - StartPos):normalized()


Damage = 0.001





ShootEntity = EE



ShootEntity:shootBeamTo(Direction,Damage,Damage,Damage,Damage)

}

this is the nun–funcked up code

[editline]09:22AM[/editline]

and all that the new form of dmg would need to do is shoot a damaging beam

Could you put it in [noparse]




[/noparse] tags?




@name beamweapon
@inputs Fire Target:entity
@outputs 
@persist [EE Owner]:entity
@persist [StartPos TargetPos]:vector
@trigger 


if(dupefinished()){reset()}
if(first())
{
    
  
    runOnTick(1)
    
    
   
    EE = entity()
    
 
    Owner = owner()
}


Fire = Owner:keyAttack2()

if(Fire)
{

  


    if(Target){TargetPos = Target:pos()}
   else{TargetPos = Owner:aimPos()}
    
    
    StartPos = EE:pos()
    
    fx("pd_ray",TargetPos,1000,ang(),StartPos)
   
    Direction = (TargetPos - StartPos):normalized()
    
  
    Damage = 0.001


    
    
  
    ShootEntity = EE
    
    
  
    ShootEntity:shootBeamTo(Direction,Damage,Damage,Damage,Damage)
    
    

}



like this?

yeah thanks, it’s much easier to read :smile:

so, anyone have a good code for shooting a beam to a target in a cone/doing continuous damage in said cone? ive got a few good dupes for tradin…