1. Post #1
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    Remake
    My old E2 thread called "I'll make E2s for you guys!" was removed (Due to some sort of bug. Wasn't a moderator), so I decided to make a new one.

    A minute for lost E2s
    Let's all take a minute for all the 8 pages full of awesome E2s that were lost with the old thread (Ahem.. or not xD)

    Ask for E2s
    Basically, ask for an E2 and I'll try to make it, as long as it isn't too hard.
    Remember, I'm only one guy. I can't make too complicated stuff, and I can't make E2s for 5 people at once.

    Your own E2s
    You're welcome to help me help other people by posting your own creations using ideas from this thread.
    If you do, be prepared that I might optimize it and/or give positive feedback. If you for some reason don't like this, then don't post your E2s.

    Thanks
    Thanks to everyone who helped me in the old thread, and prevented it from turning into another flame war. Keep up the good job in this new thread!

    Allright, let's go!
    Reply With Quote Edit / Delete Reply Sweden Show Events Friendly Friendly x 24Agree Agree x 1Funny Funny x 1 (list)

  2. Post #2
    Gold Member
    Carlisle's Avatar
    March 2009
    1,164 Posts
    I wonder why the old thread was vaporized.

    if you want, I can post some of the E2's I got out of the old thread
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 1Agree Agree x 1 (list)

  3. Post #3
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    I wonder why the old thread was vaporized.

    if you want, I can post some of the E2's I got out of the old thread
    Yeah do that.

  4. Post #4
    Gold Member
    Balto-the-Wolf-Dog's Avatar
    June 2009
    1,817 Posts
    Hey Ill post as many as I got from the thread (all that intrested me)
    (that was an amazing thread *takes off hat and bows*)
    ------------And can you make an E2 that will act as a gyroscope? (dampen pitch, yaw, and roll)-------------------------



    Now for the lost codes (I know this is long but here you go, sorry). Here is the applyforce hoverer Dirivan mande for me:

    Code:
    @name Hoverer..er
    @persist E:entity Dist:vector HoverHeight
    if (first()|duped()) {
        #Change the hover height here. Or make yourself an input for it.
        HoverHeight = 100
        E = entity():isWeldedTo()
        runOnTick(1)
    }
    
    #Rangerfilter the prop
    rangerFilter(E)
    #Get ranger data
    Ranger = rangerOffset(E:massCenter(),E:massCenter()-HoverHeight+1)
    #If the ranger hit..
    if (Ranger:hit()) {
        #Get the distance force
        Dist = vec(0,0,HoverHeight-Ranger:distance())
        #Apply the force
        E:applyForce((Dist*10-E:vel())*E:mass()*vec(0,0,1)) 
        #If you remove * vec(0,0,1) it will prevent left/right/forward/back movement.
    }
    
    #Bonus! NOTE: ADVANCED! I suggest you ignore this if you don't understand it..
    #Uncomment below for some applyTorque quaterniton stabilization :P
    #You will probably have to change the multipliers first.
    #Mul1 = 50
    #Mul2 = 2
    #Torque = E:toLocal(rotationVector((quat(ang(0,0,0))/quat(E)))+E:massCenter())
    #E:applyTorque((Torque*Mul1-E:angVelVector()*Mul2)*E:inertia()*!E:isPlayerHolding())

    Now for an E2 that makes props circle your head than launch at your crosshair on secondary fire:
    Code:
    @name Prop Circle
    @persist Ent1:entity Ent2:entity Ent3:entity Ent4:entity Ent5:entity Ent6:entity
    @persist Pos1:vector Pos2:vector Pos3:vector Pos4:vector Pos5:vector Pos6:vector
    @persist Mode:string Nr C M DontSearch K
    @trigger all
    
    
    # Hello! This expression was made by Divran.
    # Controls:
    # Mouse2 to shoot the prop. Sorry, it's not 100% accurate. :(
    # Crouch + Mouse2 to manually rescan ALL the props (Drops them all then rescans)
    # Walk up to a prop to automatically pick it up.
    # It only targets and only works on your own props.
    # Have fun!
    
    #Don't change anything below here.
    
    runOnTick(1)
    
    #Auto Rescan
    if (clk("Rescan")) {
        findClearBlackList()
        findClearWhiteList()
        findIncludePlayerProps(owner())
        findExcludeEntity(Ent1), findExcludeEntity(Ent2), findExcludeEntity(Ent3), findExcludeEntity(Ent4), findExcludeEntity(Ent5), findExcludeEntity(Ent6)
        findByClass("prop_physics")
        findSortByDistance(owner():shootPos())
        if (find():massCenter():distance(owner():shootPos()) < 500) {
            if (Nr == 0) {
                if (find() != noentity()) {Nr = 1,Ent1 = find()}
            } elseif (Nr == 1) {
                if (find() != noentity()) {Nr = 2,Ent2 = find()}
            } elseif (Nr == 2) {
                if (find() != noentity()) {Nr = 3,Ent3 = find()}
            } elseif (Nr == 3) {
                if (find() != noentity()) {Nr = 4,Ent4 = find()}
            } elseif (Nr == 4) {
                if (find() != noentity()) {Nr = 5,Ent5 = find()}
            } elseif (Nr == 5) {
                if (find() != noentity()) {Nr = 6,Ent6 = find()}
            }
        }
    }
    
    #Auto rescan timer
    if (Nr != 6 & !DontSearch) {timer("Rescan",500)}
    #Crouch + Mouse2 rescanning all props
    K = owner():isCrouch()
    if (K & $M == 1) {Ent1 = Ent2 = Ent3 = Ent4 = Ent5 = noentity(), timer("Rescan",1)}
    if (clk("Search")) {DontSearch = 0}
    
    #How many do we have?
    Nr = (Ent1:model()!="")+(Ent2:model()!="")+(Ent3:model()!="")+(Ent4:model()!="")+(Ent5:model()!="")+(Ent6:model()!="")
    
    #Shooting
    M = owner():keyAttack2()
    if ($M == 1) {
        if (Nr == 6) {
            Pos6 = (owner():aimPos()-Ent6:massCenter())* Ent6:inertia():length()^1.5
            Ent6:applyForce(Pos6+$Pos6*5)
            Ent6 = noentity()
        } elseif (Nr == 5) {
            Pos5 = (owner():aimPos()-Ent5:massCenter())* Ent5:inertia():length()^1.5
            Ent5:applyForce(Pos5+$Pos5*5)
            Ent5 = noentity()
        } elseif (Nr == 4) {
            Pos4 = (owner():aimPos()-Ent4:massCenter())* Ent4:inertia():length()^1.5
            Ent4:applyForce(Pos4+$Pos4*5)
            Ent4 = noentity()
        } elseif (Nr == 3) {
            Pos3 = (owner():aimPos()-Ent3:massCenter())* Ent3:inertia():length()^1.5
            Ent3:applyForce(Pos3+$Pos3*5)
            Ent3 = noentity()
        } elseif (Nr == 2) {   
            Pos2 = (owner():aimPos()-Ent2:massCenter())* Ent2:inertia():length()^1.5
            Ent2:applyForce(Pos2+$Pos2*5)
            Ent2 = noentity()
        } elseif (Nr == 1) {   
            Pos1 = (owner():aimPos()-Ent1:massCenter())* Ent1:inertia():length()^1.5
            Ent1:applyForce(Pos1+$Pos1*5)
            Ent1 = noentity()
        }
        #Stop searching for new props for a while, otherwise it will catch the prop in midair as you shoot it.
        DontSearch = 1
        timer("Search",2000)
    } else {
        
        #Flying
        if (Ent1 != noentity()) {
            C = 0
            Circle1 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
            Pos1 = (owner():pos()+vec(0,0,120)+Circle1-Ent1:massCenter())* Ent1:inertia():length()^1.5
            Ent1:applyForce(Pos1+$Pos1*5)
        }
        if (Ent2 != noentity()) {
            if (Nr == 2) {C = 180} elseif (Nr == 3) {C = 120} elseif (Nr == 4) {C = 90} elseif (Nr == 5) {C = 72} elseif (Nr == 6) {C = 60}
            Circle2 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
            Pos2 = (owner():pos()+vec(0,0,120)+Circle2-Ent2:massCenter())* Ent2:inertia():length()^1.5
            Ent2:applyForce(Pos2+$Pos2*5)
        }
        if (Ent3 != noentity()) {
            if (Nr == 3) {C = -120} elseif (Nr == 4) {C = -90} elseif (Nr == 5) {C = -72} elseif (Nr == 6) {C = -60}
            Circle3 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
            Pos3 = (owner():pos()+vec(0,0,120)+Circle3-Ent3:massCenter())* Ent3:inertia():length()^1.5
            Ent3:applyForce(Pos3+$Pos3*5)
        }
        if (Ent4 != noentity()) {
            if (Nr == 4) {C = 180} elseif (Nr == 5) {C = 144} elseif (Nr == 6) {C = 120}
            Circle4 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
            Pos4 = (owner():pos()+vec(0,0,120)+Circle4-Ent4:massCenter())* Ent4:inertia():length()^1.5
            Ent4:applyForce(Pos4+$Pos4*5)
        }
        if (Ent5 != noentity()) {
            if (Nr == 5) {C = -144} elseif (Nr == 6) {C = -120}
            Circle5 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
            Pos5 = (owner():pos()+vec(0,0,120)+Circle5-Ent5:massCenter())* Ent5:inertia():length()^1.5
            Ent5:applyForce(Pos5+$Pos5*5)
        }
        if (Ent6 != noentity()) {
            if (Nr == 6) {C = 180}
            Circle6 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
            Pos6 = (owner():pos()+vec(0,0,120)+Circle6-Ent6:massCenter())* Ent6:inertia():length()^1.5
            Ent6:applyForce(Pos6+$Pos6*5)
        }
    
    }

    Now for a wieght measuring ranger:
    Code:
    @name Ranger Weight
    @outputs Weight
    interval(5000) #Doesn't need to update any faster, really.
    Weight = ranger(200):entity():mass() #Check for an entity 200 units in front of the E2. Change this distance if you want.
    And the advanced wieght measuring ranger:
    Code:
    @name Adv Ranger Weight
    @outputs Weight
    interval(5000) #Doesn't need to update any faster either.
    Ent = ranger(200):entity() #Check for an entity 200 units in front of the E2. Change this distance if you want.
    Props = Ent:getConstraints() #Gets all the props
    Props:pushEntity(Ent) #This was the fix. This adds the Ent to the array.
    Weight = 0 #Resets weight to 0 before calculating
    for(I=1,Props:count()) {Weight+=Props:entity(I):mass()} #Calculates the mass of all the props]
    Now for one that makes props float above you and intercepts RPG's"
    Code:
    @name Auto Anti RPG - AAR
    @inputs Base:entity Prop:entity
    @outputs Mode:string Target:entity
    @persist Mode:string Pos:vector Ang:angle Target:entity Dist Nr DistDetect DistFly
    @trigger all
    runOnTick(1)
    
    if (Nr == 0) {
        #Nr:
        Nr = 1 #If you want to have multiplie AAR's change this Nr. If you have two AAR's, change the Nr of the first one to 1 and the second one to 2.
        DistDetect = 2000 #How far away it will scan
        DistFly = 1300 #How far away it will fly (Make this slightly lower than the detection radius)
    }
    
    if (Mode == "") {Mode = "Scan"}
    #Scanning:
    timer("Rescan",250)
    if (Target == noentity() & clk("Rescan")) {
        findClearWhiteList()
        findClearBlackList()
        findByClass("rpg*")
    }
    if (Mode == "Scan" & Target == noentity()) {
        findSortByDistance(Base:massCenter())
        Dist = findResult(Nr):pos():distance(Base:massCenter())
        if (Dist < DistDetect & findResult(Nr)) {
            Target = findResult(Nr)
            Mode = "Intercept"
       }
    }
    
    
    #Intercepting:
    if (Mode == "Intercept") {
        Dist = find():pos():distance(Base:massCenter())
        Pos = ((Base:massCenter() + ((Target:pos() + vec(0,0,20) - Base:massCenter()) / Dist) * clamp(Dist,200,DistFly)) - Prop:massCenter()) * 3000
        Ang = ang(Prop:elevation(Base:massCenter())+90, Prop:bearing(Base:massCenter()), Prop:angles():roll()) * -8000
        if (!Target | Target == noentity() | Dist > DistDetect) {Mode = "Scan", Target = noentity()}
    } else {
        Pos = (Base:massCenter() + vec(0,0,Nr*20) - Prop:massCenter()) * 3000
        Ang = Prop:angles() * -8000
    }
    
        #Flight:
        Prop:applyForce(Pos+$Pos*7)
        Prop:applyAngForce(Ang+$Ang*10)
    Now for a follower E2:
    Code:
    @name Follower
    @inputs
    @outputs
    @persist Destination:vector CurrentPos:vector Velocity:vector
    @trigger all
    runOnTick(1)
    Destination = owner():pos() + vec(0,0,100)
    CurrentPos = entity():massCenter()
    Velocity = entity():vel()
    entity():applyForce((Destination - CurrentPos) * 50 - Velocity)There are of course other, better ways of doing it. This is just one way. (You may want to change the ^ velocity)
    And and E2 that causes selected props to fly at your crosshair on command with great velocity:
    Code:
    @name MatadorForAll
    @persist E:entity O:entity Hold Attack Dest:vector Vec:vector Ang:angle
    if(first()){
        #Make the angle for the death ball to spin randomly
        A = 45
        Ang = ang(randint(-A,A),randint(-A,A),randint(-A,A)) * 50000
        #Hide the chip
        entity():setColor(0,0,0,0)
        O = owner()
        runOnTick(1)
    }
    
    Pos=E:pos()
    #Spin the ball randomly
    E:applyAngForce(Ang+$Ang*5)
    #Only hover if the owner is alive
    if(O:isAlive()){
        #If holding, then move the chip above the owners head
        if(Hold){
            #Set Destination
            Dest=O:pos()+vec(0,0,(200+E:radius()))
            #If the ball is close, move slowly and accurately
            if(Pos:distance(Dest)<50){
                Attack = 0
                Vec=(Dest-Pos)*E:mass()
                E:applyForce(Vec+$Vec*5)
            }
            #If its far away, move quickly
            else{
                Vec=(Dest-Pos)*E:mass()*Pos:distance(Dest)*50000
                E:applyForce(Vec)
            }
        }
        #If the owner left clicks, start the attack sequence
        if(Attack==0&O:keyAttack1()&E&O:aimEntity()!=E){
            #Just incase it gets stuck
            stoptimer("ManualReset")
            timer("ManualReset",3000)
            Dest=O:aimPos()
            Hold=0
            Attack=1
        }
        #Attack Code - Strikes the spot once
        if(Attack==1){
            Vec=(Dest-Pos)*E:mass()*50000*Pos:distance(Dest)
            E:applyForce(Vec)
            #When the ball reaches its target, go back to holding
            if((Pos:distance(Dest)<20)){
                Attack=2
                Hold=1
            }
        }
        #Attack 2 code - Flys constantly at the spot
        if(O:keyAttack2()&E&O:aimEntity()!=E){
            Attack=0
            Hold=1
            Dest=O:aimPos()
            Vec=(Dest-Pos)*E:mass()*50000*Pos:distance(Dest)
            E:applyForce(Vec)
        }
        if((O:keyUse()|O:keyAttack1()|O:keyAttack2())&!E){
            print("ERROR: No prop selected")
        }
        #If porp is stuck, return to owner
        if(clk("ManualReset")){
            Attack=0
            Hold=1
        }
        #Prop selection code
        if(O:keyUse()&O:aimEntity()&O:aimEntity()!=E){
            #Set the old prop to 5 mass and remove the trail
            E:setMass(5)
            E:removeTrails()
            #Designate the new prop and play with its properties
            E=O:aimEntity()
            E:setMaterial("models/debug/debugwhite")
            #E:setMaterial("models/props_combine/metal_combinebridge001")
            E:setMass(80000)
            print("Prop selected")
            Hold=1
        }
    }
    ^instructions: Press E on a prop, to select it. With MB1 you order the prop to go somewhere, by holding MB2 you do the same shit, but if you release it it comes back to your head.


    Your welcome!
    =^..^=
    ( ! ! )............
    Reply With Quote Edit / Delete Reply United States Show Events Friendly x 6Useful x 4Dumb x 3Bad Spelling x 1Informative x 1 (list)

  5. Post #5
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    Hey Ill post as many as I got from the thread (all that intrested me)
    (that was an amazing thread *takes off hat and bows*)
    ------------And can you make an E2 that will act as a gyroscope? (dampen pitch, yaw, and roll)-------------------------


    Now for the lost codes (I know this is long but here you go, sorry). Here is the applyforce hoverer Dirivan mande for me:
    *codes*
    That's a lot. :D
    But just so you know, that Prop Circle E2 sucks. I've already made one that can use an unlimited amount of props.
    And to anyone who asks, I didn't make "MetadorForAll"

    Edit:
    Code:
    @name E2 Gyroscope
    @inputs Ent:entity OffsetPitch OffsetYaw OffsetRoll OffsetAngle:angle
    @outputs Pitch Yaw Roll Angle:angle PitchVel YawVel RollVel AngleVel:angle
    runOnTick(1)
    #If Ent is wired, use that, else use the E2 itself:
    En = (Ent ? Ent : entity())
    #Set the offset (and prioratize the :angle input over numeric inputs):
    Offset = (OffsetAngle ? OffsetAngle : ang(OffsetPitch,OffsetYaw,OffsetRoll) )
    #Get the angle:
    Angle = En:angles() + Offset
    #Get the angle velocity:
    AngleVel = En:angVel()
    #Numeric outputs:
    Pitch = Angle:pitch()
    Yaw = Angle:yaw()
    Roll = Angle:roll()
    PitchVel = AngleVel:pitch()
    YawVel = AngleVel:yaw()
    RollVel = AngleVel:roll()

  6. Post #6
    Gold Member
    Balto-the-Wolf-Dog's Avatar
    June 2009
    1,817 Posts
    about how much dampening is there? I dont want keepupright just to be clear. (I havent tested yet)..

    Oh is there a way this could be turned on and off? I am using it in a VTOL to smooth touchy handling. I would prefer it only to be active during vertical flight (shit key) so that the plane maintains its manuverability in horizontal flight


    LOL I had a blast with the prop circle e2!!! If your telling me there is a better version then LOL
    Reply With Quote Edit / Delete Reply United States Show Events Funny Funny x 1 (list)

  7. Post #7
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    about how much dampening is there? I dont want keepupright just to be clear. (I havent tested yet)..

    Oh is there a way this could be turned on and off? I am using it in a VTOL to smooth touchy handling. I would prefer it only to be active during vertical flight (shit key) so that the plane maintains its manuverability in horizontal flight


    LOL I had a blast with the prop circle e2!!! If your telling me there is a better version then LOL
    Dampening? I didn't put any dampening in there. It's just a gyroscope with some Offset inputs. What do you mean by "dampening"?

    Put "On" in inputs, after all the Offset inputs, and then put a giant "if (On) { ... }" around all the code. Let me know if you don't get it.

    And yes. Ever heard of Balls of Steel? When I saw that E2, I tried to make my own. After several tries, I got it working. It works almost just like balls of steel, with some of my own additions.

    EDIT:
    Here's a really funny E2 I made that makes you say "HAX" whenever you use the crowbar:
    Code:
    @name Crowbar Hax
    interval(10)
    Atk = owner():keyAttack1()
    Wpn = owner():weapon():type()
    if (Atk & Wpn == "weapon_crowbar") {
        timer("Sound",700)
        if (clk("Sound") | changed(Atk)) {
            owner():soundPlay(1,0.7,"vo/npc/male01/hacks0"+randint(1,2)+".wav")
            soundPitch(1,165)
        }
    } else {soundStop(1)}
    And here is V2. It does the same thing, except works for everyone on the entire server at the same time. And it's just generally better than the other one.
    Code:
    @name Crowbar Hax for Everone
    @persist Ply:array PlyUse:array
    if (first()) {
        findByClass("player")
        Ply = findToArray()
        for(I=1,Ply:count()) {PlyUse[Ply:entity(I):id(),number] = 45, holoCreate(I),holoPos(I,Ply:entity(I):shootPos()),holoParent(I,Ply:entity(I)),holoAlpha(I,0)}
    }
    interval(10)
    for(I=1,Ply:count()) {
        En = Ply:entity(I)
        Atk = En:keyAttack1()
        Wpn = En:weapon():type()
        if (Atk & Wpn == "weapon_crowbar") {
            Nr = PlyUse[En:id(),number]
            PlyUse[En:id(),number] = Nr + 1
            if (Nr>50) {
                PlyUse[En:id(),number] = 0
                holoEntity(I):soundPlay(I,0.7,"vo/npc/male01/hacks0"+randint(1,2)+".wav")
                soundPitch(I,165)
            }
        } else {soundStop(I), PlyUse[En:id(),number] = 45}
    }

  8. Post #8
    Gold Member
    jmazouri's Avatar
    May 2005
    1,486 Posts
    Never posted this, but might as well. It's my old chatbot, some shit might not work anymore, but meh:
    Code:
    @name Jmazouri's Incredible chat Parser [JIP] v0.6
    @inputs Link:wirelink
    @outputs Update
    @persist
    @trigger 
    
    #################################################################################################
    
    if (first()|duped()) {
        concmd("wait 150; say "+"[JIP] Has just been spawned! Find it on the map!")
    }
    
    timer("update",10000)
    
    if (clk("update")) {
        Update = 1
    } else {Update = 0}
    
    if (first()) {
        holoCreate(550)
        holoCreate(551)
        holoCreate(552)
        holoCreate(553)
        holoCreate(554)
        holoCreate(555)
        holoCreate(556)
        holoPos(550,entity():pos()+vec(0,-20,50))
        holoPos(551,entity():pos()+vec(0,-27,31))
        holoPos(552,entity():pos()+vec(0,10,45))
        holoPos(553,entity():pos()+vec(0,10,59))
        holoPos(554,entity():pos()+vec(0,10,31))
        holoPos(555,entity():pos()+vec(0,40,45))
        holoPos(556,entity():pos()+vec(0,54.2,54.6))
        holoScaleUnits(550,vec(1,10,30))
        holoScaleUnits(551,vec(1,25,10))
        holoScaleUnits(552,vec(1,10,20))
        holoScaleUnits(553,vec(1,30,10))
        holoScaleUnits(554,vec(1,30,10))
        holoScaleUnits(555,vec(1,10,40))
        holoScaleUnits(556,vec(1,20,20))
        holoMaterial(550,"models/XQM/LightLinesGB")
        holoMaterial(551,"models/XQM/LightLinesGB")
        holoMaterial(552,"models/XQM/LightLinesGB")
        holoMaterial(553,"models/XQM/LightLinesGB")
        holoMaterial(554,"models/XQM/LightLinesGB")
        holoMaterial(555,"models/XQM/LightLinesGB")
        holoMaterial(556,"models/XQM/LightLinesGB")
    }
    
        #Link:writeString("[JIP] Command List, v0.6",3,2,900,0,1) 
        #Link:writeString("OWNER ONLY COMMANDS",1,4,119,0,0) 
        #Link:writeString("kill, playerinfo, entinfo,",1,6,900,0,0) 
        #Link:writeString("music, musiclist, stopmusic,",1,8,900,0,0) 
        #Link:writeString("musicvolume",1,10,900,0,0) 
        #Link:writeString("GLOBAL COMMANDS (ANYONE)",1,12,191,0,0)
        #Link:writeString("8ball, givehp, comusage",1,14,900,0,0) 
    
    #################################################################################################
    runOnTick(1)
    runOnChat(1)
    
    
    RandomInteger1 = randint(1,3)
    RandomInteger2 = randint(1,19)
    
    JipTrig = owner():lastSaid():explode(" ")
    
    Var1 = JipTrig:string(1)
    Var2 = JipTrig:string(2)
    Var3 = JipTrig:string(3)
    Var4 = JipTrig:string(4)
    Var5 = JipTrig:string(5)
    Var6 = JipTrig:string(6)
    Var7 = JipTrig:string(7)
    Var8 = JipTrig:string(8)
    Var9 = JipTrig:string(9)
    Var10 = JipTrig:string(10)
    Var11 = JipTrig:string(11)
    Var12 = JipTrig:string(12)
    Var13 = JipTrig:string(13)
    Var14 = JipTrig:string(14)
    Var15 = JipTrig:string(15)
    Var16 = JipTrig:string(16)
    Var17 = JipTrig:string(17)
    Var18 = JipTrig:string(18)
    Var19 = JipTrig:string(19)
    Var20 = JipTrig:string(20)
    
    Player = findPlayerByName(Var3)
    
    
    #################################################################################################
    
    if (chatClk(owner()) == 1) {
    
    #################################################################################################
    
    if (Var1 == "jip") {
        
    #################################################################################################    
    # "kill" function
    
            if (Var2 == "kill") {
                Random = RandomInteger1
                if (Random == 1) {
                    Type = "maul"
                } elseif (Random == 2) {
                    Type = "slay"
                } elseif (Random == 3) {
                    Type = "sslay"
                }
                if (Random == 1| Random == 2| Random == 3) {
                concmd("ulx "+Type+" "+findPlayerByName(Var3):name())
            }
    }
    
    #################################################################################################
    # "findinfo" function
    
    if (Var2 == "entinfo") {
        
            PointEnt = owner():aimEntity()
            
         if (PointEnt) {
                
                if (PointEnt:isPlayer()) {
                    hint("Use \"playerinfo\" for players!",10)
                    } 
                    
            else {     
            hint("Type: "+PointEnt:type(),10)
            hint("R: "+PointEnt:getColor():x():toString(),10)
            hint("G: "+PointEnt:getColor():y():toString(),10)
            hint("B: "+PointEnt:getColor():z():toString(),10)
            hint("Owned by: "+PointEnt:owner():name(),10)
            hint("Ent ID: "+PointEnt:id():toString(),10)
            hint("Model: "+PointEnt:model(),10)
            }
        } 
        else {hint("You can't use this on the world, silly.",7)}
    }
    
    #################################################################################################
    # "playerinfo" function
    
    if (Var2 == "playerinfo") {
    
        if (Var3 != "") {
            Player = findPlayerByName(Var3)
            if (Player) {
            if(Player:isAdmin()==1){IsAdmin="Yes"}
            else {IsAdmin="No"}
            if(Player:isSuperAdmin()==1){IsSuperAdmin="Yes"}
            else {IsSuperAdmin="No"}
        hint("Name: "+Player:name(),10)
        hint("SteamID: "+Player:steamID(),10)
        hint("EntID: "+Player:id():toString(),10)
        hint("Ping: "+Player:ping():toString(),10)
        hint("Model: "+Player:model(),10)
        hint("Is an Admin?: "+IsAdmin,10)
        hint("Is a SuperAdmin?: "+IsSuperAdmin,10)
        }
        else {hint("Name was not found.",10)}
    }
        else {hint("That is not a Player! Use \"entinfo\"!",10)}
    }
    
    #################################################################################################
    
    # "music" function
    
        if (Var2 == "music") {
            Ballsack = table()
            Ballsack:setString("stillalive","music/portal_still_alive.mp3")
        Ballsack:setString("4kdegreeskelvin","music/portal_4000_degrees_kelvin.mp3")
        Ballsack:setString("gamestartup1","ui/gamestartup1.mp3")
        Ballsack:setString("gamestartup2","ui/gamestartup2.mp3")
        Ballsack:setString("gamestartup3","ui/gamestartup3.mp3")
        Ballsack:setString("gamestartup4","ui/gamestartup4.mp3")
        Ballsack:setString("gamestartup5","ui/gamestartup5.mp3")
        Ballsack:setString("gamestartup6","ui/gamestartup6.mp3")
        Ballsack:setString("gamestartup7","ui/gamestartup7.mp3")
        Ballsack:setString("ravebreak","ravebreak.mp3")
        if (Var3 == "stillalive" | Var3 == "4kdegreeskelvin" | Var3 == "gamestartup1" | Var3 == "gamestartup2" | Var3 == "gamestartup3" | Var3 == "gamestartup4" | Var3 == "gamestartup5" | Var3 == "gamestartup6" | Var3 == "gamestartup7"  | Var3 == "ravebreak") {
        owner():soundPlay(7331,0,Ballsack:string(Var3))
        } else {
        hint("That song does not exist!",10)}
        }
    
        if (Var2 == "musiclist") {
        concmd("wait 150;say Current [JIP] Music List, v0.6")
        concmd("wait 300;say To use, say \"jip music (songindexhere)\"")
        concmd("wait 450;say stillalive, 4kdegreeskelvin, gamestartup1-7, ravebreak")
    }
    
       if (Var2 == "stopmusic") {
        soundStop(7331) 
    }
    
       if (Var2 == "musicvolume") {
        soundVolume(7331,Var3:toNumber()) 
    }
    
    #################################################################################################
    #DO NOT REMOVE THESE TWO }s THEY ARE THE MOST IMPORTANT }s EVER
    }
    }
    
    
    #################################################################################################
    #################################################################################################
    #################################################################################################
    #Begin serverwide functions
    
    JipTrigS = lastSaid():lower():explode(" ")
    
    Var1S = JipTrigS:string(1)
    Var2S = JipTrigS:string(2)
    Var3S = JipTrigS:string(3)
    Var4S = JipTrigS:string(4)
    Var5S = JipTrigS:string(5)
    Var6S = JipTrigS:string(6)
    Var7S = JipTrigS:string(7)
    Var8S = JipTrigS:string(8)
    Var9S = JipTrigS:string(9)
    Var10S = JipTrigS:string(10)
    Var11S = JipTrigS:string(11)
    Var12S = JipTrigS:string(12)
    Var13S = JipTrigS:string(13)
    Var14S = JipTrigS:string(14)
    Var15S = JipTrigS:string(15)
    Var16S = JipTrigS:string(16)
    Var17S = JipTrigS:string(17)
    Var18S = JipTrigS:string(18)
    Var19S = JipTrigS:string(19)
    Var20S = JipTrigS:string(20)
    
    #################################################################################################
    
    if (chatClk() == 1) {
    JipLastSpokeS = lastSpoke()
    
    #################################################################################################
    
    if (Var1S == "jip") {
        
    #################################################################################################    
    # "8ball" function
    
            if (Var2S == "8ball") {
                if (Var3S == "do" | Var3S == "does" | Var3S == "am" | Var3S == "is" | Var3S == "should" | Var3S == "are" | Var3S == "did" | Var3S == "can" | Var3S == "will" | Var3S == "were" | Var3S == "have"| Var3S == "has") {
                Random = RandomInteger2
                Array = array()
                Array:setString(1,"My sources say Yes.")
                Array:setString(2,"My sources say no.")
                Array:setString(3,"Yes.")
                Array:setString(4,"No.")
                Array:setString(5,"Maybe.")
                Array:setString(6,"It is unknown.")
                Array:setString(7,"Do I look like I know?")
                Array:setString(8,"It's pretty damn obvious.")
                Array:setString(9,"Why are you so dense? Of course!")
                Array:setString(10,"You're kidding, right?. Of course not.")
                Array:setString(11,"There's a small chance.")
                Array:setString(12,"No, you goddamn retard.")
                Array:setString(13,"Yes, yes, a million times yes!")
                Array:setString(14,"Faggot.")
                Array:setString(15,"I'm an 8ball. I don't know everything.")
                Array:setString(16,"Some things, you don't need to know.")
                Array:setString(17,"You don't want to know...")
                Array:setString(18,"I think you already know the answer.")
                Array:setString(19,"Wat?")
                
    
                concmd("wait 150;say "+"[JIP] 8Ball says: "+Array:string(Random))
                }
                else {concmd("wait 160; say \"[JIP] 8Ball says: That's not how you use an 8ball, fucktard.\"")}
            }
    
    #################################################################################################
    
    # "givehealth" function
    
        if (Var2S == "givehp") {
            CurrentHP = lastSpoke():health()
            if (CurrentHP >= 90) {
                concmd("wait 150;say [JIP] "+lastSpoke():name():left(10)+", your health is fine.")
            } else {
            HPtoSet = CurrentHP+Var3S:toNumber()
            if (Var3S:toNumber()+CurrentHP > 101) {
                concmd("wait 150;say [JIP] "+lastSpoke():name():left(10)+", your health can't be >100.")
            }
            else {
            concmd("ulx hp "+"\""+lastSpoke():name()+"\""+HPtoSet) 
            }
        }
    }
    
    #################################################################################################
    
    # "comusage" function
    
        if (Var2S == "comusage") {
            if (Var3S == "8ball") {
                concmd("wait 150;say [JIP] \"jip 8ball [question]\"")
            }
            elseif (Var3S == "givehp") {
                concmd("wait 150;say [JIP] \"jip givehp [numberofhitpoints]\"")
            }
        }
            
    #################################################################################################    
    
    #DO NOT REMOVE THESE TWO }s THEY ARE THE MOST IMPORTANT }s EVER
    }
    }
    Wirelink it to a console screen, then uncomment the Link:* lines for a command list.

  9. Post #9
    RamenDefender's Avatar
    September 2009
    17 Posts
    now if only i knew what an E2 was...
    Reply With Quote Edit / Delete Reply United States Show Events Dumb x 28Funny x 18Agree x 6Bad Reading x 2Informative x 1Optimistic x 1Winner x 1 (list)

  10. Post #10
    Gold Member
    Balto-the-Wolf-Dog's Avatar
    June 2009
    1,817 Posts
    When I say dampening I am refering to making something resist pitching, rolling, and yawing. I want it to smooth the movements of my touchy vtol

  11. Post #11
    I DRAW SEALS
    xxfalconxx's Avatar
    March 2009
    6,094 Posts
    how about an E2 that warns someone not to touch something and if they touch it, it kills them with an applyforce ball and yells "I TOLD YA DON'T TOUCH THAT DARN THING." i'd make it, but i don't know applyforce.
    Reply With Quote Edit / Delete Reply United States Show Events Funny Funny x 2Zing Zing x 2Dumb Dumb x 1 (list)

  12. Post #12
    jonney934's Avatar
    December 2007
    238 Posts
    Simple code for servers that let anyone enter your seats, I got it from someone but I don't remember who, I added a few things too but I have not tested this since a few major wiremod changes.
    Code:
    @name AHC
    @inputs Pod:wirelink
    @outputs 
    @persist 
    @trigger all
    
    interval(100)
    
    #Anti-Hijacker Code
    
    if(Pod:entity("Entity"):driver():steamID() != owner():steamID() & Pod:number("Active") >= 1) {
    Pod:printDriver("Terminated for trying to steal "+owner():name()+"'s vehicle.")
    print(Pod:entity("Entity"):driver():name()+" tried to steal your vehicle.")
    Pod:setNumber("Terminate", 1)
    } else {
    Pod:setNumber("Terminate", 0)
    }
    Reply With Quote Edit / Delete Reply United States Show Events Informative Informative x 1Friendly Friendly x 1 (list)

  13. Post #13
    Gold Member
    Balto-the-Wolf-Dog's Avatar
    June 2009
    1,817 Posts
    can you make me suspension?

  14. Post #14
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    Simple code for servers that let anyone enter your seats, I got it from someone but I don't remember who, I added a few things too but I have not tested this since a few major wiremod changes.
    Code:
    @name AHC
    @inputs Pod:wirelink
    @outputs 
    @persist 
    @trigger all
    
    interval(100)
    
    #Anti-Hijacker Code
    
    if(Pod:entity("Entity"):driver():steamID() != owner():steamID() & Pod:number("Active") >= 1) {
    Pod:printDriver("Terminated for trying to steal "+owner():name()+"'s vehicle.")
    print(Pod:entity("Entity"):driver():name()+" tried to steal your vehicle.")
    Pod:setNumber("Terminate", 1)
    } else {
    Pod:setNumber("Terminate", 0)
    }
    Optimized:
    Code:
    @inputs Pod:wirelink
    interval(500) #Doesn't need to be faster.
    Pod["Terminate",number] = Pod["Entity",entity]:driver() != owner() #If the driver isn't you, terminate.
    #You could of course put those print messages in here if you want.
    Edited:

    can you make me suspension?
    An applyForce suspension or what? I've tried that once but failed. Although that was a while ago.
    Making a suspension out of applyForce sucks. The best suspensions are either rope tool, elastics, or weight changing.

    Edited:

    When I say dampening I am refering to making something resist pitching, rolling, and yawing. I want it to smooth the movements of my touchy vtol
    Use Delta:
    Code:
    @name Delta example
    @inputs Pitch
    @outputs Pout
    Pout = -Pitch - $Pitch * 4
    #Copy this code for Yaw and Roll
    Wire some thrusters to this to stabilize the prop.
    Reply With Quote Edit / Delete Reply Sweden Show Events Funny Funny x 1 (list)

  15. Post #15
    fightnight22's Avatar
    December 2008
    725 Posts
    I need an e2 that makes a yellow exclamation point (!) above your head. Sorry but im new to Expression 2

  16. Post #16
    Project Lead, Internet Explorer for Linux
    lavacano's Avatar
    October 2008
    14,616 Posts
    I need an e2 that makes a yellow exclamation point (!) above your head. Sorry but im new to Expression 2
    This can be done with the hologram functions. But I have no idea how to use them, so I'll let Divran help ya thar
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 1 (list)

  17. Post #17
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    I need an e2 that makes a yellow exclamation point (!) above your head. Sorry but im new to Expression 2
    Code:
    @name !!!
    @persist 
    @trigger 
    O = owner()
    # |
    holoCreate(1,O:pos()+vec(0,0,120))
    holoScale(1,vec(1,1,3))
    holoColor(1,vec(255,255,0))
    holoMaterial(1,"models/debug/debugwhite")
    holoAng(1,O:angles())
    # .
    holoCreate(2,O:pos()+vec(0,0,90))
    holoColor(2,vec(255,255,0))
    holoMaterial(2,"models/debug/debugwhite")
    holoAng(2,O:angles())
    
    holoParent(1,O), holoParent(2,O)

  18. Post #18
    fightnight22's Avatar
    December 2008
    725 Posts
    thanks

  19. Post #19
    Infinity1995's Avatar
    August 2009
    959 Posts
    An e2 that aims where I aim and floats NOT above my head but about 1 meter of the floor

    Ps: you weld the e2 on any prop and it does it.

  20. Post #20
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    Code:
    @name Yet another turret
    @persist E:entity Ang:angle StartPos:vector
    @trigger
    runOnTick(1)
    if (!E) {
        E = entity():isWeldedTo()
        StartPos = E:massCenter() + vec(0,0,E:boxSize():z() + 50)
    } else {
        E:applyForce(((StartPos-E:massCenter())*10-E:vel())*E:mass())
        #You will need to change "Multiplier" for each different prop. But it must always be negative.
        Ang = ang(E:elevation(owner():aimPos()),E:bearing(owner():aimPos()),E:angles():roll()) * -Multiplier
        E:applyAngForce(Ang+$Ang*5)
    }
    UNTESTED
    Reply With Quote Edit / Delete Reply Sweden Show Events Useful Useful x 1 (list)

  21. Post #21
    Infinity1995's Avatar
    August 2009
    959 Posts
    Thanks, if it don't work I'll fix it and post here

  22. Post #22
    fightnight22's Avatar
    December 2008
    725 Posts
    Code:
    @name GM_Construct Snow
    runOnTick(1)
    if(first() | duped()){
        print("GM_Construct Hologram")#prints one message
        print("For use on GM_Construct and other small maps")#prints another message
        entity():setAlpha(50)#sets chips alpha (opacity)
        holoCreate(1)#creates first hologram
        holoModel(1, "plane")#makes the model cylinder
        holoScale(1, vec(9999,9999,9999))#scales the first hologram
    }
    #changes to disco color :D
    
    #changes positions
    holoPos(1, entity():pos())#makes the hologram follow the chip
    Can you make that have a cs:s snow texture?

    Edited:

    sorry but im new to e2

  23. Post #23
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    Code:
    @name GM_Construct Snow
    runOnTick(1)
    if(first() | duped()){
        print("GM_Construct Hologram")#prints one message
        print("For use on GM_Construct and other small maps")#prints another message
        entity():setAlpha(50)#sets chips alpha (opacity)
        holoCreate(1)#creates first hologram
        holoModel(1, "plane")#makes the model cylinder
        holoScale(1, vec(9999,9999,9999))#scales the first hologram
    }
    #changes to disco color :D
    
    #changes positions
    holoPos(1, entity():pos())#makes the hologram follow the chip
    Can you make that have a cs:s snow texture?

    Edited:

    sorry but im new to e2
    Code:
    entity():setAlpha(50) #<- Opacity
    holoCreate(1) #<- Create the hologram
    holoModel(1,"plane") #<- Turn it into a 2d plane
    holoScale(1,vec(5000,5000,1)) #<- Make it very big
    holoMaterial(1,"here") #<- Put the css snow texture file path here, without .vtf or anything
    holoParent(1,entity()) #<- Parent it to make it follow the e2 around (doesn't use runOnTick and therefore 0 ops!)
    You're going to have to find the material for the snow yourself.

  24. Post #24
    Gold Member
    Balto-the-Wolf-Dog's Avatar
    June 2009
    1,817 Posts
    EDIT:

    There is an E2 I am more intrested in. I need an e2 that simply aims where I aim and can be linked to a seat so that it only operates when I am in the seat. Essentaily a wire facer. I dont want it to hover, just look where I do

  25. Post #25
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    EDIT:

    There is an E2 I am more intrested in. I need an e2 that simply aims where I aim and can be linked to a seat so that it only operates when I am in the seat. Essentaily a wire facer. I dont want it to hover, just look where I do
    Get the "Yet another turret" code above and remove the "applyForce" code, leaving only "applyAngForce".

  26. Post #26
    Gold Member
    Balto-the-Wolf-Dog's Avatar
    June 2009
    1,817 Posts
    kk thanks. You are awsome. Is there a way to link it to a seat and have it operate only side to side and not up and down?

    I want this for directing podracer pods, so i can have a mouse steering one.

  27. Post #27
    RagaMuffin's Avatar
    August 2009
    1,285 Posts
    Adv Ballsocket magic would stop it going up and down if you wanted it to...

  28. Post #28
    Gold Member
    pedroion's Avatar
    December 2007
    4,351 Posts
    And and E2 that causes selected props to fly at your crosshair on command with great velocity:
    Code:
    @name MatadorForAll
    @persist E:entity O:entity Hold Attack Dest:vector Vec:vector Ang:angle
    if(first()){
        #Make the angle for the death ball to spin randomly
        A = 45
        Ang = ang(randint(-A,A),randint(-A,A),randint(-A,A)) * 50000
        #Hide the chip
        entity():setColor(0,0,0,0)
        O = owner()
        runOnTick(1)
    }
    
    Pos=E:pos()
    #Spin the ball randomly
    E:applyAngForce(Ang+$Ang*5)
    #Only hover if the owner is alive
    if(O:isAlive()){
        #If holding, then move the chip above the owners head
        if(Hold){
            #Set Destination
            Dest=O:pos()+vec(0,0,(200+E:radius()))
            #If the ball is close, move slowly and accurately
            if(Pos:distance(Dest)<50){
                Attack = 0
                Vec=(Dest-Pos)*E:mass()
                E:applyForce(Vec+$Vec*5)
            }
            #If its far away, move quickly
            else{
                Vec=(Dest-Pos)*E:mass()*Pos:distance(Dest)*50000
                E:applyForce(Vec)
            }
        }
        #If the owner left clicks, start the attack sequence
        if(Attack==0&O:keyAttack1()&E&O:aimEntity()!=E){
            #Just incase it gets stuck
            stoptimer("ManualReset")
            timer("ManualReset",3000)
            Dest=O:aimPos()
            Hold=0
            Attack=1
        }
        #Attack Code - Strikes the spot once
        if(Attack==1){
            Vec=(Dest-Pos)*E:mass()*50000*Pos:distance(Dest)
            E:applyForce(Vec)
            #When the ball reaches its target, go back to holding
            if((Pos:distance(Dest)<20)){
                Attack=2
                Hold=1
            }
        }
        #Attack 2 code - Flys constantly at the spot
        if(O:keyAttack2()&E&O:aimEntity()!=E){
            Attack=0
            Hold=1
            Dest=O:aimPos()
            Vec=(Dest-Pos)*E:mass()*50000*Pos:distance(Dest)
            E:applyForce(Vec)
        }
        if((O:keyUse()|O:keyAttack1()|O:keyAttack2())&!E){
            print("ERROR: No prop selected")
        }
        #If porp is stuck, return to owner
        if(clk("ManualReset")){
            Attack=0
            Hold=1
        }
        #Prop selection code
        if(O:keyUse()&O:aimEntity()&O:aimEntity()!=E){
            #Set the old prop to 5 mass and remove the trail
            E:setMass(5)
            E:removeTrails()
            #Designate the new prop and play with its properties
            E=O:aimEntity()
            E:setMaterial("models/debug/debugwhite")
            #E:setMaterial("models/props_combine/metal_combinebridge001")
            E:setMass(80000)
            print("Prop selected")
            Hold=1
        }
    }
    ^instructions: Press E on a prop, to select it. With MB1 you order the prop to go somewhere, by holding MB2 you do the same shit, but if you release it it comes back to your head.
    It was me who posted it :)
    Made by a friend of mine by request.
    Just a simple copypasta.

    And Matador means Killer, in Portuguese and Spanish (I guess).

    @Topic: Divran, you got one of the best topics out here, congratulations and kee up ze good wörk.

    I was wondering if you ever used the Gyro-Pod. Would you make an E2 that turns any vehicle into something like it?

  29. Post #29
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    I was wondering if you ever used the Gyro-Pod. Would you make an E2 that turns any vehicle into something like it?
    Wayyyy too hard for me. But a guy named Techni made one, and I helped him optimize it. http://www.wiremod.com/forum/contrap...ed-flight.html

    Here is the post with the newest code: http://www.wiremod.com/forum/contrap...tml#post141172

  30. Post #30
    ThisIsMyUsername's Avatar
    February 2009
    478 Posts
    Yay! The new thread! :D
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 2 (list)

  31. Post #31
    Infinity1995's Avatar
    August 2009
    959 Posts
    Noooo! The old thread
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 2 (list)

  32. Post #32
    xThaWolfx's Avatar
    October 2009
    285 Posts
    now if only i knew what an E2 was...
    well..E2 is expression2, this comes with the WireSVN version of wire.
    it uses codes like gates do, but all in 1 expression2 gate
    Reply With Quote Edit / Delete Reply Netherlands Show Events Late Late x 8Dumb Dumb x 1 (list)

  33. Post #33
    Ratzz's Avatar
    July 2009
    1,001 Posts
    Can I have an e2 that makes electrons float around me like I am some kind of atom? :D

    Edited:

    Is it possible to make it so when I crouch it puts a box around me?

  34. Post #34
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    Here's an E2 stalker I made for a guy in a different thread.

    Code:
    @name Stalker
    @persist E:entity Target:entity
    runOnTick(1)
    if (findCanQuery()) {
        findByClass("player")
        Target = findClosest(E:massCenter())
    }
    if (!E) {E = entity():isWeldedTo()} elseif (E & Target) {
        E:applyForce(((Target:pos()+vec(0,0,45)-E:massCenter())*10-E:vel())*E:mass())
    }
    UNTESTED

  35. Post #35
    Ratzz's Avatar
    July 2009
    1,001 Posts
    Here's an E2 stalker I made for a guy in a different thread.

    Code:
    @name Stalker
    @persist E:entity Target:entity
    runOnTick(1)
    if (findCanQuery()) {
        findByClass("player")
        Target = findClosest(E:massCenter())
    }
    if (!E) {E = entity():isWeldedTo()} elseif (E & Target) {
        E:applyForce(((Target:pos()+vec(0,0,45)-E:massCenter())*10-E:vel())*E:mass())
    }
    UNTESTED
    Divran, when do you expect my codes to be done?

  36. Post #36
    RagaMuffin's Avatar
    August 2009
    1,285 Posts
    You only posted it 3 hours ago, give him a day at least...

  37. Post #37
    ThisIsMyUsername's Avatar
    February 2009
    478 Posts
    Divran, when do you expect my codes to be done?
    Ratzz, if you don't want to wait, go look at the wiki and make it yourself.

    Edited:

    Also, I have two from the old thread:
    Attracts props of a certain type. I never used this one actually. Dunno if it works:
    Code:
    @name Prop Attractor
    @inputs On Force Model:string
    @persist Mdl:string Props:array Count
    @trigger all
    if (Model == "") {Mdl = ""} else {Mdl = Model} #If you leave "Model" unwired, you can put any model where it says "put model here" to use that instead of the input.
    if (first()|duped()) {
    runOnTick(1) #Update the entity
    findClipToModel(Mdl) #Find props of this model
    Props = findToArray() #Save them to an array
    }
    
    if (On) { #If On...
    EM = entity():massCenter() #Destination variable.
    Force = clamp(Force,1,50000) #Clamp the force (This makes you able to leave Force unwired. If you do, Force will be 1)
    
    for(I=1,min(15,Props:count())) { #A loop (The thing I have here with Count makes the E2 able to handle an infinite amount of props without hitting tick quota. If it STILL hits tick quota, lower the number. min(->15<-,Props:count()) <- this number.
    Count++ #Add count to itself
    if (Count>Props:count()) {Count=1} #If count is higher than the amount of props, reset count
    E = Props[Count,entity] #Set E
    if (!E|E==noentity()) {Props:remove(Count),continue} else { #If E doesn't exist, remove E and start restart the loop
    Dir = EM-E:massCenter() #Direction
    E:applyForce((Dir-E:vel())*Force*E:mass()) #Apply the force
    }
    }
    
    }
    When attached to a prop, the prop will attack a player when you say ".attack <playername>". To stop it, you must say ".off":
    Code:
    @name Thing
    @persist [E Target]:entity
    @trigger
    if (first()) {
    #Starting stuff
    E = entity():isWeldedTo() #isWeldedTo will make the e2 apply the force to the prop it is welded to instead of the e2 itself.
    runOnTick(1)
    runOnChat(1)
    }
    #If you said something..
    if (chatClk(owner())) {
    #Explode for easier use
    M = lastSaid():explode(" ")
    #Attack:
    if (M:string(1) == ".attack") {
    hideChat(1) #Hide chat message
    Target = findPlayerByName(M:string(2)) #Attempt to find the player
    if (Target) { #If found..
    print("Attacking " + Target:name())
    } else { #If not found..
    print("No player named '" + M:string(2) + "' found.")
    }
    #Stop attacking:
    } elseif (M:string(1) == ".off") {
    hideChat(1) #Hide chat message
    print("Stopped attacking " + Target:name()) #Notify
    Target = noentity() #Set Target to nil
    }
    } elseif (tickClk() & Target) { #If current execution was caused by runOnTick() and if Target is a valid entity, apply force.
    E:applyForce(((Target:pos()+vec(0,0,45)-E:massCenter())*10-E:vel())*E:mass())
    }

  38. Post #38
    cruiser97's Avatar
    April 2009
    15 Posts
    Hey Divran, awesome thread, I've been working on an applyForce elevator for some time, and it seems to work but it's kind of eh. The speed is what is difficult too control for me. I've tried adjusting the mass, but it has to be different for different heights. And going up at a decent speed might be fine, but then going back down injures me from the elevator falling to fast. I will post what I have so far if you want, but I'm curious to see if you can create one.

    I'm looking for an applyForce Elevator with an unlimited amount of floors that can be added. Being able to call the elevator to a floor and then of course going to a floor from inside the elevator would be nice. Any help is appreciated. :D
    Reply With Quote Edit / Delete Reply United States Show Events Artistic Artistic x 1 (list)

  39. Post #39
    RagaMuffin's Avatar
    August 2009
    1,285 Posts
    I remember this idea from the other thread, and it sounds pretty cool. Heres the idea:

    It would be attached to a PHX plate, and the attached object would always be under you. When you jumped, it moved up with you but you didn't fall back down. When you crouched it goes down, if you move it stays under you. Also it's X rotation or whatever would be wherever you aim, so it turns with you. Almost like a version of noclip that you can attach some 'toys' to.

    (By toys i mean guns if you didn't get that.)

  40. Post #40
    Gold Member
    Divran's Avatar
    April 2008
    2,629 Posts
    Hey Divran, awesome thread, I've been working on an applyForce elevator for some time, and it seems to work but it's kind of eh. The speed is what is difficult too control for me. I've tried adjusting the mass, but it has to be different for different heights. And going up at a decent speed might be fine, but then going back down injures me from the elevator falling to fast. I will post what I have so far if you want, but I'm curious to see if you can create one.

    I'm looking for an applyForce Elevator with an unlimited amount of floors that can be added. Being able to call the elevator to a floor and then of course going to a floor from inside the elevator would be nice. Any help is appreciated. :D
    Already made one like this a while ago :P
    To use it, put a prop directly below the elevator prop, then spawn the e2 on the elevator prop.. The ranger in the if first case needs to find a prop below the elevator prop for it to work correctly.
    Code:
    @name Elevator
    @persist Pos:vector Ang:angle X Y Z Diff Prop:entity Ent:entity Ply:entity
    @trigger all
    
    if (first()) {
        runOnTick(1)
        runOnChat(1)
        Prop = entity():isWeldedTo()
        rangerFilter(Prop)
        Ent = rangerOffset(Prop:massCenter(), Prop:massCenter() - vec(0,0,200)):entity()
        X = Y = 0
    }
    
    if (chatClk()) {
        if (lastSpoke():pos():distance(Prop:massCenter()) < 50) {
            Msg = lastSaid():lower():explode(" ")
            if (Msg:string(1) == ".floor") {
                X = Msg:string(2):toNumber()
            }
        }
    }
    
    Y = X * 105
    
    if (Z != Y) {
        Diff = sign(round(Y-Z))
        Z+=Diff*1.5
    }
    
    if (tickClk()) {
        Pos = (Ent:massCenter():setZ(Z+10) - Prop:massCenter()) * 2000
        Ang = Prop:angles() * -10000
        Prop:applyForce(Pos+$Pos*10)
        Prop:applyAngForce(Ang*3+$Ang*30)
    }