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!

E2 Gyropod v3

LtBrandonLtBrandon Posts: 506Registered, Administrator
edited April 2014 in Showcase #1
BEGONE WIRING, WELCOME THE AUTOMATION!
This is my simple to use E2 Gyropod, features include:
  • Engine Effects!
  • Sounds!
  • Automatic Parenting!
  • No wiring!
  • Inertia!
  • Low Lag!
  • Acceleration!

Instructions -
STEP 1: Place the E2 on a forward-facing prop that you want as your parent.
STEP 2: Fly your ship.

Please do not redistribute without asking. If you do give it to someone then insure to include credits to me.

E2 Gyropod v3
@name E2 Gyropod v3.1
persist [AngVel AngMult]:angle SpeedLimit Massmem Acceleration Speed Strafeud Strafelr Deadzone RollYaw
persist [Engines Enabled PodControler]:table [Base Chair]:entity Constraints:array Active InChair WaitingForActivate ActivateKey:string
outputs Lvec:vector Ops
runOnChat(1)

if(dupefinished()){reset()}
elseif(first()){
    #Set Your Multipliers Or You Are Dumb.
    #This is in FIGHTER FLIGHT mode right now, if you try to fly a capital
    #you will spaz out and explode.
    #AngMult(Pitch, Yaw, Roll)
    AngMult = ang(7,5,5)
    #This is your maximum speed, don't set it any higher than 3500 unless you know what you're doing.
    SpeedLimit = 3500
    #This controls how fast you accelerate and decelerate, only set it to numbers between 1 and 0.
    Acceleration = 0.01
    #This controls the minimum amount of aiming you need to do to turn. Defaults to 2.5.
    Deadzone = 2.5
    #Should we use roll instead of yaw by default?
    RollYaw = 1
    #Should we automatically parent the ship? Defaults to on!
    AutoParent = 0
    #Should we try to detect a chair? Defaults to on, use !setchair to change the chair.
    AutoChair = 1
    #What key makes the vehicle turn on? Defaults to spacebar
    ActivateKey = "Space"
    
    entity():combatImmune(1)
    
    ###############
    #END OF CONFIG#
    ###############
    function void parentShip(){
        if(Base:isValid()){
            print("Begining parenting!")
            Constraints = Base:getConstraints()
            Massmem=50000
            Base:setMass(50000)
            
            local CurEnt = noentity()
            
            for(I=1, Constraints:count()){
                CurEnt = Constraints[I, entity]
                
                if(CurEnt:isValid()&CurEnt!=Base){
                    #freeze
                    CurEnt:freeze()
                    
                    #unconstrain
                    CurEnt:unConstrain()
                    
                    #auto weight
                    if(CurEnt:isVehicle()){
                        CurEnt:setMass(5000)
                    }else{
                        CurEnt:setMass(1)
                    }
                    
                    CurEnt:propEnableDrag(0)
                    CurEnt:propGravity(0)
                    
                    Massmem += CurEnt:mass()
                    
                    #auto parent
                    if(!CurEnt:isVehicle()){CurEnt:parentTo(Base)}
                }
            }

            #auto weld
            timer("doweld", 100)
            
            print("Parenting completed!")
        }else{
            print("Unable to find base!")
        }
    }
    
    function void dokeys(){
        if(Chair:isValid()){
            Driver = Chair:driver()
            
            if(Driver:isValid()){
                PodControler["W", number] = Driver:keyForward()
                PodControler["A", number] = Driver:keyLeft()
                PodControler["S", number] = Driver:keyBack()
                PodControler["D", number] = Driver:keyRight()
                PodControler["R", number] = Driver:keyReload()
                PodControler["M1", number] = Driver:keyAttack1()
                PodControler["M2", number] = Driver:keyAttack2()
                PodControler["Space", number] = Driver:keyJump()
                PodControler["Shift", number] = Driver:keySprint()
                PodControler["Alt", number] = Driver:keyWalk()
                PodControler["Ctrl", number] = Driver:keyDuck()
                PodControler["Next Weapon", number] = Driver:keyWeapon1()
                PodControler["Previous Weapon", number] = Driver:keyWeapon2()
                PodControler["Active", number] = 1
                PodControler["Chair", entity] = Chair
            }
        }else{
            PodControler["W", number] = 0
            PodControler["A", number] = 0
            PodControler["S", number] = 0
            PodControler["D", number] = 0
            PodControler["R", number] = 0
            PodControler["M1", number] = 0
            PodControler["M2", number] = 0
            PodControler["Space", number] = 0
            PodControler["Shift", number] = 0
            PodControler["Alt", number] = 0
            PodControler["Ctrl", number] = 0
            PodControler["Next Weapon", number] = 0
            PodControler["Previous Weapon", number] = 0
            PodControler["Active", number] = 0
            PodControler["Chair", entity] = Chair
        }
    }
    
    function void enableEngines(){
        local Constraints = entity():getConstraints()
        local CurEngine = table()
        local CurLight = table()
        local CurTable = table()
        local ID = 0
        
        for(I=1, Constraints:count()){
            for(K=1, Engines:count()){
                CurEngine = Engines[K, table]
                if(Constraints[I, entity]:model():find(CurEngine["model", string])){
                    CurTable = CurEngine["lights", table]
                    
                    for(C=1, CurEngine["lights", table]:count()){
                        CurLight = CurTable[C, table]
                        ID = Enabled:count()+1
                        
                        Enabled[ID, number] = 1
                        
                        lightCreate(ID)
                        lightPos(ID,Constraints[I, entity]:toWorld(CurLight["pos", vector]))
                        lightBrightness(ID, CurLight["brightness", number])
                        lightDistance(ID, CurLight["distance", number])
                        lightColor(ID,CurLight["color", vector])
                        lightParent(ID,Constraints[I, entity])
                        
                        holoCreate(ID, Constraints[I, entity]:toWorld(CurLight["pos", vector]), vec(1,1,1)*0.01)
                        holoParent(ID, Constraints[I, entity])
                        holoMaterial(ID, "sprites/muzzleflash4")
                        holoEntity(ID):setTrails(CurLight["distance", number]/10,0,CurLight["distance", number]/500,"trails/laser",CurLight["color", vector],255)
                        
                        drawSprite(1000+ID,"sprites/muzzleflash4",Constraints[I, entity]:toWorld(CurLight["pos", vector]),CurLight["distance", number]/12,CurLight["distance", number]/12,CurLight["color", vector],255,Constraints[I, entity])
                        
                    }
                }
            }
        }
    }
    
    function void disableEngines(){
        for(I=1, Enabled:count()){
            lightRemove(I)
            removeSprite(1000+I)
        }
        
        Enabled = table()
    }
    
    function void movement(){
        if(Base:isValid()){
            Forward = PodControler["W", number]
            Backwards = PodControler["S", number]
            Left = PodControler["A", number]
            Right = PodControler["D", number]
            Up = PodControler["Space", number]
            Down = PodControler["Alt", number]
            Roll = PodControler["Shift", number]
            Level = PodControler["R", number]
            
            if(Forward == 0&Backwards == 0){
                Speed = Speed*(1-Acceleration)
            }elseif(Backwards >= 1){
                Speed = Speed - (SpeedLimit*Acceleration)
            }elseif(Forward >= 1){
                Speed = Speed + (SpeedLimit*Acceleration)
            }
            
            if(Up == 0&Down == 0){
                Strafeud = Strafeud*(1-Acceleration)
            }elseif(Down >= 1){
                Strafeud = Strafeud - (SpeedLimit*Acceleration)
            }elseif(Up >= 1){  
                Strafeud = Strafeud + (SpeedLimit*Acceleration)
            }
            
            if(Right == 0&Left == 0){
                Strafelr = Strafelr*(1-Acceleration)
            }elseif(Left >= 1){
                Strafelr = Strafelr + (SpeedLimit*Acceleration)
            }elseif(Right >= 1){  
                Strafelr = Strafelr - (SpeedLimit*Acceleration)
            }
            
            Speed = clamp(Speed, -SpeedLimit, SpeedLimit)
            Strafelr = clamp(Strafelr, -SpeedLimit, SpeedLimit)
            Strafeud = clamp(Strafeud, -SpeedLimit, SpeedLimit)
            
            Vvec = vec(Speed, Strafelr/5, Strafeud/5):rotate(Base:angles())
            Vel = Base:vel()
            
            if(Vvec != vec(0,0,0)){
                Base:setVel(Vvec)
            }else{
                Base:setVel(Vel * 0.95)
            }
            if(Level == 0){
                if((RollYaw ? !Roll : Roll) == 1){
                    Angles = ang(-clamp((abs(Base:elevation(Lvec)) > Deadzone ? Base:elevation(Lvec) : 0), -90, 90), 0, clamp((abs(Base:bearing(Lvec)) > Deadzone ? Base:bearing(Lvec) : 0), -45, 45))
                }else{
                    Angles = ang(-clamp((abs(Base:elevation(Lvec)) > Deadzone ? Base:elevation(Lvec) : 0), -90, 90), -clamp((abs(Base:bearing(Lvec)) > Deadzone ? Base:bearing(Lvec) : 0), -90, 90), -angnorm(Base:angles()):roll())
                }
            } elseif (Level >= 1) {
                Angles = ang(-Base:angles():pitch(), -clamp((abs(Base:bearing(Lvec)) > Deadzone ? Base:bearing(Lvec) : 0), -90, 90), -angnorm(Base:angles():roll()))
            }
        
            Base:setAngVel(shiftR((Angles*AngMult) - Base:angVel()))
            Chair:driver():setPos(Chair:pos())
        }
        
        if(Active){timer(10, 1, "MOVEMENT", "movement()")}
    }
    
    function void view(){
        rangerHitEntities(0)
        Ranger = rangerOffset(216384, Base:boxCenterW(), Chair:driver():eye())
        Lvec=Ranger:pos()
        
        dokeys()
        
        soundPitch(1,Base:vel():length() / 4)
        
        if(Active){timer(20, 1, "VIEW", "view()")}
    }
    
    function void activeCheck(){
        Base:propGravity(0)
        Chair:propGravity(0)
        Ops = ops()
        
        InChair = Chair:driver():isValid()
        
        if(changed(InChair)&InChair){
            WaitingForActivate = 1
            Chair:printDriver("Please press '" + ActivateKey + "' to engage the gyropod!")
        }elseif(InChair&WaitingForActivate){
            dokeys()
            
            if(PodControler[ActivateKey, number]){
                WaitingForActivate = 0
                Active = 1
            }
        }elseif(!InChair){
            WaitingForActivate = 0
            Active = 0
        }
        
        if(changed(Active)&Active&entity():parent():isValid()){
            enableEngines() 
            Base:unFreeze() 
            Chair:unFreeze() 
            Base:soundPlay(1, 0, "ambient/atmosphere/underground_hall_loop1.wav")
            
            timer(25, 1, "MOVEMENT", "movement()" )
            timer(50, 1, "VIEW", "view()")
        }elseif(changed(Active)&!Active){
            disableEngines()
            soundStop(1)
            Base:freeze()
            Chair:freeze()
            
            Speed = 0
            Strafeud = 0
            Strafelr = 0
        }
    }
    
    timer(100, 0, "ACTIVE", "activeCheck()")
    
    Base = entity():isWeldedTo()
    Hvec=Base:pos()
    Lvec=Base:toWorld(Base:forward())
    
    if(AutoChair&Base){
        local Const = Base:getConstraints()
        
        for(I=1,Const:count()){
            if(Const[I, entity]:isVehicle()){
                Chair = Const[I, entity]
                print("Found chair, setting driver position!")
                break
            }
        }
    }
    
    if(AutoParent&Base){
        parentShip()
    }

    PodControler["W", number] = 0
    PodControler["A", number] = 0
    PodControler["S", number] = 0
    PodControler["D", number] = 0
    PodControler["R", number] = 0
    PodControler["M1", number] = 0
    PodControler["M2", number] = 0
    PodControler["Space", number] = 0
    PodControler["Shift", number] = 0
    PodControler["Alt", number] = 0
    PodControler["Ctrl", number] = 0
    PodControler["Next Weapon", number] = 0
    PodControler["Previous Weapon", number] = 0
    PodControler["Active", number] = 0
    PodControler["Chair", entity] = noentity()
    
    Engines[1, table] = table()
    Engines[1, table]["lights", table] = table()
    Engines[1, table]["lights", table][1, table] = table()
    Engines[1, table]["lights", table][2, table] = table()
    Engines[1, table]["model", string] = "models/spacebuild/emount2_milcock4.mdl"
    Engines[1, table]["lights", table][1, table]["pos", vector] = vec(-196, 0, -23)
    Engines[1, table]["lights", table][1, table]["color", vector] = vec(255,100,0)
    Engines[1, table]["lights", table][1, table]["brightness", number] = 100
    Engines[1, table]["lights", table][1, table]["distance", number] = 1000
    Engines[1, table]["lights", table][2, table]["pos", vector] = vec(-258, 0, 36)
    Engines[1, table]["lights", table][2, table]["color", vector] = vec(255,100,0)
    Engines[1, table]["lights", table][2, table]["brightness", number] = 100
    Engines[1, table]["lights", table][2, table]["distance", number] = 1000
    
    Enabled = table()

}elseif(chatClk(owner()) & owner():lastSaid():lower() == "!setchair"){
    hideChat(1)
    Trace = owner():eyeTrace()
    
    if(Trace:entity()){
        Chair = Trace:entity()
        print("Set chair to "+toString(Trace:entity()))
    }
}elseif(clk("doweld")){
    for(I=1, Constraints:count()){
        Constraints[I, entity]:weld(Base)
    }
}

Older Versions
E2 Gyropod v2 Final - because some people like this version more
@name E2 Gyropod v2 Final
persist [AngVel AngMult]:angle [Lvec]:vector ThrustMult Massmem Acceleration Speed Strafeud Strafelr
persist [Engines Enabled PodControler]:table [Base Chair]:entity Constraints:array
runOnChat(1)

Active = Chair:driver():isValid()

if(dupefinished()){reset()}
elseif(first()){
    #Set Your Multipliers Or You Are Dumb.
    #This is in FIGHTER FLIGHT mode right now, if you try to fly a capital
    #you will spaz out and explode.
    #AngMult(Pitch, Yaw, Roll)
    AngMult = ang(12,12,8)
    #Your speed is multiplied by this; I don't recommend setting it higher than 12.
    ThrustMult = 16
    #This controls how fast you accelerate and decelerate, only set it to numbers between 1 and 0.
    Acceleration = 0.01
    #Should we automatically parent the ship? Defaults to on!
    AutoParent = 1
    #Should we try to detect a chair? Defaults to on, use !setchair to change the chair.
    AutoChair = 1
   
    ###############
    #END OF CONFIG#
    ###############
    
    function void parentShip(){
        if(Base:isValid()){
            print("Begining parenting!")
            Constraints = Base:getConstraints()
            local CurEnt = noentity()
    
            for(I=1, Constraints:count()){
                CurEnt = Constraints[I, entity]
               
                if(CurEnt:isValid()&CurEnt != Base&!CurEnt:parent():isValid()){
                    #freeze
                    CurEnt:freeze()
                   
                    #unconstrain
                    CurEnt:unConstrain()
                   
                    #auto weight
                    if(CurEnt == Base){
                        CurEnt:setMass(50000)
                    }elseif(CurEnt:type() == "prop_physics" | CurEnt:type() == "prop_physics_multiplayer"){
                        CurEnt:setMass(200)
                    }else{
                        local Type = CurEnt:type():lower()
                       
                        if(Type:find("resource") | Type:find("storage") | Type:find("gen") | Type:find("regulator") | Type:find("gyropod")){
                            CurEnt:setMass(50)
                        }else{
                            CurEnt:setMass(1)
                        }
                    }
                   
                    #auto parent
                    if(!CurEnt:isVehicle()){CurEnt:parentTo(Base)}
                }
            }
           
            #auto weld
            timer("doweld", 100)
           
            print("Parenting completed!")
        }else{
            print("Unable to find base!")
        }
    }
    
    function void dokeys(){
        if(Chair:isValid()){
            Driver = Chair:driver()
           
            if(Driver:isValid()){
                PodControler["W", number] = Driver:keyForward()
                PodControler["A", number] = Driver:keyLeft()
                PodControler["S", number] = Driver:keyBack()
                PodControler["D", number] = Driver:keyRight()
                PodControler["R", number] = Driver:keyReload()
                PodControler["M1", number] = Driver:keyAttack1()
                PodControler["M2", number] = Driver:keyAttack2()
                PodControler["Space", number] = Driver:keyJump()
                PodControler["Shift", number] = Driver:keySprint()
                PodControler["Alt", number] = Driver:keyWalk()
                PodControler["Next Weapon", number] = Driver:keyWeapon1()
                PodControler["Previous Weapon", number] = Driver:keyWeapon2()
                PodControler["Active", number] = 1
                PodControler["Chair", entity] = Chair
            }
        }else{
            PodControler["W", number] = 0
            PodControler["A", number] = 0
            PodControler["S", number] = 0
            PodControler["D", number] = 0
            PodControler["R", number] = 0
            PodControler["M1", number] = 0
            PodControler["M2", number] = 0
            PodControler["Space", number] = 0
            PodControler["Shift", number] = 0
            PodControler["Alt", number] = 0
            PodControler["Next Weapon", number] = 0
            PodControler["Previous Weapon", number] = 0
            PodControler["Active", number] = 0
            PodControler["Chair", entity] = Chair
        }
    }
    
    function void enableEngines(){
        local Constraints = entity():getConstraints()
        local CurEngine = table()
        local CurLight = table()
        local CurTable = table()
        local ID = 0
       
        for(I=1, Constraints:count()){
            for(K=1, Engines:count()){
                CurEngine = Engines[K, table]
                if(Constraints[I, entity]:model():find(CurEngine["model", string])){
                    CurTable = CurEngine["lights", table]
                   
                    for(C=1, CurEngine["lights", table]:count()){
                        CurLight = CurTable[C, table]
                        ID = Enabled:count()+1
                       
                        Enabled[ID, number] = 1
                       
                        lightCreate(ID)
                        lightPos(ID,Constraints[I, entity]:toWorld(CurLight["pos", vector]))
                        lightBrightness(ID, CurLight["brightness", number])
                        lightDistance(ID, CurLight["distance", number])
                        lightColor(ID,CurLight["color", vector])
                        lightParent(ID,Constraints[I, entity])
                       
                        holoCreate(ID, Constraints[I, entity]:toWorld(CurLight["pos", vector]), vec(1,1,1)*0.01)
                        holoParent(ID, Constraints[I, entity])
                        holoMaterial(ID, "sprites/muzzleflash4")
                        holoEntity(ID):setTrails(CurLight["distance", number]/10,0,CurLight["distance", number]/500,"trails/laser",CurLight["color", vector],255)
                       
                        drawSprite(1000+ID,"sprites/muzzleflash4",Constraints[I, entity]:toWorld(CurLight["pos", vector]),CurLight["distance", number]/12,CurLight["distance", number]/12,CurLight["color", vector],255,Constraints[I, entity])
                       
                    }
                }
            }
        }
    }
    
    function void disableEngines(){
        for(I=1, Enabled:count()){
            lightRemove(I)
            removeSprite(1000+I)
        }
       
        Enabled = table()
    }
    
    Base = entity():isWeldedTo()
    Hvec=Base:pos()
    Svec=Base:toWorld(Base:forward())
   
    if(AutoParent&Base){
        parentShip()
    }
   
    if(AutoChair&Base){
        local Const = Base:getConstraints()
       
        for(I=1,Const:count()){
            if(Const[I, entity]:isVehicle()){
                Chair = Const[I, entity]
                print("Found chair, setting driver position!")
                break
            }
        }
    }
   
    Massmem=10000
    Base:setMass(50000)

    PodControler["W", number] = 0
    PodControler["A", number] = 0
    PodControler["S", number] = 0
    PodControler["D", number] = 0
    PodControler["R", number] = 0
    PodControler["M1", number] = 0
    PodControler["M2", number] = 0
    PodControler["Space", number] = 0
    PodControler["Shift", number] = 0
    PodControler["Alt", number] = 0
    PodControler["Next Weapon", number] = 0
    PodControler["Previous Weapon", number] = 0
    PodControler["Active", number] = 0
    PodControler["Chair", entity] = noentity()
   
    Engines[1, table] = table()
    Engines[1, table]["lights", table] = table()
    Engines[1, table]["lights", table][1, table] = table()
    Engines[1, table]["lights", table][2, table] = table()
    Engines[1, table]["model", string] = "models/spacebuild/emount2_milcock4.mdl"
    Engines[1, table]["lights", table][1, table]["pos", vector] = vec(-196, 0, -23)
    Engines[1, table]["lights", table][1, table]["color", vector] = vec(255,100,0)
    Engines[1, table]["lights", table][1, table]["brightness", number] = 100
    Engines[1, table]["lights", table][1, table]["distance", number] = 1000
    Engines[1, table]["lights", table][2, table]["pos", vector] = vec(-258, 0, 36)
    Engines[1, table]["lights", table][2, table]["color", vector] = vec(255,100,0)
    Engines[1, table]["lights", table][2, table]["brightness", number] = 100
    Engines[1, table]["lights", table][2, table]["distance", number] = 1000
   
    Enabled = table()

}elseif(changed(Active)&Active == 1){timer("VIEW", 100) enableEngines() Base:soundPlay(1, 0, "ambient/atmosphere/underground_hall_loop1.wav")}
elseif((Active == 1&entity():parent():isValid()&clk("VIEW"))){
    rangerHitEntities(0)
    Ranger = rangerOffset(216384, Chair:driver():shootPos(), Chair:driver():eye())
    Lvec=Ranger:pos()
   
    Base:unFreeze()

    timer("VIEW", 50)
}elseif(chatClk(owner()) & owner():lastSaid():lower() == "!setchair"){
    hideChat(1)
    Trace = owner():eyeTrace()
   
    if(Trace:entity()){
        Chair = Trace:entity()
        print("Set chair to "+toString(Trace:entity()))
    }
}elseif(clk("doweld")){
    for(I=1, Constraints:count()){
        Constraints[I, entity]:weld(Base)
    }
}elseif(Active == 0){stoptimer("VIEW") disableEngines()}

if(Active == 1 & Base & entity():parent():isValid()){
    interval(25)
    
    dokeys()
    
    soundPitch(1,Base:vel():length() / 4 + 70)
   
    Forward = PodControler["W", number]
    Backwards = PodControler["S", number]
    Left = PodControler["A", number]
    Right = PodControler["D", number]
    Up = PodControler["Space", number]
    Down = PodControler["Alt", number]
    RollLeft = 0
    RollRight = 0
    Level = PodControler["R", number]
   
    FWD=Base:forward():normalized()
   
    if(Forward == 0&Backwards == 0){
        Speed = Speed*0.95
       
        if(Speed > -1||Speed < 1){Speed = 0}
    }elseif(Backwards >= 1){
        if(Speed > -ThrustMult){
            Speed = Speed + (-ThrustMult*Acceleration)
        }else{
            Speed = -ThrustMult
        }
    }elseif(Forward >= 1){ 
        if(Speed < ThrustMult){
            Speed = Speed + (ThrustMult*Acceleration)
        }else{
            Speed = ThrustMult
        }
    }
   
    if(Up == 0&Down == 0){
        Strafeud = Strafeud*0.95
       
        if(Strafeud > -1||Strafeud < 1){Strafeud = 0}
    }elseif(Down >= 1){
        if(Strafeud > -ThrustMult){
            Strafeud = Strafeud + (-ThrustMult*Acceleration)
        }else{
            Strafeud = -ThrustMult
        }
    }elseif(Up >= 1){ 
        if(Strafeud < ThrustMult){
            Strafeud = Strafeud + (ThrustMult*Acceleration)
        }else{
            Strafeud = ThrustMult
        }
    }
   
    if(Right == 0&Left == 0){
        Strafelr = Strafelr*0.95
       
        if(Strafelr > -1||Strafelr < 1){Strafelr = 0}
    }elseif(Left >= 1){
        if(Strafelr > -ThrustMult){
            Strafelr = Strafelr + (-ThrustMult*Acceleration)
        }else{
            Strafelr = -ThrustMult
        }
    }elseif(Right >= 1){ 
        if(Strafelr < ThrustMult){
            Strafelr = Strafelr + (ThrustMult*Acceleration)
        }else{
            Strafelr = ThrustMult
        }
    }
   
    Svec = Lvec
   
    if(Level == 0){
        Rolli=-angnorm(Base:angles():roll())/2
        Angles = ang(-(Base:elevation(Svec)), -Base:bearing(Svec), Rolli)
    } elseif (Level >= 1) {
        Angles = ang(-Base:angles():pitch(), -Base:bearing(Svec), -angnorm(Base:angles():roll()))
    }
   
    AngVel = angnorm(Angles)
   
    Hvecd=(FWD*Speed)+(Base:up()*Strafeud*0.75)+(Base:right()*Strafelr*0.75)
    Hvecd+=$Hvecd
   
    Vel = Base:vel()
   
    if(Hvecd != vec(0,0,0)){
        Base:setVel((Hvecd*Massmem*0.04)-(Vel*0.95))
    }else{
        Base:propGravity(0)
        Base:setVel(Vel*0.95)
    }
        Base:setAngVel(shiftR(Angles*AngMult)*0.25)
       
}else{
    Base:freeze()
    soundStop(1)
    interval(1000)
}
Update: Version 2.1.4 RELEASED ;D
Update 2: Version 3.0 released, also released V2 Final.
Post edited by Unknown User on
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!

Comments

  • xX Lord Anubis XxxX Lord Anubis Xx Posts: 170Registered
    I remember either Mr.Stump or Kanzuke (Or some other person) saying that the gyros never lagged like this in other servers. He came to the conclusion that is was somehow related to the Gyropod fuel system we have. Maybe you could take a look at it?
    Every Human Being has some capacity for evil. It's just that some Humans have a greater capacity for evil than others.
  • AmaroqAmaroq Posts: 451Registered, Administrator
    I remember either Mr.Stump or Kanzuke (Or some other person) saying that the gyros never lagged like this in other servers. He came to the conclusion that is was somehow related to the Gyropod fuel system we have. Maybe you could take a look at it?

    It is extremely unlikely. The fuel system is extremely simple, only about 10-ish lines of code, that run once every second. And they're only basic number-checks. If number is X then Drain X-fuel.

    Our Gyropod is much different than the one that other servers have, not just because of the fuel system. Most other server's Gyros are technically outdated, since the person who made them used to come here pretty damn often. The public version is an old one.

    It probably has to do with features and whatnot.
  • AmaroqAmaroq Posts: 451Registered, Administrator
    This discourages use of fuel.. kind of gets around it. Well.. I dunno.
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Amaroq wrote:
    This discourages use of fuel.. kind of gets around it. Well.. I dunno.
    Honestly, it's mostly for small fighters and drones that can't hold much PN fuel or energy. I use it mainly because, in my opinion, it flies a lot nicer than the adv. gyropod does.
    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!
  • AmaroqAmaroq Posts: 451Registered, Administrator
    Checked out the code in your E2. Looks good overall, but you should use :setVel and :setAngVel instead. Requires less math for the E2, and is easier on the server.
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Amaroq wrote:
    Checked out the code in your E2. Looks good overall, but you should use :setVel and :setAngVel instead. Requires less math for the E2, and is easier on the server.
    I intend to switch over to that in the next version of the E2, shouldn't be long before I do that.
    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!
  • SteeveeoSteeveeo Posts: 848Registered, Administrator
    Could probably simulate fuel usage if you wire the fuel tanks to vent at about the same rate. I don't know if that functionality has been added to the fuel tanks or not, but it could probably be added easily.
  • KanzukeKanzuke Posts: 181Registered, Moderator
    Steeveeo wrote:
    Could probably simulate fuel usage if you wire the fuel tanks to vent at about the same rate. I don't know if that functionality has been added to the fuel tanks or not, but it could probably be added easily.

    If he added that to the code people would just unwire the tanks and take out the relevant code. You'd only get to balance it for the people who have no idea how to code E2, and most of them will just stick with a gyro

    Lambda217: oh oh i am kanzuke and i love my little pony and now i'll make all the brandonphysics myself cause i know fuckin everything because now i'll make a big pony fighter drone squad and a big fuckin portal ship and i am a fuckin idiot
  • AmaroqAmaroq Posts: 451Registered, Administrator
    Kanzuke wrote:
    If he added that to the code people would just unwire the tanks and take out the relevant code. You'd only get to balance it for the people who have no idea how to code E2, and most of them will just stick with a gyro

    Like I said, people seem to play on Easymodo, when they can. Kind of defeats the point I think, but whatever.
  • Nielk1Nielk1 Posts: 252Registered, Administrator
    For one, most people who use an E2 movement chip made by someone else are not very good themselves at E2, thus if the chip was coded to actively detect the storage container it would work quite well as most able to find all the little hooks and tendrils that would cause would have just made their own movement chip fit to their preferences.

    That said, as it is much of our restrictions are passive, the only hard limits that are really in is because people can't be arsed not to make server killer ships with more weapons than seven planets combined.
  • KanzukeKanzuke Posts: 181Registered, Moderator
    this gyropod is crap no matter what i do it just spazzes around like a fly haveing mid air sex

    You probably aren't parenting it properly, for me this chip has flown everything from fighter to titan. You need to place the chip on the biggest prop on your ship, make sure that prop is facing forwards, and then parent the ship to that prop, if it still spazzes then then the prop isn't big enough, or the ship is weighted poorly, in which case set the weight of everything apart from the parent to 1.

    Lambda217: oh oh i am kanzuke and i love my little pony and now i'll make all the brandonphysics myself cause i know fuckin everything because now i'll make a big pony fighter drone squad and a big fuckin portal ship and i am a fuckin idiot
  • daniel11111112daniel11111112 Posts: 6Registered
    Kanzuke wrote:
    this gyropod is crap no matter what i do it just spazzes around like a fly haveing mid air sex

    You probably aren't parenting it properly, for me this chip has flown everything from fighter to titan. You need to place the chip on the biggest prop on your ship, make sure that prop is facing forwards, and then parent the ship to that prop, if it still spazzes then then the prop isn't big enough, or the ship is weighted poorly, in which case set the weight of everything apart from the parent to 1.

    i tried this and all i got was a ship that points towards 0,0,0 and then drives towards it in weird angles and spinny motions against my controll
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Kanzuke wrote:
    this gyropod is crap no matter what i do it just spazzes around like a fly haveing mid air sex

    You probably aren't parenting it properly, for me this chip has flown everything from fighter to titan. You need to place the chip on the biggest prop on your ship, make sure that prop is facing forwards, and then parent the ship to that prop, if it still spazzes then then the prop isn't big enough, or the ship is weighted poorly, in which case set the weight of everything apart from the parent to 1.

    i tried this and all i got was a ship that points towards 0,0,0 and then drives towards it in weird angles and spinny motions against my controll
    You obviously didn't read the setup properly, that only happens if you didn't follow step 2 correctly. If Viewmode is 2 and you didn't supply a world vector for the aimvec then it will aim at (0, 0, 0). This would also happen if you wired Viewmode to 1 and didn't sit in the chair wired to the Chair input while the gyro was on.
    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!
  • xX Lord Anubis XxxX Lord Anubis Xx Posts: 170Registered
    Just wanted to point out, getting fuel for the gyro is so damn easy it's trivial. Might as well not have it there in the first place.
    Every Human Being has some capacity for evil. It's just that some Humans have a greater capacity for evil than others.
  • AmaroqAmaroq Posts: 451Registered, Administrator
    Just wanted to point out, getting fuel for the gyro is so damn easy it's trivial. Might as well not have it there in the first place.

    It's only easy if you're boring about it. AKA, drones and teleporting gatherers.
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Amaroq wrote:
    Just wanted to point out, getting fuel for the gyro is so damn easy it's trivial. Might as well not have it there in the first place.

    It's only easy if you're boring about it. AKA, drones and teleporting gatherers.
    No its pretty easy either way, the gyropods never did use much fuel lol.
    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!
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Amaroq wrote:
    Just wanted to point out, getting fuel for the gyro is so damn easy it's trivial. Might as well not have it there in the first place.

    It's only easy if you're boring about it. AKA, drones and teleporting gatherers.
    Btw, I've never used any teleporting miners or drones etc.
    Make your own thread if you people want to continue your useless bullshit that keeps coming up in my thread kthx.
    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!
  • NinjrKillrNinjrKillr Posts: 192Registered
    Very well. Due to unnecessary spam I've cleaned up the thread of irrelevant posts.

    "We fear that which we cannot see... we respect that which we cannot see... thus the blade will be wielded."

    Urahara_Bleach_Signature_by_Harty73.png
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Version 2 bitches, check dis shit.
    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!
  • orrilaorrila Posts: 3Registered
    Hi it seems as if posting once didn't work.
    If an admin would be able to give me pm capabilities I'd be most grateful.
    Thanks
    Have Fun
    -Orrila

    P.S. not correct thread, I know. But the only one the stupid parental controls I have on my laptop would let me see.
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    orrila wrote:
    Hi it seems as if posting once didn't work.
    If an admin would be able to give me pm capabilities I'd be most grateful.
    Thanks
    Have Fun
    -Orrila

    P.S. not correct thread, I know. But the only one the stupid parental controls I have on my laptop would let me see.
    You did get another post through, and as far as I'm aware everyone has PM permissions by default. I'll have someone check it out for you.
    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!
  • orrilaorrila Posts: 3Registered
    Thanks for the help.
    Btw, the other post was on the tablet, that's why.

    Have fun
    Thanks
    -Orrila
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Bump for new version.
    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!
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    Bump for v3.1
    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!

Leave a Comment

bolditalicunderlinestrikecodeimageurlquotespoiler
Drop image/file